Jump to content
Developer Wiki and Function Reference Links ×

help needed


Recommended Posts

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

Link to comment

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

Link to comment

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...