avictorgm Posted November 1, 2018 Share Posted November 1, 2018 (edited) 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 November 21, 2018 by avictorgm Quote Link to comment
Gelde-Aart Posted November 1, 2018 Share Posted November 1, 2018 The position of a new layer can be set by using the vs.HMoveBackward(h, toBack) see also the post on Layer Stacking Order: Quote Link to comment
avictorgm Posted November 1, 2018 Author Share Posted November 1, 2018 Thanks Spaghetto, It helps a lot!!! Quote Link to comment
JBenghiat Posted November 1, 2018 Share Posted November 1, 2018 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. 3 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.