Copy numeric values to text-based parameter

Hi fellow Dynamo users,

I have got a question regarding value copying from numeric parameters to text-based parameters. Script worked just fine while BBH_Length was a Length type parameter, but when I have changed it to text-based parameter, it stopped copying values.

Is there a way to fix it?

The parameter does not accept numbers, only strings.

You could use the ‘number to rounded string’ node from datashapes:
image

To add:

To avoid breaking your script when you encounter a parameter that isnt a string, i’d use an if statement, where you first find out what storage type the parameter has and then feed it a number or a string:

1 Like

Thank you for the reply and this easy solution.

For some reason Number to Rounded String node stopped processing values.

Warning: Element.SetParameterByName operation failed.
The call is ambiguous between the following methods or properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ and ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’

This is the error it gives me on last node.

Take a look at your graph and my example :slight_smile:

Spot the difference between our if statements.

I don’t really know how to arrange those if nodes. This was a ready-to-use script which I got from other person and just input necessary information. And it works in terms of other parameters and element category. And for some reason with Conduit Fittings it stopped processing values.

Could you share the script here?
I’ll change it

BBH_K07_Conduit Fittings Length Test.dyn (23.1 KB)

See if this works

I followed your example, but whenever I try to run it, Dynamo and Revit stop to respond.

How do you mean they stop to respond?

Does revit and Dynamo close or does the script run forever?
Are you sure you dont have a process open in revit or dialogue box?

Not sure if it runs forever, but program just freezes up and stops to respond.

Could you post a screenshot of the graph?