Page 1 of 1
Rename Spaces
Posted: Thu Nov 10, 2022 11:01 pm
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.
Re: Rename Spaces
Posted: Thu Jan 12, 2023 10:31 am
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.
Re: Rename Spaces
Posted: Mon Jan 30, 2023 11:00 pm
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?