Set.ParameterbyName -- NUMBER instead of STRING?

So, for our company, we need to work with NUMBER type Parameters. Is there a node like Set.ParameterbyName that works with NUMBER values (instead of only STRING)? So far I can only get the node to work when the parameter type is defined as “String”. This would be very helpful. Thanks!

If its a parameter name, then your number is still a string! Hence, Element.SetParameterByName will work as expected regardless of how you’ve named the parameter.

Thanks, but I mean the VALUE that is entered into the parameter, not the parameter Name itself, e.g. “Width” parameter enter “12.64” (NUMBER type Parameter). It only accepts 12.64 if the parameter “Width” is defined as a string parameter!

The Value input of the Element.SetParameterByName node takes a var object type, which means any object of any type. The restriction will come from the object type of the parameter within Revit that your company has set, i.e. number, text, etc etc. So you havent defined your problem clearly enough, but this might help:

If your company parameter takes numbers then the Value input of the Element.SetParameterByName will also need to be numbers

If your company parameter takes numbers BUT its datatype in Revit is set to text (aka a string) then the Value input of the Element.SetParameterByName will need to be numbers converted into strings

2 Likes

Hold on…