Jump to content

vs.GetLName doesn't work

Recommended Posts



I don't understand, why the GetLname-Function in the following code doesn't work, the GetClass-Function instead does work.

Both functions work with a Handle (HNDL) and return a String value.

def CalledProc(HNDL):
#	LNR=vs.GetClass(HNDL)

I attached a small vwx 2022 file with a few rectangles and a python script with the posted code which (as you can read) reads out the class name or the layer name and writes it into the record format field "layer" from the record format "l-test".


any idea why GetClass works and GetLName instead doesn't? I tried the function in other scripts, of course, too, without any differences...


Link to comment

GetLName returns the name of the referenced layer, eg.

# the current design layer name = 'Layer 1'
# to get a handle to the active layer, you'd use vs.ActLayer()

layername = vs.GetLName(vs.ActLayer())
# should display 'Layer 1'


I think what you're after is vs.GetLayer(HNDL).



and then vs.GetLName


h = vs.FSActLayer()
layer_name = vs.GetLName(vs.GetLayer(h))
# vs.GetLayer(h) returns a HANDLE to the layer the object 'h' belongs to


Edited by twk
  • Like 1
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.

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