Changing room names in Excel - strange results

dynamo

#1

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


Element.Parameter node inconsistent ordering when collecting parameters
#2

I know it’s annoying to refer to “how-to-get-help-on-the-dynamo-forums”, but this is a community relying on other users spare time, so please provide as much information and material as needed for saving as much time as possible for those who might want to help you.

Paragraph 3… Attach minimal versions of all the relevant files

Another hint…Zoom in on a few nodes and then use the camera (upper right corner in Dynamo). Using this method will it be possible to read your graph.


#3

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.


#4

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


#5

Thank adding that right now.


#6

As far as I can see, you are trying to write data and get data in the same thread… I am not sure this can happen without setting some kind of pause. However, why do you use Excel for that function? Why don’t you let dynamo handle the function? Then you won’t have the problem with threading.

Otherwise, try to write excel data in one script and in a new script retrieve the data to a start. Make that work before you try to join them. As a hint for retrieving data from excel with some kind of comparison, this post might inspire you!


#7

@erfajo
@Nicholas.Jacobson

In addition,

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

Marcel


#8

@Marcel_Rijsmus
UniqueId is really good to have in the back head, but I think it is not needed in this case. The room number should be “unique” enough in itself. If number isn’t “unique” you will be warned inside Revit :slight_smile:


#9

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.


#10

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.


#11

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


#12

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


#13

Use ElementUniqueId, havent seen it fail.

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

Regards,
Marcel