Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
macoovacany

Layer Stacking Order

Recommended Posts

Thanks to MaxStudio and Pat Stanford for their help in the topic "Saved View / Layer". My code now works fine... however:

When I add a new design layer, VS adds it as the first layer. It would be good if the stacking order of the new layer could be changed as part of the script.

I've had a look in the function API, but there doesn't appear to be anywhere to access the layer stacking order. Have I missed something?

VW2008 on Mac OS-X

Regards,

Timbo

(New Topic, New thread)

Share this post


Link to post

Does HMoveBackward() work? I haven't tried it, but that would be my first guess.

Raymond

Share this post


Link to post

Timbo,

???Since no one else has posted I decided to try this. hMoveBackward() does work. Here's an example that creates a new layer with a stock name, numbers it and sends it to the bottom. It can be easily made into a procedure or function that can be called from within a larger script.

Raymond

PROCEDURE NewLayerOnBottom;
{ Create a new layer and send it to the bottom of the stacking order. }
CONST
BLN = 'Layer';		{ Base Layer Name }
VAR
I :Integer;
S :String;
BEGIN
I := 1;
while (GetLayerByName(concat(BLN, ' ', I)) <> nil) do 
	I := I + 1;
S := concat(BLN, ' ', I);
Layer(S);
hMoveBackward(GetLayerByName(S), True);	
END;
Run(NewLayerOnBottom);

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

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.

×