Swap Parameter Type

hello, in a script I am working on I have inadvertently copied integer parameters almost everywhere in the definition; the problem is that now if I insert a decimal value this is approximated to an integer.

so I was looking to replace all integer parameters with a number or data one, and to do that I wanted to use the SwapParamType MetaHopper component but I can’t get it to work.

could someone help me with an example? otherwise, I have to substitute them manually.
thank you

I have used something like this a couple of times in the past
it always worked but I believe it’s far from good practice

disclaimer: removing the data dam is the best way to shut down both rhino and gh with a single click

Metahopper_SwapParaType_BadPractice.gh (10.5 KB)

1 Like

@inno’s solution works well – the crash you’re avoiding is an infinite loop (you can’t use metahopper to update a component that the metahopper component itself depends on). Here’s another approach:

swap-param

3 Likes

thanks to both of you for the quick answer, I used Andrew’s method and it worked!