Change room names according to existing elements

I confess not. I also tried according to the guidelines provided here, however I don’t have knowledge of Python, so I don’t know if I need to adapt something, and I don’t know if it’s because I have Revit in Portuguese and the guidelines are in English and sometimes when translating something it’s not the correct one, anyway, but none of them got me anywhere.

If your not in a huge rush I am willing to setup the base of the graph but only if
you try it and give follow up Either working or with warnings
If with errors you have to tell what the warning is.
Also you will have to do a few minor things yourself to .dyn as i don’t know any Portuguese.

So let me know if you want me to do that.

PS
Personally i would try to learn Dynamo first before dipping your toe into Python or, at the least,
have a better understanding of Dynamo.

1 Like

Python certainly isn’t necessary here but it can make things simpler. The important part is that you define the conditions around room types and their specific elements. If you can do that, then the rest is easy.

1 Like

If you see it you see it :wink:.

I’ll throw her an working .dyn anyways with a example project (very basic).
I only need to make a few changes in one i have already.
She only needs rename words in the Dictionary Lists and maybe pick the right Categories again.
Sometimes having and seeing a working example is best.
Seeing how a some .dyn worked helped me a lot learning Dynamo.

1 Like

@cintiamiranda21
Try this :point_down:.
CINTI_R23.rvt (1.8 MB)
CINTI_R23.dyn (32.9 KB)
PS
Open the .rvt and then open Dynamo and run the .dyn to see what happens
(so you can see the output of the nodes).
After you saw how it works make the needed changes in the two lists for your own project.
PPS
Made for Revit 2023 and Dynamo 2.16

1 Like

See, for some reason and I don’t know why, my template (which I need to use this one) is searching for for several environments that are not project environments.
So I need to get the environments
Separate those that have identifiers
Then, get the generic (mobile) models used in the project
Separate which environments have which generic models
And then I will request to change the names of the environments according to the generic model
But I can’t even separate these environments by identifiers and models. It’s not working.
I can’t use Code Block, because the names will vary and you won’t always have the same number of environments and the same names. I need to use categories.
I tested yours, and it works perfectly, that’s exactly it, but it doesn’t work with my template and data.


Room.dyn (53.0 KB)

I think you have to filter your Rooms which have a ‘Identifier’ differently.

Our examples where if this :point_down: was the case.

My .dyn won’t work if mutliple Rooms have a similar ‘identifier’ (Furniture Family) but should get different names. Also this can be fixed / done but this :point_down:.

I think it’s still a little unclear exactly how you want these conditions to be handled. Unfortunately it also feels like the translation of many similar and related words is causing some unclarity around some minor but key differences in the elements and conditions being discussed.

It would be really helpful if you could draw/write out an example of what your room data looks like in Revit, how you need to categorize, identify, or filter it, what the generic model data looks like and how it gets structured, and then finally how you would use the model elements to identify room types. Without knowing exactly what you’re working with and what outcome you’re expecting it’s really hard to give concrete suggestions on how to handle the process.

Also, don’t get discouraged because you don’t get it straight away.
You / we will get there. Babysteps remember :smile:.
I can help you bit futher later when i have access to Dynamo again.

1 Like


See, my question starts here, I have 7 environments in this project, but dynamo is telling me 292. I haven’t renamed these environments yet, notice that they are all as “Environment”. However, dynamo tells me some names of existing environments.

I was able to identify the environments that contain identifiers, and then those that contain elements.

But I can’t get dynamo to change the name of the environments that contain the elements.

:sweat_smile:. Thank you very much for all your help and attention. Yes, I’ll make it! :blush: :pray:

Well, by tooks of it you do have 292 Rooms in your project.
You also need to filter the Rooms which you want to rename differently.
Find it hard to explain how without images / Dynamo (where other people can :sweat_smile:)
I do notice you also have Rooms without any furniture it to use for the naming of those Rooms.

This is helpful!

There’s still a major misunderstanding with how you need to setup dictionaries. You’re not ordering or matching any of your data, you’re just combining two sets of unstructured, unfiltered lists arbitrarily - that’s not going to help anything.

You need one dictionary that states what furniture defines a given environment. You can’t just take your list of identifiers and pair it with your list of furniture. Those two lists have no relation. You need to manually define that a stove means it’s a kitchen, a sofa means it’s a lobby, a toilet means it’s a bathroom, etc. so that Dynamo knows what furniture to look for and what environment that relates to.

Then you can get the furniture elements from each room. It needs to be grouped by room so that you know which room the furniture belongs to and therefore which room to get identified. This can just be a structured list; it doesn’t need to be a dictionary. The dictionary comes into play when you lookup which environment goes with each piece of furniture in the room groupings.

Additional note: Do not use String.listToStringLines. It converts a list of objects to string and then concatenates them all down to a single string object. That completely removes all relationships between elements and rooms and any information you had up to that point. You just need the names of the elements or whatever the identifiable string would be for the furniture (category, family, type, etc.).

Make sure you don’t have unplaced rooms. Create a room schedule or get the Area of all those rooms and see which ones aren’t placed yet.

I started to understand, I did as instructed. And I informed which rooms are in which furniture.
However, the following error appears; Prompted to convert non-convertible types.
I believe it is because I searched for elements, shouldn’t I convert it to a string to be able to change the identifier text?

As for the number of environments appearing, there really is nothing, the file is all clean, at least only those shown in the project are visible. I really don’t understand, but this is already a problem with my template, somehow it is saving old project environments, in the template, and I have no idea why.

Exactly. The object type needs to match the object type you used to create the dictionary. In Dynamo this will always be a string.

Can you create a Room schedule with Room Name and Area and share a screenshot of it here?

Also, really glad you’re getting it now. You basically have it. I was just about to post an example for you but it’s pretty close to what you already have.


Oh…great. I’m trying here, with the conversion to string.
Yes, see the prints. You may notice that 292 environments appear, but they do not exist (visible) in revit, and their areas are zero.
But right at the end, there are my real environments, produced in revit, where I have their areas and there are exactly 7 environments.

Yup. All those Rooms exist but aren’t placed. If you delete a Room or Space from the model it only removes it from the “model space” but remains in the project as an unplaced room/space. You can then place those existing rooms/spaces instead of a new one if you want. If they’re not supposed to be there then you can just delete them from the schedule location (that will remove them completely). Otherwise, you can filter out all those rooms with an Area == 0.

Another way (instead of Area == 0).

Personally I prefer to keep my project tidy and keep warnings to a minimum and delete unplaced Rooms (using a Schedule).

This is a way to filter Rooms wihich don’t have any Generic Models.

1 Like

Another alternative to only working with rooms that are placed.

image

1 Like