Jump to content

Selected polygon properties

Recommended Posts

def rename(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


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.