Jump to content
  • 0

CREATING KEYBOARD SHORT CUT FOR DISPLAYING OTHER OBJECTS WHEN EDITING


gvictoria1

Question

Hi- 

 

I'd like to create a keyboard shortcut for the Preference  - when editing an object showing other objects around or hiding all other objects - depending on what I'm editing the need changes - and each time I have to go to Preferences and manually change this preference - I looked in Workspace editing and can't find the option to create a keyboard shortcut - any suggestions? 

thanks 

Link to comment

11 answers to this question

Recommended Posts

  • 0

The script part is easy:

 

SetPref(14, Not GetPref(14));

 

Copy the above. Go to Tools:Plug-ins:Plug-in Manager. Choose the Custom Plug-ins tab and click the New Button.

Set it to be a Command type plug-in and name it as you want it to display in your menus. Click OK.

Click the Edit Script button and paste the above line into the script editor. Make sure it is set to Vectorscript.

Click OK until you exit the Plug-in Manager.

Edit your workspace to add the command you just made to a menu and add a keyboard shortcut.

 

Ask if you need more help.

 

  • Like 4
Link to comment
  • 0
On 5/26/2022 at 9:38 AM, Pat Stanford said:

The script part is easy:

 

SetPref(14, Not GetPref(14));

 

Copy the above. Go to Tools:Plug-ins:Plug-in Manager. Choose the Custom Plug-ins tab and click the New Button.

Set it to be a Command type plug-in and name it as you want it to display in your menus. Click OK.

Click the Edit Script button and paste the above line into the script editor. Make sure it is set to Vectorscript.

Click OK until you exit the Plug-in Manager.

Edit your workspace to add the command you just made to a menu and add a keyboard shortcut.

 

Ask if you need more help.

 

 Thank you! I've been wanting this as well!!!

Link to comment
  • 0
On 5/26/2022 at 6:38 PM, Pat Stanford said:

The script part is easy:

 

SetPref(14, Not GetPref(14));

 

Copy the above. Go to Tools:Plug-ins:Plug-in Manager. Choose the Custom Plug-ins tab and click the New Button.

Set it to be a Command type plug-in and name it as you want it to display in your menus. Click OK.

Click the Edit Script button and paste the above line into the script editor. Make sure it is set to Vectorscript.

Click OK until you exit the Plug-in Manager.

Edit your workspace to add the command you just made to a menu and add a keyboard shortcut.

 

Ask if you need more help.

 

 

Thank you so much! It works great. 

 

I've made this script to togle gray/colors of the context:
 

SetPref(1055, Not GetPref(1055));

 

 

Edited by MarcelP102
  • Like 1
Link to comment
  • 0

Thanks for the help. I will first learn how to use Maironette to make the scripts visual. I'm planning to make tools to transform/place/replace objects. I've already made a marionette script that will random scale a symbol with user input for min/max value. Managed to transform this script to python so I can add it as a command to the office workspace. Will share my progress on the forum if I have some more to show. Much later I'm planning to really learn how to write code in python or vectorscript so I can make the tools faster.

Edited by MarcelP102
Link to comment
  • 0

You can make Menu Command directly in Marionette that you can then add to a workspace and give a keyboard shortcut.  After you have Wrapped the network use the Convert to Menu Command instead of the Convert to Object Node option.

 

I know that I started using Vectorscript a long time ago and am very comfortable with it, but IMNSHO, if you want to modify existing objects a script is a much simpler way to do it than a Marionette.  But if you want to create objects that the user can modify, Marionette is far ahead of a script.

 

Good luck with finding what works best for you.

Link to comment
  • 0

And I should have included it earlier.  The Peference selectors (and Object Variables for settings of individual objects) are all in the Vectorscript Appendix. There is a downloadable version included in your VW install.  Applications:Vectorworks 2022:VWHelp:ScriptReference. Click the Additional Resources link on the left and it will give you a link to the Appendix.

 

An online version is available at:  https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#fptable

 

 

But there is not a huge amount of description and some stuff that is less than intuitive.  Sheet Layers are referred to as Presentation Layers in some places, etc.  But if you can't find a direct script function call do do something, take a look at the Preferences and Object Variables. Often it is buried in there somewhere.  

 

And don't hesitate to ask.

Link to comment
  • 0

Alright I accepted the challenge to make the script with Vectorscript instead of Marionette. Used on of your script as an starting point. I think I'm getting the hang of it. Made my first script that scales symbols randomly with user input for max/min. Only wanted to round of the value to 2 decimals, but that's not working for now. Any tips?

 

PROCEDURE ScaleSymbols;
{Scales each selected symbol in the active layer at a user given value}

{© 2022 Arnhem - The Netherlands, Marcel Plomp mplomp@opzoom.nl}
{With the help of Pat Stanford and others}

{Licensed under the GNU Lesser General Public License}

VAR
scale   :REAL;
sMax   :REAL;
sMin	:REAL;

Procedure WithIt(Hd:Handle);
Begin
	sMax:=RealDialog('Enter a maximum scale value:','1.00');
	sMin:=RealDialog('Enter a minimum  value:','0.00');
	Scale := Random*((sMax - sMin) + sMin);
	SetObjectVariableInt(Hd, 101, 3);
	SetObjectVariableReal(Hd, 102, Scale);
	SetObjectVariableReal(Hd, 103, Scale);
	SetObjectVariableReal(Hd, 104, Scale);
End;



Begin
	ForEachObject(WithIt,((InSymbol & VSEL=TRUE)));
	ReDrawAll;
End;

Run(ScaleSymbols);

 

Edited by MarcelP102
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.

Guest
Answer this question...

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