Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

Rename spaces with space type

asked 2017-05-02 09:29:37 -0600

PY's avatar

updated 2017-05-02 09:58:27 -0600

Hello,

Is there a way to rename several spaces in Sketchup/OS ? Maybe by assigning the space type and a number or adding a character at the beginning of the space name automatically ?

In my model, I want to know which spaces are apartments or corridors only with their names, but it would take time to do that one by one.

Thanks,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-05-02 13:51:33 -0600

updated 2017-05-02 13:54:02 -0600

Seems related to this post about mapping space names to plan for the purpose of re-naming, but not exactly the same question.

There is a user script in the SketchUp Plugin called Rename ThermalZones Based on Space Names. this also exists as a measure for use outside of app, along with another measure to Rename Space Surfaces Based on Parent Space and Orientation

The user script in the SketchUp plugin has code that does thermal_zones.each do where thermal_zone = model.getThermalZones. You could change that to model.getSpaceTypes.each do |space_type| and then loop through spaces with space_type.spaces.each do |space|. Then you could use any logic you want to rename the individual spaces.

You can get an objects name with object.name in some cases you may need to use object.name.to_s. Then to set the name of the object use object.setName("My New Space Name").

I would recommend using a measure vs. just a SketchUp user script, but either will work.

edit flag offensive delete link more

Comments

Thank you for your answer. I tried to make the change yesterday in Rename ThermalZones Based on Space Names. However, my knowledge in measures is not sufficient enough to make it works. Can you explain me more precisely what to do ? Thanks,

PY's avatar PY  ( 2017-05-04 08:00:28 -0600 )edit

Hi David, Is there anyway to create space type name based on space name ? Thank you

Brianna's avatar Brianna  ( 2021-03-24 15:32:52 -0600 )edit

@Brianna, yes it would be something like space.spaceType.get.setName(space.name), but assuming space types are used for many spaces, you have to decide how to handle that. My code example doesn't check if the space has a space type assigned, which should be added if you use it.

David Goldwasser's avatar David Goldwasser  ( 2021-03-24 23:06:30 -0600 )edit

Thank you David

Brianna's avatar Brianna  ( 2021-03-25 10:26:44 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

Stats

Asked: 2017-05-02 09:29:37 -0600

Seen: 342 times

Last updated: May 02 '17