Jump to content

Layer number Position of a design layer and management SOLVED


Recommended Posts

Hello everyone.

 

I am trying to do something that looks easy but I don´t find the right functions:  "To change the position of a design layer"

 

The initial situation is this one:

 

Design Layer          #

Design Layer A --> 1

Design Layer B --> 2

 

Design Layer D --> 3

 

I want the layers like this:

 

Design Layer          #

Design Layer A --> 1

Design Layer B --> 2

Design Layer C --> 3

Design Layer D --> 4

 

Must be not so difficult to insert a new in a position because I can do manually when I create a new layer.

 

I need to know how to get the number of the "Design Layer B" --> 2

 

And be able to create a new layer at the next number.

 

this are my options, and no one is useful to my eyes

vs.Layer("Design Layer B")

vs.CreateLayer('NEW Design Layer', 1)

vs.CreateLayer('NEW PRESENTATION Layer = LAYOUT', 2)

 

 

Any idea?

 

Edited by avictorgm
Link to comment

You can picture the Vectorworks document like an xml tree, where layers are parents of objects, if one of those objects is a group, it is a parent of its child objects, etc. 

 

HMoveForwards/Backwards will move anything up and down the tree at its level, so moving layers changes the layer order and moving objects changes the stacking order within the layer. 

 

VS doesn’t include a function for moving an object to a particular point in the list. If you want to insert a layer at a particular point, get a handle to the active layer, create the new layer, send it to the bottom, then start a while loop that moves the layer up until PrevObj(hNewLayer) (or NextObj() depending if you want above or below) = hActLayer. 

  • Like 3
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.

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.

×
×
  • Create New...