Jump to content

Perimeter of line within symbol


Recommended Posts

Hey all,

Attempting to make a worksheet at the moment, summarising my Lighting Positions.

Just generated a standard report listing my lighting positions, all good. Each of the lighting positions is made from a polyline, multiple points and a perimeter shown in the object info. Also all good and happy.

So here's the catch, the worksheet shows the lighting positions, one of the fields has ='light position obj'.'symbol name' returning the symbol name. I then somehow next to this field (preferably) need to have the perimeter value of the line within the symbol mentioned in the previous cell.

Any ideas?

Might be able get a script to return the value into a record attached to the object and then reference this but it seems like a long work around and I don't have a way as yet of getting a handle on an object in a symbol.

J

Link to comment

Also so you all have an idea on where this is heading the lighting positions are track which is generated by a previous script, to be calculated in a linear meterage. We're attempting to have vectorworks calculate totals and round them to meter or 4mt pieces eventually, but just pulling the perimeter value is the first step.

Cheers,

J

Link to comment

A record attached to the symbol with the perimeter value would be the best way to reference in a worksheet.

The following code will give you the handle to each object in the symbol:

SetActSymbol('symbol name');

IF ActSymDef <> NIL THEN

BEGIN

objInSym:= FInSymDef(ActSymDef);

WHILE objInSym <> NIL DO

BEGIN

......

......

objInSym:= NextSymDef(objInSym);

END;

END;

Link to comment

Miguel,

Thanks for your reply.

I've been playing a bit with this and stripped right back what you've written to what I think is the working bear basics. I've attached my example file for anyone who'd like a look and possible can solve, why this doesn't return a value.

Procedure Pobj;

VAR

objInSym :Handle;

Pval :Integer;

BEGIN

SetActSymbol('1');

objInSym:= FInSymDef(ActSymDef);

Pval := Perim(objInSym);

message(Pval);

END;

Run (Pobj);

Also I'm a little lost on another part of this which is loop lookups.

The SetActSymbol(*) will eventually for me need to be a lookup for all Lighting Position objects and then take each of the 'Light Position Obj'.'Symbol Name' from them and then the above procedure each of those and save the values into a record attached to the Lighting Position Obj the symbol came from.

I'll attempt to write a basic layout:

Criteria=Lighting Device

First Lighting Device

Take the Symbol Name of Lighting Device

Inside this Symbol take the Perimeter of the object

Save this value to a Record on the Lighting Device

Next Lighting Device until NIL

I just don't have the skills to do this kind of lookup loop, if someone could write a semi annotated procedure on this I'd be very appreciative.

And if you've read this far, thanks.

J

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...