Jump to content
webdevsimon

Selected polygon properties

Recommended Posts

def rename(h):

    vs.AlrtDialog(h)
    return ()

vs.ForEachObject(rename, "((L='Layer') & (SEL=TRUE))")

Hi, sorry in advance if I'm not using the correct terms. I'm new to Vectorworks and I want to write a script which get the properties of selected objects.

 

At the moment I have a Handle object which does show me the attributes of the selected object.

 

I want to use the data to populate other objects in the same layer.

Share this post


Link to post

Hi

Im am not sure, what you are planing exactly. To be clear: I have no Idea, but I would like to help you. As far as I can see:

1. You loop all selected Objects in the Layer-Name 'Layer' and apply the function rename().

2. The function rename shows a dialog Box with the handle value (which is a good test to show, if your script works -as far as we don't select hundreds of objects to test)

 

If you want to use data of those objects you can pull them in your function. like a.E. 'vs.GetName(h)' to get the Name of the object. Or other vs-methods which gets other kind of data.

Then the next step would be, to handle the "other objects in the same layer." to populate them with this data. Maybe with the criteria "((L='Layer') & (SEL=FALSE))" to get all other objects in the same layer?

 

If you want to delete objects or change stacking order (or other things, that affects the criterial or the order) you should write your handles in a list variable and change them in a second loop (for item in ..... as Example)

 

 

 

 

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...