Floortype ID by RoomName

i have to manually type the floor names into 680 rooms and need this by monday next week, soo… maybe not enough time to learn for this :frowning:

How about just sorting a Room schedule in Revit by Name and then typing in the floor types?

Quickest way I can think of without having to learn all kinds on new stuff before a deadline.

1 Like

I second that a room schedule sorted by room name with ‘itemise every instance’ unticked

could you discribe that better pls?
can i write a floor type for all rooms in a list?

Are the floors already made or do you have to draw in the floors too?
If the floors are already drawn in, are the floors that you want to change room bounding?
(I presume they are)

In the case that you have to draw the floors too, you could have Dynamo create new floors with the outline of the room and a type depending on the name (or any other parametervalue) of the room.

the floors are already there
the rooms are already there

i need a script, that can write “tiles” in the marked ID of “Fußboden” based on the Room Name “Appartment”

I made an example script for you. I don’t think it has any dependencies on packages so you should be able to play around with this a little. It’s not a very sophisticated script. It just get’s all floors and all rooms in your project so be warry of that. I recommend you create a new project that mirrors the situation in your project as a testcase. You can then safely play around and start to understand how Dynamo works. If something does go wrong, you can always use the undo button or not safe your project. I do recommend that you safe every open Revit project before running a Dynamo script since if it crashes or takes too long and you have to force quit Dynamo it will also force close Revit.

Hope this helps and goodluck!

Name floorparameter Example.dyn (38.2 KB)

@d.kuurman thank you for that! I will play around…

At least i got the gets all rooms part right, but then was under the impression i need the ID room name to set something for die ID flooring (because that ID can be wrote manually per room…)

I’m not sure which parameter you are refering to with ID. Could you provide an example?
I understand that what you are trying to do is get a room, get the floor of that room and fill a parameter in the floor element depending on the name of the room the floor lays in.
Please correct me if I’m misunderstanding you.

No thats not it, sry my english is not so perfect and Revit also in german :smiley:

In the best case, i dont even touch the “physical” floors in the project.

I click the reference of the room, to see the settings of a room… in there are these ID-Daten…
Type the name manually (here Bath), but i also can manually write the flooring type (here Tiles…)…that is all in the stamp of the room…and has no reference to the “real” floor what so ever…

i hope that discription was more understandable :smiley:

Well that makes it quite a bit easier then! :smiley:
This should do something along the lines of what you’re looking for. I added a filter (the second green area) so you can specify roomnames you want to have the parameter set for.
Since I don’t have your project I do not guarantee that this does everything exactly rigth so do carefully check if it works well!

Happy learning and goodluck! :slightly_smiling_face:

Name floorparameter Example.dyn (37.1 KB)

Don’t worry about the error thigns in the picture, this is because I added your parameter name. I didn’t add it in my project, but I tested it with the comments parameter.

thank you very much!
i’ll try that the next days

so i’am beginng to unterstand how this functions… but the biggest problem atm is, that only one bath gets the info that “tiles” should be written to the stamp… all other baths have “bath” instead of tiles :smiley:

Then I used a bad version of the list index of node. The node I used only gets the first items index and doesn’t do the rest. So basicly that’s just my bad :sweat_smile:
You can replace those nodes by the “List.AllIndicesOf” node and then it should work correctly.

but list.all… has an output of var and list.indexof has int…
…so it doesnt work anymore… i replaced the two in the right side yes?

My bad again. The build in Dynamo list.replaceItemAtIndex can’t handle multple indices (I replaced them with the clockwork node) and I think i wired something wrong in the lower two green spaces. I’ve corrected the issue and I believe it should now work 100%. I’m sorry that I had to revise this a couple times.

It’s probably a good idea that you take a look at the different versions of the script that I have provided to you so you can get a feel for how some Dynamo nodes handle things and how you can recognise where things might be going wrong and how to correct those issues.

Lastly, the output “var” doesn’t really mean anything. It just tells you that it can be pretty much anything (in this case it will always be an integer since it returns an index value). A tip for if you ever wonder what variable type something actually is, you can use the object type node to show what kind of data you’re dealing with.

Happy learning!

Name floorparameter Example.dyn (38.4 KB)

1 Like

at first i got an error and a warning…

after trying it in a new project it worked and then worked in the right project too… without chaning anything again…dont know, but it seems to work now…

the two green boxes at the bottom, i can add infinite more of room names to that, right?

i’am so grateful for your help, this is amazing! many thanks!

You can keep stacking those nodes infinitely, but it may not be very practical in the long run (imagine having to change something later!)

Check out this thread: String replace for some ideas on how to compress the replacement down to a master list.

That was the solution, but now i get another problem with it…
I have over a hundred rooms, named with “Appartment 001” up to 108…

Atm the graph only works for the exact same room name, is there a way to tell it, that it should do it with “appartment” included, no mather what else is behind the name?

Ofcourse! You can make a filter based on the string.contains node. This node will search if a string contains a substring, for example “appartment 001” contains the substring “appartment”. You then get a list of true and false which you can use as a mask in the filter.boolmask node.
With this you can very easily filter all the elements with a name which contains a substring called appartment. Just don’t forget to either filter the name parameters too, or just get the names of the filtered elements again (easiest option, but not the most efficiënt).

Goodluck and if you get stuck somewhere, don’t be afraid to show your work and ask for help :smiley: