Silas Posted June 24, 2019 Share Posted June 24, 2019 Hello, I try to get an automatic door ID generator. The main part is done - but in the middle of the door ID should be a counter. If there is a room with more than one door, we need different door IDs. That's why we should have a counter in the middle. I tryed something (after #Number Check for Count) but just get the total count in each door and not 1,2,3 ... Thank you Silas import vs c_door = "(PON='Door CW')" door_list = [] door_id_pos = 4 def Add_Handle(obj): door_list.append(obj) vs.ForEachObject(Add_Handle,c_door) full = [] full_list = [] for element in door_list: bool, space_nr = vs.IFC_GetSpaceParamFO(element, '3') full.append(element) space_nr1 = vs.SubString(space_nr,',',1) space_nr2 = vs.SubString(space_nr,',',2) full.append(space_nr1) if space_nr2 != '': full.append(space_nr2) full_list.append(full) full = [] for item in full_list: first_spacenr = item[1] try: second_spacenr = item[2] except IndexError: second_spacenr = '' vs.AlrtDialog('Eine Türe ohne zwei Räume gefunden') vs.SetSelect(item[0]) #Number Check for Count y = 0 i = 0 imax = len(full_list) number = 0 while i < imax: if item[1] in full_list[y]: number = number + 1 y = y + 1 i = i + 1 #Set Door ID number_space = first_spacenr +'_'+ str(number) + '_' + second_spacenr vs.SetRField(item[0],'Door CW','DoorID',number_space) vs.ResetObject(item[0]) number = 0 Quote Link to comment
DomC Posted July 1, 2019 Share Posted July 1, 2019 Hi I am not sure, if I unterstand it right: 1. If you have a door from room_1 to room_2 you want to have 1_1_2 2. If you have a second door from room_1 to room_x you want to have 1_2_x If you want this, it will in my opinion make something you maybe not want to have. Because room_1 and room_2 values follow the stacking order. Or if you just count unique ID same room-room pair (which normally will counts one if not two doors connects the same room pair ) As Example you have 100 doors from hallway to rooms. It will not automatically count all 100 doors to the hallway position. Did you already solved that point? Ideas: Sort by room number etc. to get a reproducable order. Also we could solve that if you get the wall direction of the parent wall of the door and look the banding of the door. So you could see, in which room the door opens. If you have a door without opening, it will be hard to deside, from which room you get to another room. You have to build a complexe network of room-room connection which sort parent room (defined somehow by entrances etc. -could be very complexe(impossible for us) I think) and child room. Or you just get the door opening circle or another indicator and check if this is in another room By the way back to your counter: You don't store x, y, and number in a global list and reset them to zero every new door in your door iteration. So it is hard to check which ID are already used by another door. Don't would think about this till the first point is not clarified. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.