Script to Assign Furniture Marks by Room Number

rooms

#1

I’m working on a script to automatically assign unique Marks to furniture instances, based on the Number of the Room they’re located in.

E.g. Room 101 has 5 Furniture instances, I want to change the Marks to 101A, 101B, 101C, 101D and 101E.

(I’m also filtering room names to only include “Open” and furniture to only include “Workstation”)

Right now, I’ve got a working script that can set all furniture Marks in the room to 101, but I need to add a letter suffix to each instance, that restarts at “A” when the room number changes.


#2

When working on stuff like this, I like to use the method that FamilyInstances have available to them. FamilyInstance.Room

Here is a version of this workflow:


20180305-furnitureMarkByRoom.dyn (12.6 KB)


#3

Thanks for the response. I’m not seeing the FamilyInstance.Room node from Rhythm, is it available in Dynamo 1.2/Revit 2016? Thanks


#4

Ah darn. Yeah, only 2017+
Here is another method using some archilab nodes

20180305-furnitureMarkByRoom.dyn (13.8 KB)


#5

That worked, thank you so much!
We have Revit 2018 too but this project hasn’t been upgraded yet.


#6

I spoke too soon. It worked in my test project, but in the actual project, it created a bunch of blue dots around the workstations, and gave me an error:


#7

Is some of your furniture not reporting a location?


#8

I created a quick script to get location of selected elements. My workstations do seem to have a location.


#9

Would it give an error if there are overlapping or duplicate rooms?

Edit: tested with duplicate rooms in the test project, it didn’t give me any errors.
Edit2: Seems like unbounded rooms are giving it trouble.

If ANY single furniture item is not located in a room, it gives an error.

It’s still giving me errors when I have a furniture item in the model that doesn’t match the string I search for.


#10

Something was screwed up with the coordinates. Ultimately, I installed an older version of the Rhythm package, which let me use the older Element.Room node. Everything seems to be working now, except I can’t get letters past Z (for rooms with more than 26 workstations). How can I tell it to repeat to AA, BB, etc. after Z?

Thanks again for your help!


#11

Hmm. You might be able to use a node from clockwork. AlphabeticSequence I think.