Bind for Tempoarily Disabling Highlight?

Hi,

When checking objects for fit, I wish I had a press-to-disable (not a toggle) way to temporarily hide the selection highlights. In other words, I select an object, do something to it like move it, and tank a look at it. This I want for the building process, so it’s nothing that Bongo would work for.

Thanks for reading,
brenda

1 Like

Hi Brenda- - is this because the highlighting obscures the view? I also gripe about the way highlighting selections works in Rhino but I don’t see yet in the context of checking for fit where this comes in - can you elaborate?

thanks,

-Pascal

What I want is in Photoshop, but it can be better!

You select objects; they are highlighted.
You press/hold a key, the highlight disappears. (Your selection is still selected. You can still move things, delete things, ect.
You release the key the highlight reappears. (Well, if you haven’t done anything profound to them.)

For instance: For checking movement, I select an object/move it/undo… This is an area where Bongo would be too large a hammer for the job. All I want is to visually shut off the highlight.

At times, it should help with positioning in certain drawings. Once you are moving something, you may not need the highlight. By holding down a key, the user will likely remember that something is selected.

It may help with demo’ing, or really teaching. You mean select this, that, and the other thing, and then…

It might also come in handy for making sure your have grabbed everything you think you need before you do an invert-hide (as working on large projects, I find myself switching layers and hiding objects to both conceptually see what I am doing to have the framerate I need to work. At this scale, even when Rhino marks a list of objects internally to hide, it take time.]

Thanks for the interest : )

I guess you would get that if you temporarily move your geometry to a layer with the same color as the selection color.
Or temporarily change the selection color to the object’s layer color.

That takes too much time and concentration, which might seem dumb, but what I want is to increase the UI interactivity for visually checking complicated things in a simple way as I build…in an 106-layer project.

I would like to select an object, and as I hold down a key the selection highlight is hidden. Currently, the user has to deselect their selection to see what they are working on.

Keyboard rollover issues aside…

Overall, I feel that it it would more economical if the screen could temporarily repainted without highlight rather than using a real undo step.

When projects get large and complicated, selecting objects becomes time-consuming for the user.

I might be 25 milliseconds for some individual part selections with everything showing on a Quad-core/Quadro-equipped laptop that gets 46,464 in Holomark.

Hi Brenda,

It has been discussed before and I also often find it useful to hide the selection highlight, especially when evaluating the collisions and object intersections - with selections highlight, the wires are always on top so it makes it complicated. There was a similar request in this thread:
http://discourse.mcneel.com/t/a-on-curve-and-surface-visability

So I came up with a script that will let you toggle the selection: ToggleSelectionHighlight.rvb (1.5 KB)
Your best bet to use it is to create a button, and copy the script text in to Command field between:

-_RunScript
(
[paste script here]
)

This way it will toggle the selection highlighting and should work even while you are in-command, which I find most useful.
Please note, it works per-display mode, so if you toggle the highlighting in Wireframe and switch to Rendered, it will still show, and wireframe will stay unhighlighted until you toggle it back.

Let me know if that does the trick.

–jarek

3 Likes

P.S. there is more handy tools like that that enhance the display modes I wanted to compile in a plugin but all of them make most sense when able to run inside commands. Unfortunately, the current version of the Compiler is broken and the compiled script commands will not run inside other commands. Please lobby for the fix as well, I ran out of arguments for what seems to be like a quick and much needed fix…

@Pascal, is it only me and you that find that being an issue ??

Nice one @Jarek !

below one python script to toggle the highlight (without using display mode).

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
    
def ToggleHighlight():
    ids = rs.SelectedObjects(include_lights=True, include_grips=False)
    if not ids: return
    
    objs = [rs.coercerhinoobject(i) for i in ids]
    for obj in objs:
        if obj.IsHighlighted(False): 
            obj.Highlight(False)
        else: 
            obj.Highlight(True)
    scriptcontext.doc.Views.Redraw()
    
ToggleHighlight()

c.

3 Likes

Thanks Jarek and Clement. I will check them both out.

@Jarek Hmm- yeah… I don’t hear about it much outside of our bubble, but I don’t think it is necessarily an easy thing to tune up - I’ll try to corner Steve and see what the prospects are.

-Pascal

Hey Pascal, thanks, yes please corner Steve ; ) It used to work with old version of the compiler and also works from buttons / script editor so I can only imagine it must be a ‘tweak’ or a bug in the compiler. I guess the main problem is to get someone to shift their focus from another 435729034 projects they have on their plate to this one.

–jarek

Jarek, I loaded the first script. It runs well, after the usual unblocking ritual. I can’t seem to figure out how to bind it it to a key.

Your script itself otherwise does exactly what I want, in that it leaves the gumball, so I can still have a handle to move things around. Thank you : )

I was experimenting with a custom button, the other night, but I was too tired. I will make one to share.

Hi Brenda,

Use this one: ToggleSelectionHighlight.rvb (1.6 KB)

Save it on your computer and drag-and-drop into Rhino. From there, it will add an alias: ‘ToggleSelectionHighlight’ to run as a command. You can also make a button that calls ToggleSelectionHighlight command. I will let you figure out how to do that.

To bind it to a key combo, go to Options > Keyboard, find a combination that works for you and add the same ToggleSelectionHighlight alias.

–jarek

Hi @Jarek,

Thanks again for this script, I use it all the time, it’s great.

Just one question though, …

it defaults to highlight off, so when you open Rhino, it always starts by not highlighting elements and you must toggle it in order to see selection highlighting.

Is there a way to make it to default highlight on, as it is an option I’d rather use when needed than the other way around?

Many thanks, Andrew

Hi Andrew,

Now I see what the problem is - the first version of the script I posted here was ‘button-ready’, no alias added (see instructions below). If you used the 2nd version of the script posted here, it added loading the script on Rhino start and adding the “ToggleSelectionHighlight” alias. I would suggest for now use the button version and make sure you delete the startup loading of the script from Rhino Options>RhinoScript list.

@Pascal - is there a way to load script at Rhino start but not run it, so the alias still works since the script is loaded but we avoid the problem above ? (in case of this script the selection highlight display will toggle on each Rhino start)…

–jarek

Hi Jarek - you can’t have the call to the sub in the script if you only want it to load and not run:

Option Explicit

Rhino.AddStartUpScript Rhino.LastLoadedScriptFile
Rhino.AddAlias "RunMyScript", "_NoEcho _-Runscript (MyScript)"

Sub MyScript()
...
... blah blah

End Sub

Call MyScript () <<<<<  this will cause the script to run on loading if it is present anywhere outside the sub.Comment this out.

Is that what you mean?

-Pascal

Duh! Thanks Pascal, makes perfect sense. I didn’t realize that with RunScript I can call a specific Sub from the loaded script…

@solosails - see the attached script - this time it should add the alias correctly but not run the script on Rhino start.
ToggleSelectionHighlight.rvb (1.6 KB)

–jarek

1 Like

Thanks Everyone,
Didn’t know I needed it til I had it, now use all the time :slight_smile:

@Jarek @pascal - Awesome, thank you very much indeed!

Extremely enabling for manually aligning 3D scan meshes into a bounding box. I can now move the mesh and see its surface instead of be stuck only being able to move things around it.

How does this bind into my Rhino installation permanently like it seems to do? Where is it copied to or where is the pointer to it in my installation?