macoovacany Posted May 8, 2009 Share Posted May 8, 2009 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) Quote Link to comment
MullinRJ Posted May 8, 2009 Share Posted May 8, 2009 Does HMoveBackward() work? I haven't tried it, but that would be my first guess. Raymond Quote Link to comment
MullinRJ Posted May 9, 2009 Share Posted May 9, 2009 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); 1 Quote Link to comment
macoovacany Posted May 21, 2009 Author Share Posted May 21, 2009 Thanks. Somehow I missed this in the function reference. Timbo Quote Link to comment
Elite Exhibits Posted June 6, 2023 Share Posted June 6, 2023 @MullinRJ Stumbled into this script and it solved another one of those inexplicable aggravating anomalies in Vectorworks Reverse order of new Design Layers... Created a New Design Layers by duplicating an existing one VW will add a sequential suffix number with the same name. (Page 1, Page 2, etcetera) - works great ! ¿ The Problem ? - The Stacking order is the exact opposite (?) Your script above does the trick - It is even easy to go in and change the name of the Layer to what is needed... Thanks Much Peter 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.