Set Parameter Name

Hi all,
I am hoping someone can help me with this. I was playing around with a Pattern Based Curtain Panel which i wanted to be able to open and close using a parameter. I all works well updating manually. I thought I would try using Dynamo to see what we could do with it.
The family has a parameter in called NCP which is linked to normalized curve parameter values, which drives the geometry, creating and open and closed appearance.
I first tried to randomize the amount of opening values which threw the error, so I tried making them all open the same value using a number slider, but I still get the same error.
Because I am using normalized curve parameters, the value ranges from 0.1 to 1.0 which the slider controls. The NCP parameter in the family is a number parameter, but for some reason the Element.SetParammeterByName keeps giving this error:
*Warning: Element.SetParameterByName operation failed. *
unitType is an invalid unit type. See UnitUtils.IsValidUnitType() and UnitUtils.GetValidUnitTypes().
Parameter name: unitType

Not sure why the unit type would be invalid, its a number trying to be pushed into a number category parameter.
Any help would be appreciated.

There is one thing missing in your analysis. Check your assumption that the Curve parameter is indeed a number.

Select the same elements and read the NPC parameter and Object.type the answer. Now you have the confirmation that you are feeding the right data type.

That can inform your next step, either your input type is wrong or the parameter itself needs to be adressed in a different way.

Can you provide a Revit project with two instances the family in question?

HI Jacob,
Please see attached files. Thanks for your help.
Im curious to see what the issue is here.

Triangle Panel.rfa (396 KB)
Panel Wall.rfa (796 KB)
Panel Open & Close.dyn (13.2 KB)

Hi Bjorn,
Yep, pretty sure it is a number parameter.

Just wondering if the problem’s been solved. I’ve encountered the same situation when input a number which is a normalized curve parameter into String Box. I tried to play with other parameters with a unit, like thickness or length, they both worked. Somehow a number makes an invalid unit type. Anyone help? Thanks!