Rename Spaces

The VE Python API allows users create simple programs using the Python Programming Language, to interact with a VE Model and/or Vista Results File
Post Reply
marentette
VE Newbie
VE Newbie
Posts: 4
Joined: Thu Nov 10, 2022 10:57 pm

Rename Spaces

Post by marentette »

Is it possible to rename spaces?

Code: Select all

groups = rg.get_room_groups(scheme_handle)

for group in groups:
    if len(group['rooms']) != 0:
        group['name'] = "_" + group['name']
print(groups) # This shows that the group dictionary was updated 
        
The above code does not update the space name within the model.
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Rename Spaces

Post by Rhind »

No, it is not possible to rename spaces via the API at present.

In your example, you are getting a copy of the room group information and modifying the name of the room group in your local copy (not modifying the model).

It is possible to create new room groups and room grouping schemes through the API. From the manual:
create_grouping_scheme(name) -> int
Creates a room grouping scheme with the given name. Returns the handle of the new grouping scheme.

create_room_group(scheme_handle, group_name, colour = (0, 0, 0) ) -> String
Creates a room group with the given name and colour in the provided grouping scheme. Colour is expressed as a tuple of (R,G,B) and is optional, defaulting to black. Returns the handle of the new room group.
Hope that helps.
marentette
VE Newbie
VE Newbie
Posts: 4
Joined: Thu Nov 10, 2022 10:57 pm

Re: Rename Spaces

Post by marentette »

Thank you. I am trying to automate the process of removing unused room groups or simply renaming un used room groups to include a "_" before the name.

Is this possible?
Post Reply