Find doors based in there number(s) , how?

Hello,

i think i solved this anywhere, but i can`t find the solution right now…

so i want just to filter out doors based on a DOOR_NUMBER(S) list… how can i achive that to get my elements:

KR

Anderas

Comon Draxl, you’re around here enough to know that screenshot doesn’t give us enough info to help.

What data is coming out of the python nodes and getparamvaluebyname ?

1 Like

Messy wires! :crazy_face:

Why not use a bit of Python and an if statement?

eg. If doorname != xxx then append the list.

1 Like

@haganjake2 @Alien

i have doors and Numbers… 1172 doors

i got a external list of 35 doors in numbers i have to check them

i can`t use

x == "something" ? true : false

because it works just for a single element thats running thrue the list .

KR

ANdreas

@Alien ,

messy project too! …when the construction is faster than the planning… Where is BIM? Clients want only save money based on Claim-Management. BIM makes just noise…
grafik
:slight_smile:

KR

Andreas

1 Like

As I said, use a bit of python.

Your check list is IN[0]and your door number list is IN[1]

Something along the lines of…
OUT = [ ]
for i in door_numbers:
if i in CheckList:
OUT.append(i)

OR…
if you’re filtering doors based on function - filter out the function.

1 Like

@Alien ,

thats ok! BUT i get only the numbers, how can i get the Elements based on it

i need 32 true and the rest false

doorNumbers = IN[0]
checkList = IN[1]

OUT = []

for i in doorNumbers:
	if i in checkList:
		OUT.append(i)

Add an enumerate.
Feed in the actual Elements and extract the ones at the same index.

Something like:
OUT = [ ]
for index, i in enumerate(doorlist):
if i in CheckList:
OUT.append(ActualElement[index])

Don’t forget though, if it’s just external doors you can use:

image

Or keep the whole thing in python. No need to start in python, leave python just to get a value, then go back so you can check the value.

for e in elements:
   param = e.LookupParameter(parameterName)
   if param in checkList:
      out.append(e)
1 Like

Or do one superpowered filteredelementcollector:

door_nums = IN[0]

filtered_doors = list(filter(lambda x: x.LookupParameter("Mark").AsString() in door_nums, FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).WhereElementIsNotElementType().ToElements()))

Bit heavy on the processing to check every doors mark but I do like 1 line solutions :sweat_smile:

image

1 Like

So no one else can read it easily? :stuck_out_tongue:

2 Likes

Correct, job security is everything :wink:

3 Likes

@Nick_Boyts,

it worked


#1️⃣ doors, Kennzeichen-list 
elements = UnwrapElement(IN[0])
checkList = IN[1]

output = []

#2️⃣ get elements based on Kennzeichen
for e in elements:
	param = e.get_Parameter(BuiltInParameter.DOOR_NUMBER).AsString()
	if param in checkList:
		output.append(e)
		
OUT = output
#✅ End

KR

Andreas

The parameter node and second python node are completely redundant. Just include this code in your initial python block that gets the doors. No need to do everything multiple times.

2 Likes