# Copy numeric values to text-based parameter

**URL:** <https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [October 20, 2022, 11:03am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285 "2022-10-20T11:03:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 20, 2022, 11:03am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/1 "2022-10-20T11:03:19Z")

</div>

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.

 ![screenshot_23](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/3/83ec06de7535d014c06a628d80455cca0bbb16e7.png)

Is there a way to fix it?

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 20, 2022, 11:11am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/2 "2022-10-20T11:11:11Z")

</div>

The parameter does not accept numbers, only strings.

You could use the ‘number to rounded string’ node from datashapes:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/b/8ba7db9d046aea4f4a921606a91d3cb9714ffc47.png)

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 20, 2022, 11:16am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/3 "2022-10-20T11:16:38Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/6/e6b8cb4aae4929230fa20198090898224d76a39a.png)

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 20, 2022, 11:52am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/4 "2022-10-20T11:52:37Z")

</div>

Thank you for the reply and this easy solution.

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 21, 2022, 6:33am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/5 "2022-10-21T06:33:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 21, 2022, 6:35am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/6 "2022-10-21T06:35:12Z")

</div>

![screenshot_24](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/e/5e623796ade4f8d565ce54a3bdd89e2ee6741715.png)

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 21, 2022, 7:08am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/7 "2022-10-21T07:08:04Z")

</div>

Take a look at your graph and my example 🙂

Spot the difference between our if statements.

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 21, 2022, 7:51am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/9 "2022-10-21T07:51:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 21, 2022, 8:16am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/10 "2022-10-21T08:16:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 21, 2022, 8:41am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/11 "2022-10-21T08:41:27Z")

</div>

[BBH\_K07\_Conduit Fittings Length Test.dyn](https://forum.dynamobim.com/uploads/short-url/kg6m69pNTDYRZqm7W7fUwpgYXkT.dyn) (23.1 KB)

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 21, 2022, 9:23am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/12 "2022-10-21T09:23:13Z")

</div>

See if this works

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/0/10c02d03aef8599cf7ee182af2eecde5c7b6deeb.png)

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 21, 2022, 10:33am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/13 "2022-10-21T10:33:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 21, 2022, 10:44am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/14 "2022-10-21T10:44:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vlad.aleksandrovs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vlad.aleksandrovs/32/146055_2.png) [@vlad.aleksandrovs](https://forum.dynamobim.com/u/vlad.aleksandrovs)\
**Post date:** [October 21, 2022, 11:03am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/15 "2022-10-21T11:03:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [October 21, 2022, 11:06am UTC](https://forum.dynamobim.com/t/copy-numeric-values-to-text-based-parameter/82285/16 "2022-10-21T11:06:26Z")

</div>

Could you post a screenshot of the graph?
