Guest unlimited Posted March 21, 2016 Share Posted March 21, 2016 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 Quote Link to comment
Patrick Winkler Posted March 22, 2016 Share Posted March 22, 2016 (edited) 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 March 22, 2016 by Patrick Winkler Quote Link to comment
Guest unlimited Posted March 23, 2016 Share Posted March 23, 2016 (edited) 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 March 23, 2016 by unlimited Quote Link to comment
Patrick Winkler Posted March 23, 2016 Share Posted March 23, 2016 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: Quote Link to comment
Guest unlimited Posted March 23, 2016 Share Posted March 23, 2016 Ah great - and thanks for responding to my notes in the node Quote Link to comment
Pat Stanford Posted March 24, 2016 Share Posted March 24, 2016 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 Quote Link to comment
Patrick Winkler Posted March 25, 2016 Share Posted March 25, 2016 def test(): print ('Alright thanks for the tip :)') Quote Link to comment
Recommended Posts
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.