Changing room names in Excel - strange results

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.

Here is a link to the file on Dropbox.
Dropbox dynamo

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

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.

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

Thank adding that right now.

@erfajo
@Nicholas.Jacobson

In addition,

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

Marcel

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.

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.

1 Like

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

1 Like

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

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

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

Regards,
Marcel

1 Like