mfundo Posted March 7, 2008 Share Posted March 7, 2008 i need help on a drawing...i have about 92 polygons with different shape and sizes, i hav created a record format to gave each polygon, a number and location, I need the area on the object info-shape pallate to be automatically uploaded on the record format on the object info-data so i don't have manually type it in...is this possible Quote Link to comment
Pat Stanford Posted March 7, 2008 Share Posted March 7, 2008 If this is a one time thing and the polys are not going to change size, I recommend using the 2-way worksheet if you are in VW2008. Set up a worksheet database to display the 92 polys. Set the formula for one column to =area. Set another column to =record.field where record and field are your record name and field name. If there are spaces in the names, you need to surround each full name with single quotes. If this is something that is going to change often, let me know and I migh thave a script that can be modified to do what you want. Pat Quote Link to comment
mfundo Posted March 11, 2008 Author Share Posted March 11, 2008 Unfortunately the polys will be changing Quote Link to comment
Pat Stanford Posted March 11, 2008 Share Posted March 11, 2008 Ok, try this script: {*********************} Procedure Area_to_Record; {Stores the area of an object to an appropriate} {field in a record attached to the object.} {March 11, 2008} {? 2008, Coviana, Inc - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} const RecName='PTS_Record'; Field='Area'; Decimals=2; var H1:Handle; R1:Real; Procedure FillRecord(H2:Handle); Begin SetRField(H2,RecName,Field,Num2Str(Decimals,HArea(H2))); End; Begin ForEachObject(FillRecord,((R IN [RecName]))); End; Run(Area_to_Record); {*********************} Copy everything between the stars and paste it into a blank script. Near the top in the section called const, change the RecName, and Field to use your record name and field name. Change the Decimals to the number of decimal places you want to have in your area. When you run the script, it will go through and replace the "Area" field with the area of the abject that has the record attached. Pat Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.