Updating Room Numbers

dynamo

#1

Hi All,

I am attempting to update the current room numbers with a list of updated room numbers from excel. What are someways I can structure the list I get from Revit to match the order of the list from excel?

Thank you!


#2

Use UniqueId
The order is not important in that case.
Keep in mind you are not creating roomnumbers that are already there


#3

Even with the unique element id I still dont know how to match them to the updated list from excel. It is in a different order than the list I get from revit. See attached image.Capture


#4

Hey,

I would do that sorting in Dynamo (though it can be done in excel, LOOKUP probably does what you want), use Sort by Key with the old Excel values as the key… You likely need to do some work with your lists to make sure they are the same length (Accounting for new and deleted rooms)…

To help more explicitly it would be helpful to have a stripped down Rvt and Dyn

Hope that’s useful,

Mark

Edit: I would do it in Dynamo because otherwise if you are overwriting data you may delete or mess up formulas. I think you want a single clean export so your data is as robust as possible.


#5

As long as all values exists in both lists and lists are same length, this method should work:


Don’t use the OOTB List.ReplaceItemAtIndex, use Archilab’s version. And == must have cross-product lacing used.


#6

Thank you but your plugging a boolean into the element input of list.indexof. Why?


#7

Because the outputs of the == node are booleans.

You could also directly plug excOld and revOld to List.IndexOf, ignoring the == node and the boolean, it would result in the same output.


#8

Hey guys,

I am so close but for some reason I can not spot where I am going wrong. Would someone mind taking a look at the script?

181109 Room Number Swap Edit.dyn (38.4 KB)