Change the output grip position

Hi all,

I was wondering if there is a way to customize the display position of output grip in a component.

The issue is that if I change the layout() of the component, the output grip position would always be set to the half-height of the component. Is there a way to overwrite this?

Thanks!
rz

Components specifically or are you asking about free floating parameters?

Hi David,

I think I have issues for component specifically.

Please the below screenshot:

The code for this component is https://github.com/chepilot/zack_gh_component_ui/blob/master/MyProject1/Components/PSlider.cs

Another related problematic component is about resizing.
Once I drag the component, the height of the component changes to the full bounds height, instead of maintaining the specific capsule height.
Before Dragging:


After Dragging:

The code for this component is

Thanks!
rz

Sliders are floating parameters with custom attributes. Components are aggregate objects which is what makes them harder to modify.

Overriding slider and their attributes will be a tricky business, as that object is already quite complicated. The position of the output grip is specified (and can be overridden) by the OutputGrip property on the attributes.

However you’ll need to adjust the Bounds of the attributes as well, otherwise Grasshopper won’t realise there’s stuff besides the slider box itself. This in turn will mess with the layout.

1 Like