Jump to content
Sign in to follow this  
unlimited

Get Class List but no Get Layer List

Recommended Posts

I note that there is a Get Class List Node but not a Get Layer List Node. Looking in the Vectorscript procedures there is not a call for Get Layer List in the same way that there is one for Get Class List.

Is there a way to generate a Layer List at all?

Many thanks,

Martyn

Share this post


Link to post
layers = [None] * vs.NumLayers()

h = vs.FLayer ()

i = 0

while h != 0:

layers = ( vs.GetLName (h) )

h = vs.NextLayer (h)

i += 1

print (layers)

I initialized the layerlist with None for performance reasons.

Edited by Patrick Winkler

Share this post


Link to post

Hi Patrick, many thanks.

Sorry to ask a silly question, but what do I do with this?

I tried adding this to a Node but I received a Syntax error or an Indentation Error.

Thanks,

Martyn

Edited by unlimited

Share this post


Link to post

Hi Martyn,

sorry the indendations got lost when I posted the code here.

Indendation is needed in python seperate the code blocks...

Just look into this file:

Share this post


Link to post
Hi Martyn,

sorry the indendations got lost when I posted the code here.

Indendation is needed in python seperate the code blocks...

Just look into this file:

Patrick,

Two things might make this easier in the future.

1. If you use the full Quote (not quick quote) editor and choose to insert code in a code block (click on the # sign and then choose Code from the drop down), the indentation should be OK.

2. It would also help to specify that you are using Python. Since code can now be posted in both Python and Vectorscript, I am recommending that all posters of snippets make that distinction to make it easier for others to follow.

Pat

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.

Sign in to follow this  

 

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