# Script for a string parameter

**URL:** <https://forum.dynamobim.com/t/script-for-a-string-parameter/74668>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [March 22, 2022, 7:55pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668 "2022-03-22T19:55:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgeiselmanXB2EC](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cgeiselmanXB2EC](https://forum.dynamobim.com/u/cgeiselmanXB2EC)\
**Post date:** [March 22, 2022, 7:55pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/1 "2022-03-22T19:55:40Z")

</div>

I’m looking to take several Revit parameter values and combine them into one parameter for use in a schedule. At this point in time, this seems as if it cannot be accomplished using formulas to drive the combined parameter’s value directly in Revit. Dynamos seems to be the only option. I’ve attached a Dynamo Script and the Shelving Revit family in which I’m trying to accomplish this. I’m trying to combine 3 text parameters into 1 text parameter so it reads fluidly.  
The text parameters are Shelving Size Override, Tier Report, and Mobile.  
I’m attempting to create a text parameter that will read these parameters in string along with “shelving unit” in front. The desired outcome as an example would be “Shelving Unit, 24"x36”, 4 Tier, Mobile"

I put together a script but I’m not seeing the output in my family. I’ve ran the script and haven’t gotten any errors so I’m not sure what the issue is. Anyone else run into this issue or have any guidance?

[Shelving Parametrics.rfa](https://forum.dynamobim.com/uploads/short-url/rHlsf72XLVmPa430Z8Wa6IPdgzg.rfa) (1.4 MB)

[Shelving Description.dyn](https://forum.dynamobim.com/uploads/short-url/1dfESMfqTXOMLzF6iVAu1BWepiZ.dyn) (10.1 KB)

 ![Shelving Script](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/a/7ae8516cdd1c79ae26c15a6dc9f2fd2ecb636ef0.png)

---

<div class="post-metadata">

**Author:** ![bvs1982](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bvs1982](https://forum.dynamobim.com/u/bvs1982)\
**Post date:** [March 22, 2022, 7:59pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/2 "2022-03-22T19:59:56Z")

</div>

I am not behind a pc, but if you would also post an image i probably could help you.

**PS**  
Posting the .rvt and .dyn is allways useful, but an image would be great too.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 22, 2022, 8:00pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/3 "2022-03-22T20:00:01Z")

</div>

Sharing the graph and support files are much appreciated for more complex problems, but I think you’ll have more replies if you post full images of the graph (with node previews) so that people don’t have to go through the extra effort of trying to reproduce your work.

---

<div class="post-metadata">

**Author:** ![cgeiselmanXB2EC](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cgeiselmanXB2EC](https://forum.dynamobim.com/u/cgeiselmanXB2EC)\
**Post date:** [March 22, 2022, 8:02pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/4 "2022-03-22T20:02:29Z")

</div>

Thanks for the heads up! I’ve updated my post to include an image of the script.

---

<div class="post-metadata">

**Author:** ![cgeiselmanXB2EC](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cgeiselmanXB2EC](https://forum.dynamobim.com/u/cgeiselmanXB2EC)\
**Post date:** [March 22, 2022, 8:03pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/5 "2022-03-22T20:03:48Z")

</div>

Apologies. I’ve added the full image above.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 22, 2022, 8:06pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/6 "2022-03-22T20:06:40Z")

</div>

Thank you. Can you show that with the node previews pinned so we can see the outputs? Specifically the individual parameter values, the final combined value, and the final output after applying the new parameter values. Is the new parameter, Descriptive Long, a type parameter or an instance parameter?

---

<div class="post-metadata">

**Author:** ![Robert\_Younger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/robert_younger/32/205603_2.png) [@Robert\_Younger](https://forum.dynamobim.com/u/Robert_Younger)\
**Post date:** [March 22, 2022, 8:09pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/7 "2022-03-22T20:09:59Z")

</div>

For what it is worth, Combine Parameters is a native Revit feature and pretty decent.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/7/777d6da19f48625d5dadc4715961fb06951c3ea8.png)

Next, I took a quick peek into your family file - all of the referenced parameters are Type Parameters, not Instance parameters. You’ll want to pull the Element Type for this instead of the Element.

Lastly, here’s another way to streamline your script:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/a/caef83fdcc43bbce0e4af67c3759fa8f11d613cb.png)

---

<div class="post-metadata">

**Author:** ![cgeiselmanXB2EC](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cgeiselmanXB2EC](https://forum.dynamobim.com/u/cgeiselmanXB2EC)\
**Post date:** [March 22, 2022, 8:12pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/8 "2022-03-22T20:12:18Z")

</div>

I’ve made the Descriptive Long parameter a Type. Nick, looks like all the previews are reading “Null”.  
I originally had all these parameters as Instance but another forum recommended I change them to Type

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a220e7bb43d0c65d026a8f1416a56074fbbdc4f4.jpeg)

---

<div class="post-metadata">

**Author:** ![cgeiselmanXB2EC](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cgeiselmanXB2EC](https://forum.dynamobim.com/u/cgeiselmanXB2EC)\
**Post date:** [March 22, 2022, 8:13pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/9 "2022-03-22T20:13:53Z")

</div>

Combine Parameters was my original go to and it works great but this prevents our team from being able to copy the data in that column of the schedule. Not a big deal but I was looking for a way to achieve the same look of the combined parameter inside the family itself.

thanks for the input! I’ll see if I can throw something together similar to what you have.

---

<div class="post-metadata">

**Author:** ![Robert\_Younger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/robert_younger/32/205603_2.png) [@Robert\_Younger](https://forum.dynamobim.com/u/Robert_Younger)\
**Post date:** [March 22, 2022, 8:15pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/10 "2022-03-22T20:15:40Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/8/482c4667fc144d4bd58c83e52948eb48e9c97938.png)

This is one example of going from instance level to type level, though the type list will have duplicates. It’s probably fine to Get/Set Parameters this way for most projects but for a really large dataset you’ll want to grab the Type Elements directly to keep the list short.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 22, 2022, 8:19pm UTC](https://forum.dynamobim.com/t/script-for-a-string-parameter/74668/11 "2022-03-22T20:19:09Z")

</div>

As @Robert_Younger mentioned, you’ll need to get the FamilyType to query type parameters. Are all the nodes showing null? A codeblock string shouldn’t show null. Can you confirm you don’t have a command running in Revit?
