# Importing plumbing fixture parameters from Excel to Revit

**URL:** <https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291>\
**Category:** Revit\
**Tags:** revit, excel, dynamo\
**Created:** [March 13, 2022, 6:06pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291 "2022-03-13T18:06:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 13, 2022, 6:06pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/1 "2022-03-13T18:06:30Z")

</div>

I am very new to Dynamo, and don’t have a lot of programing background.  
I have been working on two dynamo scripts to modify parameters of Plumbing Fixtures in Revit. The first script exports all of my plumbing fixtures and their parameters into Excel. This seems to be working well.

 ![Export Plumbing Fixtures to Excel 2020](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/b/7b36893f9644ecf274179fb1febc4d192e8ce15e.png)  
I am running into problems when I try to get the edited parameters back into Revit. I seem to be dying at the List.GetItemAtIndex node. Warning: List.GetItemAtIndex operation failed. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

The Element.SetParameterByName is also getting the error: Warning: Internal error, please report: Dereferencing a non-pointer. I assume that it is because it is being given a list full of null values.

Right now I am just trying to get a single parameter to import before I add additional parameters from the excel file. Any suggestions would be greatly appreciated.

 ![Import Plumbing Fixtures from Excel to Revit 2020](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/3/239d7dbe436c320c4f684c6606dddc941de34183.png)

---

<div class="post-metadata">

**Author:** ![Elie.Trad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/elie.trad/32/110373_2.png) [@Elie.Trad](https://forum.dynamobim.com/u/Elie.Trad)\
**Post date:** [March 13, 2022, 7:15pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/2 "2022-03-13T19:15:07Z")

</div>

Hi @jacobs and welcome, try to sort your elements using the node `List.SortByKey`

---

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 13, 2022, 7:43pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/3 "2022-03-13T19:43:18Z")

</div>

Would the key for List.SortByKey be the “Mark”. ?

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [March 13, 2022, 11:41pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/4 "2022-03-13T23:41:27Z")

</div>

I’d suggest exporting the Element Id or GUID of the fixtures in addition to their mark, then use that to get the elements you need in the second script (Element by Id is available in 2021+ and lots of custom packages and can be called in design script).

---

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 15, 2022, 8:23pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/5 "2022-03-15T20:23:09Z")

</div>

@GavinNicholls I was hoping to avoid using 2021, and Ideally would be in 2018, but I might have to look at it.

with a little more adjusting I have the script making it until the last node. any recommendations on testing what parameters a family has if it is giving you problems? a lot of the tutorials I am finding for Revit to Excel and back are dealing with a single family, not all of the families in that category.

thanks again.

 ![2022.03.15 Import Plumbing Fixtures from Excel to Revit 2020](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/2/328e9951b5bd92608a4cb9649a41513596dc4d22.png)

---

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 17, 2022, 3:38am UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/6 "2022-03-17T03:38:10Z")

</div>

So I think I have found the problem. I am calling All Elements of Category, and that returns FamilyInstances. I need to filter that selection to get the FamilyType? The parameters I am trying to modify are Type parameters. I think that is why my list keeps giving me null values. I don’t understand why my export file works if that is the case, but I will add that to the list of many things I don’t know.

---

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 19, 2022, 1:59pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/7 "2022-03-19T13:59:52Z")

</div>

After struggling to get anything out of this script I have finally made some progress. I have one script that looks at the plumbing fixtures in a project, and exports to excel the following parameters:

- Mark
- Level
- Type
- EQUIPMENT NUMBER
- FIXTURE
- PF TRAP
- PF WASTE
- PF VENT
- PF COLD WATER
- PF HOT WATER
- MIXING VALVE?
- MAX OUTLET TEMP
- REMARKS
- WFU
- HWFU
- Combined Water FU
- CWFU

This part seems to work well.

---

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 19, 2022, 2:00pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/8 "2022-03-19T14:00:22Z")

</div>

Getting any of those values back out of excel and into Revit was a bit of a struggle, but I have some of it working.  
• Mark (I don’t see a situation where I would be changing this, but it is working)  
• Level (not working, but I am not sure it is a value I would ever need to change for the purpose of the script) Element.SetParameterByName error: Warning: Element.SetParameterByName operation failed. The parameter’s storage type is not a string.  
• Type (not working, but I am not sure it is a value I would ever need to change for the purpose of the script) Element.SetParameterByName error: Warning: Element.SetParameterByName operation failed. The parameter’s storage type is not a string.  
• EQUIPMENT NUMBER (working)  
• FIXTURE (working)

These next parameters are arguably working, but have some issues.  
These lists should have some null values, but my hack to get around them was to convert any null value to a 0. In a lot of my cases this is an acceptable solution, but I would prefer to keep the null values if I knew how.  
Also, I am using a String.ToNumber node that is turning orange, but it seems to be working.  
• PF TRAP (working with 0 for null, and String.ToNumber error)  
• PF WASTE (working with 0 for null, and String.ToNumber error)  
• PF VENT (working with 0 for null, and String.ToNumber error)  
• PF COLD WATER (working with 0 for null, and String.ToNumber error)  
• PF HOT WATER (working with 0 for null, and String.ToNumber error)  
• MIXING VALVE? (working with 0 for null, and String.ToNumber error)  
• MAX OUTLET TEMP (working, but has some formatting issues I need to resolve, and with 0 for null, and String.ToNumber error)  
• REMARKS (working)  
• WFU (this is an item I can see value in being able to edit, so I would like to resolve this issue. Warning: Element.SetParameterByName operation failed. The parameter is read-only.)  
• HWFU (this is an item I can see value in being able to edit, so I would like to resolve this issue. Warning: Element.SetParameterByName operation failed. The parameter is read-only.)  
• Combined Water FU (this might not be a type parameter like the others, so I have some testing to figure this one out. Warning: Element.SetParameterByName operation failed. No parameter found by that name.)  
• CWFU (working with 0 for null, and String.ToNumber error)

---

<div class="post-metadata">

**Author:** ![jacobs](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jacobs](https://forum.dynamobim.com/u/jacobs)\
**Post date:** [March 19, 2022, 2:00pm UTC](https://forum.dynamobim.com/t/importing-plumbing-fixture-parameters-from-excel-to-revit/74291/9 "2022-03-19T14:00:55Z")

</div>

![Import Plumbing Fixtures from Excel to Revit 2020](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a285237de8b4472b42d9e456f54c75bd2e018c3f.png)
