Jump to content
MTRobin

Quick Settings Toggle Script

Recommended Posts

Hi Everyone,

 

I was hoping someone could help me create a script that would toggle the "Black Background" and "Use Layer Colors" settings on and off based on if I am in a Design Layer or a Sheet Layer.

 

I like to draft in my Design Layers with a black background and layer colors, but then when I switch to Sheet Layers to dimension and add notes to my viewports I prefer to turn off those two settings. As it is now I have those  two toggles in my quick settings tool bar, but I would like to automate it so anytime Vectorworks is in a Design Layer it will turn on the "Black Background" and "Use Layer Colors" tools. Then if Vectorworks is in a sheet layer it will turn both of those settings off so the lines are normal colors and the background is white.

 

Any help would be appreciated. 

 

Thank you,

Maxwell

Share this post


Link to post

You can set preferences fairly easily with SetPref(). The constants for Layer Colors and Black Background are in the Appendix. https://developer.vectorworks.net/index.php/VS:SetPref

 

You can check if the active layer is design or sheet with https://developer.vectorworks.net/index.php/VS:GetObjectVariableInt

The object variable selector is 154. It will return 1 for season layer and 2 for sheet layer.

 

Having the process be automatic would require the SDK, which is the only way to listen for user actions. You can add a script to a saved view, though.

Share this post


Link to post

Thank you for this. One issue I can't solve is what handle I need to get in order to finish the GetObjectVariableInt function.

 

[GetObjectVariableInt(h, 154)]

 

Thanks,
Maxwell

Share this post


Link to post

Awesome! I got it to work. I will add a script to my saved views to change the settings based on what view it is currently in.

 

Thanks for your help.

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