# Export/Import Revit to Excel (ElementSetParameterByName failed)

**URL:** <https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901>\
**Category:** Revit\
**Created:** [January 17, 2017, 6:47am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901 "2017-01-17T06:47:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel.assuncao.luis](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@manuel.assuncao.luis](https://forum.dynamobim.com/u/manuel.assuncao.luis)\
**Post date:** [January 17, 2017, 6:47am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/1 "2017-01-17T06:47:59Z")

</div>

Greetings,

I have created a small routine for exporting all elements inside a category (let’s say all pipes) and then write in excel some specific parameters displayed in all those elements (format of the exported excel will be, the first row has the header - parameter name, 4 columns for a total of 4 parameters ; remaining rows would list the data associated to each parameter). (in the attached picture 5D\_QTO is the parameter name, the rest is the data for each element in that parameter)

To keep track of the elements coming out of revit and then the elements going back in revit i use element unique ID of each element.

Problem i’m getting is on the Element.SetParameterbyName node, when i run it most of the elements get filled (codes with format AAXXXXXXXXX, A-alphanumeric ; X-number) but the elements where the parameter is filled with "0’ only are not getting filled…i assume it’s due to this error.

I’m new to dynamo so i’m fairly lost here…

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/3/436c9ee6877c96d9a26907291e52e8668b7fe053.png)

---

<div class="post-metadata">

**Author:** ![Nico\_Stegeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nico_stegeman/32/19204_2.png) [@Nico\_Stegeman](https://forum.dynamobim.com/u/Nico_Stegeman)\
**Post date:** [January 17, 2017, 6:53am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/2 "2017-01-17T06:53:45Z")

</div>

try between the output of List.deconstruct and the Node Element.SetParameterByName the Node flatten

(ps Youre input in the value input = the number 1 (list)) (storage type off the parameterName is not a number)

---

<div class="post-metadata">

**Author:** ![manuel.assuncao.luis](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@manuel.assuncao.luis](https://forum.dynamobim.com/u/manuel.assuncao.luis)\
**Post date:** [January 17, 2017, 7:04am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/3 "2017-01-17T07:04:15Z")

</div>

No luck, adding the flatten node i still get the same error (watch node before and after the flatten node shows same result).

The number 1 (list) is a custom parameter name i added (5D\_QTO), the rest of the list is the data inside that parameter for each element

---

<div class="post-metadata">

**Author:** ![manuel.assuncao.luis](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@manuel.assuncao.luis](https://forum.dynamobim.com/u/manuel.assuncao.luis)\
**Post date:** [January 17, 2017, 7:08am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/4 "2017-01-17T07:08:16Z")

</div>

I have some elements that are filled with “0” only…different from all the rest, elements with that assigned are not getting filled when i try to import to revit, maybe this is connected to the error i’m getting?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/3/d3624aeb049f9901cf4e803d8cdcd8f20030cb62.png)

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [January 17, 2017, 7:12am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/5 "2017-01-17T07:12:23Z")

</div>

> [@manuel.assuncao.luis](#):
>
> the rest of the list is the data inside that parameter for each element

Most likely the type of parameter is string (text) so, you need to convert all your data to String and then feed in the Element.SetParameterByName .Now the 0 value is number and that is why the error says that the parameter type should not be number. You can use different approaches here like String from Object node or other. You can also replace 0 values with something else. So it is up to you but the main problem is the type of the values that you are feeding.

---

<div class="post-metadata">

**Author:** ![Nico\_Stegeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nico_stegeman/32/19204_2.png) [@Nico\_Stegeman](https://forum.dynamobim.com/u/Nico_Stegeman)\
**Post date:** [January 17, 2017, 7:16am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/6 "2017-01-17T07:16:33Z")

</div>

Check the storage type you need  
string or element Id?  
you can use the node Parameter.StorageType to check

---

<div class="post-metadata">

**Author:** ![manuel.assuncao.luis](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@manuel.assuncao.luis](https://forum.dynamobim.com/u/manuel.assuncao.luis)\
**Post date:** [January 17, 2017, 7:23am UTC](https://forum.dynamobim.com/t/export-import-revit-to-excel-elementsetparameterbyname-failed/8901/7 "2017-01-17T07:23:46Z")

</div>

Yes, the type of parameter is text…i followed Petar suggestion and added a string from object node before the Element.SetParameterByName and it worked!

Many thanks.
