Hotkey setup for SubD wires toggle

Hi,

I want to setup a hotkeys (F1) to be able to toggle the SudB wires on/off in shaded mode. How do I do that?

/Mattias

1 Like

Hi Mattias - in plain Rhino there is no way that I know of - you need to use the Display panel setting, which is probably what you are doing -

I’ll see if I can cook up a script that does that.

-Pascal

Yes I do that and that really slows down the workflow. Sometimes you just want to toggle make a quick change and then toggle back and forth like that for a while.

I want to toggle the SubD wires on/off in the same way as I do with the Tab-button for the SubD modes.

Hi Mattias,

You can paste the below script-running-macro under any key shortcut or alias to toggle SubD wires (all in one line):

-_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\SubD\SmoothVisible", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\SubD\SmoothVisible")) )

(Since it is using RhinoScript it would work on Windows Rhino only, for Mac there is probably some similar python-based solution)

hth,

–jarek

1 Like

@gustojunk, if you still need these 2 years after your post: :wink:

It can work with any display mode on/off setting (setting up a macro/hotkey). Based on your list and the samples below, it should be relatively easy to edit these to toggle any setting. To get a better idea of how to change it may be helpful to export any Display Mode into a *.ini file and see the settings and which sections they belong to from there (it does not always follow the UI logic)

Here are the toggles for your initial list:

SURF EDGES:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Surfaces\ShowEdges", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Surfaces\ShowEdges")) ) SetRedrawOn

SURF ISO:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Surfaces\ShowIsocurves", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Surfaces\ShowIsocurves")) ) SetRedrawOn

SUBD WIRES:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\SubD\SmoothVisible", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\SubD\SmoothVisible")) ) SetRedrawOn

MESH WIRES:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Meshes\ShowMeshWires", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Meshes\ShowMeshWires")) ) SetRedrawOn

CURVES:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Curves\ShowCurves", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Curves\ShowCurves")) ) SetRedrawOn

POINTS:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Points\ShowPoints", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Points\ShowPoints")) ) SetRedrawOn

ANNOTATIONS:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Annotations\ShowAnnotations", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Objects\Annotations\ShowAnnotations")) ) SetRedrawOn

4 Likes

Wow, thanks alot!!! Made my life so much easier :ok_hand: :+1: :facepunch: :clap: :raised_hands: :pray:

Since I’m not capable of writing my own scripts I wonder if I may ask you to help me with another similar one. I want to setup a hotkey for toggeling between shaded and wireframedisplay modes. Is it possible that you could write that up for me?

Best regards and many thanks again :smile:

-_RunScript (If Rhino.ViewDisplayModeEx() = "Shaded" Then Call Rhino.ViewDisplayModeEx(, "Wireframe") Else Call Rhino.ViewDisplayModeEx(, "Shaded"))

The above should do the trick. You may need to edit the display mode names in quotation marks depending on your modes naming, it works OK here with standard EN Rhino install.

1 Like

Jarek, once again. Top notch!!! Thank you so so much. This is so super fast to use when SubD modelling the way I do. :pray: :raised_hands: :clap: :smile: :100: :heart:

Hi Jarek,

How do I do to export for example the display modes to a .ini file?

I want to try manipulate your script to toggle different Emap types on/off as well. For example toggle Emap - flourecent tube on and off. Where can i find the name of the different emap types to put in the script?

Best regards!
Mattias

hi @Jarek, yes! this is awesome. Thanks so much!! Also in the last few years, I’ve realized I also use these 2 a lot, if I can get greedy :slight_smile:

Once the V8 icon /workspace storms quiet down a bit I’ll venture out and make a toolbar for all these and share it. I need to get more familiar with the Rhino icon look, mine are showing their (and my) age a bit.

Thanks again!

Gustavo

Hi Gustavo,

This one is a bit longer since it toggles two settings (still can paste it into one hotkey line):

BACKFACES COLOR:
_SetRedrawOff -_RunScript ( If Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Shading\Material\UseBackMaterial") Then : Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Shading\Material\UseBackMaterial", True) : Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Shading\Material\Back Material\OverrideObjectColor", True) : Else : Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Shading\Material\UseBackMaterial", False) : Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "Shading\Material\Back Material\OverrideObjectColor", False) : End If ) SetRedrawOn

CLIPPING PLANES:
SetRedrawOff -_RunScript (Call Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "View settings\ShowClippingPlanes", Not Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeEx(), "View settings\ShowClippingPlanes")) ) SetRedrawOn

Hi Mattias,

You have to go to Tools > Options > View > DisplayModes and pick one from the list, then use the “Export” button at the bottom to save the ini file. There you will see all the setttings.

The script macros are always act on current display mode, but you can change them easily to always act on Shaded, Rendered etc. but I find it less practical.

Toggling EMAPS may be a bit more tricky but see if you can solve it based on the above examples
(you can use MacroEditor in Rhino to play with editing and quickly trying the outcome)