# Changing room names in Excel - strange results

**URL:** <https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851>\
**Category:** Uncategorized\
**Tags:** dynamo\
**Created:** [May 17, 2017, 7:13pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851 "2017-05-17T19:13:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas.Jacobson](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@Nicholas.Jacobson](https://forum.dynamobim.com/u/Nicholas.Jacobson)\
**Post date:** [May 17, 2017, 7:13pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/1 "2017-05-17T19:13:56Z")

</div>

There is a curious glitch I am finding with the established method of exporting and reimporting information with Excel. When exporting the list of rooms and names to excel it exports in order of the ID. The problem with this that we did not create rooms sequentially, so when I export to excel the rooms come in in a way that I cannot easily modify.

I want to renumber the rooms in excel with a function. Therefore in order to export to excel from dynamo I’ve sorted the lists of names and rooms numerically prior to exporting to excel.

The glitch comes in when I try to reimport to revit from excel once these rooms are changed. The room names can easily be renamed with out issue and room numbers can have letters appended to the number. But if the number is changed or a letter is added as a prefix to the room number the entire file freaks out and acts completely irrationally.

Any assistance for sorting lists here would be great.  
See image of the def. below and the associated warning spelled out below.

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

Here is a link to the file on Dropbox.  
[Dropbox dynamo](https://www.dropbox.com/s/z1rv9i76vxq9oxe/Room%20Renumbering.dyn?dl=0)

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)’

---

<div class="post-metadata">

**Author:** ![Nicholas.Jacobson](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@Nicholas.Jacobson](https://forum.dynamobim.com/u/Nicholas.Jacobson)\
**Post date:** [May 22, 2017, 4:27pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/3 "2017-05-22T16:27:48Z")

</div>

Attached is the updated photo. Thanks for the tip. However, being a new user my ability to upload information is limited. I would love to share my file but this is restricted for new users to the forum. Unless there is a workaround for this, my updated graph will have to be the only way to convey this information.

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [May 22, 2017, 4:33pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/4 "2017-05-22T16:33:13Z")

</div>

> [@Nicholas.Jacobson](#):
>
> being a new user my ability to upload information is limited. I would love to share my file but this is restricted for new users to the forum.

You could drop the files in google drive or dropbox and share the link here. Cheers!

---

<div class="post-metadata">

**Author:** ![Nicholas.Jacobson](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@Nicholas.Jacobson](https://forum.dynamobim.com/u/Nicholas.Jacobson)\
**Post date:** [May 22, 2017, 4:35pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/5 "2017-05-22T16:35:02Z")

</div>

Thank adding that right now.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [May 23, 2017, 8:51am UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/7 "2017-05-23T08:51:09Z")

</div>

@erfajo  
@Nicholas.Jacobson

In addition,

If your file is workshared, use ElementUniqueId, not Id to compare.

Marcel

---

<div class="post-metadata">

**Author:** ![Nicholas.Jacobson](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@Nicholas.Jacobson](https://forum.dynamobim.com/u/Nicholas.Jacobson)\
**Post date:** [June 29, 2017, 8:18pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/9 "2017-06-29T20:18:07Z")

</div>

Thanks all. The reason for this is to be able to send an excel file to consultants who can modify names and numbers, then have this reload back into our Revit file and it auto update. Also excel renumbers quicker and more efficiently than revit at this point.

@erfajo your scrip is nice however the issue remains.

The issue is that when exporting to excel the numbering portion is not ordering numerically. Additionally when trying to reorder numerically the excel file is not reading the element ID’s the same. So renumbering and renaming is buggy.

---

<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:** [June 29, 2017, 8:43pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/10 "2017-06-29T20:43:25Z")

</div>

> [@Nicholas.Jacobson](#):
>
> the excel file is not reading the element ID’s the same. So renumbering and renaming is buggy.

What do you mean?  
If you export Element ID, Room Number, and Room Name you should be able to sort by Element ID when you import the changes.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 30, 2017, 3:32am UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/11 "2017-06-30T03:32:58Z")

</div>

Try adding an exported element ID or unique ID to the export list and using that to map the values to assign.

---

<div class="post-metadata">

**Author:** ![Nicholas.Jacobson](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@Nicholas.Jacobson](https://forum.dynamobim.com/u/Nicholas.Jacobson)\
**Post date:** [June 30, 2017, 4:53pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/12 "2017-06-30T16:53:28Z")

</div>

Hey that worked. Once the Element ID string was converted back to a element this all fell into place. Thanks everyone for you help!

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [June 30, 2017, 6:47pm UTC](https://forum.dynamobim.com/t/changing-room-names-in-excel-strange-results/11851/13 "2017-06-30T18:47:27Z")

</div>

Use ElementUniqueId, havent seen it fail.  
[http://thebuildingcoder.typepad.com/blog/2015/02/understanding-the-use-of-the-uniqueid.html](http://thebuildingcoder.typepad.com/blog/2015/02/understanding-the-use-of-the-uniqueid.html)

> [@ElementSelector.ByUniqueId](https://forum.dynamobim.com/t/elementselector-byuniqueid/7231):
>
> Hi, I used a Code Block for ElementSelector.ByUniqueId( id, true) but it askes me for 2 inputs. [image] And this gives me the Non pointer error This used to be just one input like this: [image] I got this from AU [http://www.revit.com.au/1564/](http://www.revit.com.au/1564/) What happened here and how do i correct this? Marcel

> **[Practical Dynamo - Excel Linking 2: Keeping Track of Your Families](http://bimtroublemaker.blogspot.com/2014/09/practical-dynamo-excel-linking-2.html)**
>
> There is an advantage to living in a small city/country with a disproportionately large contingent of ADSK employees: I have great access t...

Allways use this when linking model, BOQ and tendering specs, and excel, its essentual

Regards,  
Marcel
