Problems Assigning Rooms to Groups
Posted: Tue Jun 04, 2019 9:57 am
Hello,
I'm having some trouble using the RoomGroups functionality and was wondering if someone could point out what I'm doing wrong. I'm trying to assign a list of rooms to a group, but keep getting a ValueError: No group exists with the specified index even though I'm getting the index by calling get_room_groups(). Here is a simplified version of what I'm running:
The print line outputs the following:
Upon running, I get the following error:
rg.assign_rooms_to_group(room_groups[group_name], scheme, room_list)
ValueError: No group exists with the specified index
Any help on this would be greatly appreciated!
I'm having some trouble using the RoomGroups functionality and was wondering if someone could point out what I'm doing wrong. I'm trying to assign a list of rooms to a group, but keep getting a ValueError: No group exists with the specified index even though I'm getting the index by calling get_room_groups(). Here is a simplified version of what I'm running:
Code: Select all
rg = iesve.RoomGroups()
bodies = iesve.VEProject.get_current_project().models[0].get_bodies(False)
groups = {
'Group 1': bodies[:12],
'Group 2': bodies[13:22],
}
scheme = 10
room_groups = {g['name']: g['handle'] for g in rg.get_room_groups(scheme)}
for group_name, room_list in groups.items():
print('Assigning the following group:')
print('group handle: {}, scheme handle: {}, rooms: {}'.format(
room_groups[group_name], scheme, room_list))
rg.assign_rooms_to_group(room_groups[group_name], scheme, room_list)
Code: Select all
Assigning the following group:
group handle: 1, scheme handle: 10, rooms: [<iesve.VEBody object at 0x2798FD30>, .....]
rg.assign_rooms_to_group(room_groups[group_name], scheme, room_list)
ValueError: No group exists with the specified index
Any help on this would be greatly appreciated!