R8 - Request - SilhouetteHighlighting - API Access?

Hello,

I realize I may be jumping the gun here but I wanted to put out a request to expose the API access/methods for the new Silhouette Highlight that is available in Document Properties.

Rhino.Options.ChooseOneObject.HighlightColor = (Color)
Rhino.Options.General.SilhoutteHighlighting = True

This is exposed in the Rhino → Document Properties → Rhino Options → Advanced settings.

I am looking for the API access to this method to be able to use this highlight method to dynamically highlight specific Rhino Objects from within a script.

An example would be “on hovering a UI button, it gives a silhouette highlight around the objects corresponding to said button”
OR
Another example "running a command like “show_warnings” in a custom script that then highlights problemed portions of geometry with a silhouette highlight in a warning color like “red” or “warning yellow”

In summary, I would really like to use the Silhouette Highlight as a callable method from scripting and be able to set the color and thickness of said highlight so that we can have this to augment the selection and/or display experience when dealing with objects.

I know there are Display Conduits that could get a similar effect in some cases but I’m specifically looking for the “silhouette highlight” not just DrawWires or DrawingCurves

Thanks for your consideration and response!

@michaelvollrath - you can do this today.

#! python 2
import Rhino

KEY = "SilhouetteHighlighting"

# Gets the value of Rhino.Options.General.SilhouetteHighlighting
def GetSilhouetteHighlighting():
    settings = Rhino.PlugIns.PlugIn.GetPluginSettings(Rhino.RhinoApp.CurrentRhinoId, False)
    if settings:
        child = settings.GetChild("Options").GetChild("General")
        if child:
            return child.GetBool(KEY, False)

# Sets the value of Rhino.Options.General.SilhouetteHighlighting
def SetSilhouetteHighlighting(value):
    settings = Rhino.PlugIns.PlugIn.GetPluginSettings(Rhino.RhinoApp.CurrentRhinoId, False)
    if settings:
        child = settings.AddChild("Options").AddChild("General")
        if child:
            child.SetBool(KEY, value)

# Tests the above
value = GetSilhouetteHighlighting()
print("{}: {}".format(KEY, value))
SetSilhouetteHighlighting(not value)
value = GetSilhouetteHighlighting()
print("{}: {}".format(KEY, value))
SetSilhouetteHighlighting(not value)
value = GetSilhouetteHighlighting()
print("{}: {}".format(KEY, value))

Use the same pattern for Rhino.Options.ChooseOneObject.HighlightColor.

– Dale

1 Like

Thank you @dale this is great,

I’ll use this for now, much appreciated