Jump to content
Developer Wiki and Function Reference Links ×

Layer order function?


Recommended Posts

I'm trying to read them in a script.


I did a little experimenting.  It looks like (for sheet layers at least) the order in which the CreateLayer function appears in the script is the stacking order.  So it may not be possible to GetLayerStackingOrder(h), which is what I was hoping for. 🙂


  • Like 1
Link to comment
Procedure Test;

Var H1:Handle;

	While H1<>Nil do


Try the above script and see what happens when you move the layers around.  Throw in a check to see if the layer is Design or Sheet and you should be able to get what you need relatively easily.  Interestingly, Flayer gives the highest numbers Design Layer, but when it wraps around to the Sheet Layers it starts with the lowest number in the stack order.


If you need to change the order check out HMoveForward and HMoveBackward.

  • Like 1
Link to comment



Never considered using HMoveForward on a layer.  


Here's another cool discovery from Pat's script.  I just ran it on the drawing I'm working on.  This is what I got:


1.  Design Layers.  Bottom of the stacking order to the top.

2.  Sheet Layers.  Top of the stacking order to the bottom.

3.  Design Layers in a file referenced into a DLVP!!!  Prefaced by NNA#7_ then the design layer name.  Bottom of the stacking order to the top.



Link to comment

michaelk (and Pat!):


This is MASSIVE, and solves my issue as posted (and reposted) over the past years:



The "hidden prefix" means that I can control the layer visibility within DLVPs with VectorScript, and that will save us considerable bloat in our files (ask me and I can explain). One interesting note is that when I run Pat's script, I get a response that DLVP layers have prefix of NNA#1_ (not NNA#7_)...wondering if that was a typo or if there is some more mystery here...??

Thanks for this. I have been struggling for some time to get this working!!





  • Like 1
Link to comment

Not a typo.  I saw NNA#7.


Are you still running v2016?


I've seen that NNA#(num) in other places.  (especially in worksheet database criteria) I'm led to believe that the numbers don't have a meaning, they just increment as the need for a new identifier arrises.  


I don't have a machine available that will run 2016, but it would be interesting run that script on 2016 > 2020 and see if the number changes.


I ran it on a 2019 file I happened to be working on.  I'm really glad I used that file that and not a pristine test file. 🙂



Link to comment

Hi michaelk:


I am running Vectorworks 2019 SP 5.3, Mac OS X Mojave.


I duplicated the DLVP several times and ran the command - still coming up as NNA#1_. I'll try creating a new DLVP with different layers, and from a different referenced file. Perhaps the number increments in that case.


Will report back.



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