Jump to content
Silas

Counter for DoorID

Recommended Posts

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

 

Share this post


Link to post

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.

 

 

 image.thumb.png.7e04c87990ecd73a9504ae10dcd930c8.png

 

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.

 

 

 

 

 

 

 

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×