Automate rooms renaming

Hi @mostapha

I wanted to know if there already is a feature in PO (if so, sorry for the question, but so far I didn’t find any commands) to automatically rename PO Rooms.
I try to explain better what I mean. When making a PO Room the sofware automatically name it (Room 1, Room 2, Room n), and it is necessary for the user to rename it (accordingly to design documents or anything) room by room. This may be very time consuming in large models, so I was wondering if there is a way to automatically rename the Rooms (from a csv file maybe?), which would make much faster the modelling.
As an example, I know that in IES-VE each room is automatically named accordingly to the text reported in the dxf file when it is extruded.

Thank you for your help
Best Regards
Michele

Hi @micheledimartino, Mostapha show some ways to rename rooms in this post

Personally due to a set naming convention I use a small grasshopper script to rename the rooms to their convention as seen below

naming_convention_demo

If you also have a set naming convention I can share with you the script so you can modify it.
and if you don’t write code I can help out with that.

Hopefully some of that is helpful!
-Trevor

1 Like

Hi @tfedyna

Thank you very much.
If you can share with me your code I’ll try to edit it according to my naming convention.
I’m not really an expert in coding so I’ll probably ask for your help.

Thank you
Michele

Hi @micheledimartino below is the code for the component that creates the new names, let me know if there is something I can help with in terms of editing the code


if _model:
    
    _model.duplicate()

    rooms = [room for room in _model.rooms]
    
    counts = {}
    for i, room in enumerate(rooms):
        if room.display_name in counts:
            counts[room.display_name] += 1
            rooms[i].display_name = "{}{}".format(room.display_name +'-', counts[room.display_name])
        else:
            counts[room.display_name] = 1
            room.display_name = "{}{}".format(room.display_name +'-', counts[room.display_name])
    
    for room in _model.rooms:
        room.display_name = room.display_name + "{}".format('_L-'+room.story)
    
    for room in _model.rooms:
        print(room.display_name)
    

model_ = _model

Hi @micheledimartino,

Good point! How would you imagine the CSV file to work? Will you use add an x, y, z value to the CSV file for each name for mapping the names to the room geometries?

What is the format of the design document that you get? Would a similar DXF approach work? We can probably give that approach a try to find the names and use it to rename the rooms based on the insertion point of the text.

1 Like

Hi @mostapha

Usually when modelling in IES-VE (in most cases for LEED modelling) I re-draw rooms with polyline and I type the room name inside the polyline, then I import the dxf file in IES-VE and extrude the polylines. IES automatically assign the name of the room to extruded volume.

Do you think a similar approach is possible in Pollination? Would it be possible to include something like that in one of next releases?
As I said, I think it would be much faster for large project instead of renaming each room one by one.

Thank you
Michele

1 Like

Hi @micheledimartino,

Thank you for the additional information. If you are willing to type the names, I can think of two different solutions:

  1. If @mingbo agrees, we can add a new command to the Rhino plugin to allow you select the room and set the name. We can call it PO_SetDisplayName or something similar to that.
  2. We can also use Grasshopper to create a workflow that matches the texts in the document with the rooms and assign them to the rooms.

I tried the second option, and this script should do it. You will need the Human Grasshopper plugin.

Set display name by text.gh (23.7 KB)
rooms-with-names.3dm (193.8 KB)

  1. Type the rooms for names in the same plane of the rooms. The insertion point of the name should be inside the room.

  2. Open the Grasshopper script, right click on the PO Model component and select Get Model.

  3. Right click on the other PO Model component and replace the existing model.

  4. The display names should be updated in the Rhino model.

1 Like

A post was split to a new topic: Name Pollination rooms based on Rhino object names

Hi @mostapha

to me this is a game changer in Pollination.
I’m sure that this will speed up all the process a lot!

Best Regards
Michele

1 Like

Hi @micheledimartino,

I’m very glad to hear that! Thank you for letting me know that it is a useful approach. I’m tagging @mingbo here to see if he thinks this approach still deserves its own Rhino command. Many VE users have mentioned this feature to me before as something that they like about the VE DXF import workflow.

I should also correct what I said here.

We already have a command that does something similar to this for setting up the display name from the command line. It is called PO_ResetDisplayName. Just ensure you set the options correctly before setting up the name and only set the Room to Yes.

Let us know what you think about this command in comparison to the one that makes you type the names inside Rhino. Also, in case you didn’t know there are commands to show/hide the display names of the rooms in the Rhino plugin.