Jump to content

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,


Link to comment

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.

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