Jump to content
michaelk

Layer order function?

Recommended Posts

What is the order number in the Design and Sheet layer origination called?  The one that you drag to change the stacking order of layers.

 

And is there a function that returns it and a function that sets it?

 

 

Share this post


Link to post

lol

Thanks Julian!  

 

I thought it was stacking order, but I can't find any reference to stacking order in the function reference.

Share this post


Link to post

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

Share this post


Link to post

Looking at the appendix, there is a ObjectVariableBoolean(156) that is described as Layer Repaginate.  Anyone know what that is for?

Share this post


Link to post
Procedure Test;

Var H1:Handle;

Begin
	H1:=FLayer;
	While H1<>Nil do
		Begin
			AlrtDialog(GetLName(H1));
			H1:=NextLayer(H1);
		End;
End;

Run(Test);

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

Share this post


Link to post

whoa

 

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.

 

 

Share this post


Link to post

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

 

V-Geeque

#gowisconsin

 

  • Like 1

Share this post


Link to post

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

 

 

Share this post


Link to post

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.

 

VG.

Share this post


Link to post

Yup that's it. Creating a second external reference would make those layers have an NNA#2_ prefix. A third references's layers would be NNA#3_ etc.etc. Confirmed by test file.

 

So that explains why you saw NNA#7_ and I saw NNA#1_.

 

VG

 

  • Like 1

Share this post


Link to post

Mystery solved!

 

The drawing I was working on used to have many more references.

 

 

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.


 

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