Jump to content

Rename objects

Recommended Posts



No way to rename objects (rectangle or polygons) with:

Even with 3D polygons the problem is the same.


But If the element is a sphere it works. Why?



import vs

ObjectName = vs.GetName(vs.FSActLayer())

SName = 'Fred'
points = [0,0,-0.5,1,0.5,1.5,2,1,1,-0.5,0,0]
h1 = vs.Poly(*points)
vs.SetName(h1, SName)
import vs

X1 = 100
Y1 = 150
X2 = 0
Y2 = 500
NombreStand = 'Nombre'

SName = vs.Concat(NombreStand)
h = vs.Poly(0,0,X1,Y1,X2,Y2,0,0)

h1 = vs.SetPolyClosed(h, 1)

h2 = vs.MakePolygon(h1)


vs.SetName(h2, SName)


This one works perfect!

import vs

ObjectName = vs.GetName(vs.FSActLayer())

SName = 'Fred'
h1 = vs.CreateSphere(0, 0, 0, 1000)
vs.SetName(h1, SName)


I am wondering if the problem is that are 2D elements, (that has no sense at all)

Share this post

Link to post
def vs.Poly(p):
    return None


Poly is not returning tha handle 😉

Look for the function LastCreatedObj or similiar to get the handle.



To slow.

But one addition if you want to make sure that LNewObj is giving you the right obj you can first execute LNewObj save the handle then create the poly, do LNewObj again and check if the result is not the same as from the first call.

Edited by PatW

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.

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