mahmoudsmonem Posted September 19, 2022 Share Posted September 19, 2022 Hey Is there a way to make a shortcut to grey(or not) others while editing instead of going to the preferences menu every time? Quote Link to comment
Jesse Cogswell Posted September 20, 2022 Share Posted September 20, 2022 Easy-peasy. Just create a new script in the Resource Manager, set the language to Vectorscript, and copy and paste this code in: SetPref(1055, NOT GetPref(1055)); This will act as a toggle for the setting and can be activated by double-clicking the script within the script palette. You could also make it an official menu command to bind it to a keyboard shortcut if you would like. 3 Quote Link to comment
Sam Jones Posted September 20, 2022 Share Posted September 20, 2022 Setting Pref 1055 does not seem to work; that is, the Grey Others while editing setting does not seem to change when you actually edit. It is more likely that I'm missing something. Because I could not get it to work, I expanded the script to the following for testing. PROCEDURE GreyOthersYesNo; VAR GreyPref :BOOLEAN; BEGIN GreyPref := GetPref(1055); AlrtDialog(concat('Pref 1055 was ', GreyPref)); IF GreyPref THEN SetPref(1055, FALSE) ELSE SetPref(1055, TRUE); END; RUN(GreyOthersYesNo); I have attached a file with the script and some grouped objects. Grey Others Test.vwx Quote Link to comment
Jesse Cogswell Posted September 20, 2022 Share Posted September 20, 2022 @Sam Jones Weird, it's working flawlessly for me in VW2022 (in the middle of tech and haven't gotten around to installing VW2023 yet, but do have it downloaded). Before running script: After running script: Script editor: Quote Link to comment
Sam Jones Posted September 20, 2022 Share Posted September 20, 2022 I'll try it out in 2022 later today. Quote Link to comment
mahmoudsmonem Posted September 20, 2022 Author Share Posted September 20, 2022 14 hours ago, Jesse Cogswell said: Easy-peasy. Just create a new script in the Resource Manager, set the language to Vectorscript, and copy and paste this code in: SetPref(1055, NOT GetPref(1055)); This will act as a toggle for the setting and can be activated by double-clicking the script within the script palette. You could also make it an official menu command to bind it to a keyboard shortcut if you would like. Worked flawlessly, Thank you very much. If possible could you please share a link to a tutorial or webpage to understand how to assign a shortcut for it, I was able to assign a shortcut for it but it does not work. cheers Quote Link to comment
Pat Stanford Posted September 20, 2022 Share Posted September 20, 2022 To assign a shortcut you have to make it a Menu Command, add that command to your Workspace and add a shortcut in the Workspace Editor. Go to Tools:Plug-ins:Plug-in Manager. Select the Custom Plug-ins Pane and click the New button at the bottom left. Choose the Command radio button and enter the name you want for the Plug-in in the dialog box. Select (should be selected already) the Plug-in you just made and click the Edit Script button. Paste the script from above into Script Editor Window. Click OK to save the script and to exit the Plug-in Manager. Edit your workspace to include the new command in a menu and assign a shortcut. 2 Quote Link to comment
MullinRJ Posted September 20, 2022 Share Posted September 20, 2022 (edited) @Sam Jones, You have to have VW PREF - Show other objects while in editing mode turned ON before the Greying option will work. It is VW Pref# 14. So you need a toggle for SetPref(14, not GetPref(14)); { toggle Show others while editing } and one for SetPref(1055, not GetPref(1055)); { toggle Grey others while editing } Raymond Edited September 21, 2022 by MullinRJ wrong pref # in second SetPref() example 1 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.