Jump to content
Developer Wiki and Function Reference Links ×

Grey others while editing shortcut


mahmoudsmonem

Recommended Posts

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.

  • Like 3
Link to comment

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

Link to comment
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

Link to comment

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.

 

image.png.3bc3899bb047c69e63c1bc3f279ad8ac.png

  • Like 2
Link to comment

@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 by MullinRJ
wrong pref # in second SetPref() example
  • Like 1
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
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...