Get GumballAppearanceSettings

Hi,

I’m trying to detect if the mouse coursor is over Rhino’s gumball in order to run or not my code, so I can get the Gumball’s plane like that:

RhinoDoc.ActiveDoc.GetGumballPlane(out var gbPlane);

But I would have to get the current sizes of the gumball’s arcs and arrow lenghts.
Does anyone know how to retrieve these values?

Thanks in advance
Will

Hi @dale

Is there any chance to get these values?

Thanks
Will

Hi @Harper, i guess this is what you’re searching for: GumballAppearanceSettings

_
c.

1 Like

Hi @Harper,

To my knowledge, Rhino’s internal gumball setting are not available through RhinoCommon.

– Dale

Hello,

Thank you very much for your answers.
As far as I know GumballAppearanceSettings is only for custom gumballs, but I didn’t find a way to get the settings for the Rhino one.

Anyway thanks again.

P.S. @dale I’m pretty sure there isn’t, but by any chance is there an event or some static variable to know when the gumball is clicked?

Regards
Will

Hi, since the Gumball settings are available in the Advanced Options, you can try to read them from there? Here are some samples of how to access/modify Rhino’s advanced options via Python:
Accessing Advanced Options via script - Scripting - McNeel Forum

Hi @Harper,

Can you provide some more detail on what you want to do, and perhaps why?

Thanks,

– Dale

Any Gumball setting that is available via Rhino Advanced Options can be retrieved like that:

import Rhino
settings = Rhino.PlugIns.PlugIn.GetPluginSettings(Rhino.RhinoApp.CurrentRhinoId, False)
s = settings.GetChild("Options").GetChild("Gumball")
print s.GetInteger("Radius")

Hello,

It works like a chram! thank you very much.

Regards
Will

Hi @Jarek and @Harper,

i’m wondering what is the difference between the example code posted and below line of code ?

import Rhino
print Rhino.UI.Gumball.GumballAppearanceSettings().Radius

_
c.

Hi Dale,

The point is that as I have some elements in viewports which interact with the mouse (to drag or select some parts drawn in conduit) sometimes that interferes with the Rhino gumball (especially if my elements are behind an object and are not visible), so that’s the reason to detect if the user clicked or is over the gumball and avoid to run my code.

A mouse over, down and up events would be perfect to manage it, but accesing to the gumball’s plane and sizes I can also know if the user is over or clicking the gumball.

Thanks for your interest
Regards
Will

Hi @clement

As far as I know it will instantiate a new GumballAppearanceSettings object with default values, which may or may not match the Rhino gumball settings.
The point is to access the values of the Rhino gumball instance.

Regards
Will

Hi @Harper, thanks. I’ve made a quick comparison and here is seems to use the values defined in the dialog available from:

Options > Rhino Options > Modeling Aids > Gumball

as the default values for the new instance.

_
c.