Dynamic slider min/max inputs?

I am wondering if there is a way to input dynamic min. and max. values to a number slider.

I am writing a script (for Tekla) for a placing lifting anchors on CLT panels. It is a relatively simple script in which I want 4 anchors to be placed at the meeting points between my panel’s edges offset inwards by a value that varies depending on the type of anchor used and a circle that has for center my element’s COD.

So far no problem with writting the script, the only problem I encounter is with defining a range of acceptable diameters for the circle that could then be manually adjusted via the Grasshopper component directly in Tekla.
I would like the slider to allow the diameter to be comprised between the element’s length-2x the offset (for the max) and the element’s length divided by 4 (for the min).
Because our CLT elements usually have MEP performations (but also for various reasons too long to explain), I need to be able to adjust this value manually for some elements, to avoid the anchors being too close to a whole in the panel for exemple…
What I would like would essentially be something like this; the min amd max values varying for each panel since they all have different length.

I have done some research and it seems that this has been a recurrent topic but I am not finding topics on the subject more recent thant 2019 and the latest version of the metahopper plug-in given as a solution in some forum dates from 2019 as well and is for Rhino 6…

I found some work arounds in which a slider can help select a value within a domain but the max. and min. values on the slider (1 to 10 for exemple) don’t correspond to the min/max values of my dynamic domain… (each panel having it’s own length). And I would like the slider to show me what the min. and max. acceptable values for each panel will be…

I am a beginner here so please be kind :sweat_smile:

Any solutions/tips?

Hi Olivia,

I think something based on your slider mapping solution is the best shot you’ve got, but you won’t be able to display the actual values in the dialog.

Even if you found a way to manipulate the min and max for a slider programmatically it wouldn’t matter when the definition is used through the GH component, as all the sliders and parameters are extracted from the definition before it’s been solved. So there’s no way to get information back into the dialog to update e.g. slider limits or show some text when the component is applied to an object.

Calculated information can instead be shown by using panels named “ouput [optional name]” in your definition and connecting the output from any component to one of these panels. This will pop up a small window displaying the result whenever the component is modified. If this somehow could be helpful.

Cheers,

-b

1 Like