Grouping Categories through BoolMask Error

Hello,

This script is designed to order categories into 3 lists;

  • Rooms
  • Doors
  • Obstacles (Walls, CW Panels, and Stairs)

I cannot get the boolmask to show all categories above (except stairs - added separately). I have tried many different level arrangements with no luck. List.Join should show 5 lists; rooms, stairs, doors, walls, curtain wall panels. Can anyone help?

Thanks

image

So … you basicly want to
get all elements from a certain level and you want 3 lists and you want to create a minimal approach?

not so minimal approach:
boolmask rooms from elements at level
boolmask doors from elements at level
same for walls, cw panels, stairs (combine those lists later on)

??

Use ‘Group by Key’ with the element categories as their key, then use ‘Index by Value’ [comparing the categroies you want and the key list] and then using ‘Get Item at Index’ should accomplish what you’re after.

Like this?

Capture

items = IN[0]
sorters = IN[1]
newlist = []

for a in sorters:

	sublist = []
	for i in items:
		if i == a:
			sublist.append(i)
	newlist.append(sublist)

OUT = newlist

This should explain my previous post.

I have shown two endings, as I am unsure on whether you want to use custom nodes. (it is handy to know the non-custom solution as the Rhythm Node struggles with ‘Lists of Lists’)

GroupbyKey.dyn (10.2 KB)
GroupbyKey-Demo

Thank you for this reply.

It worked quite efficiently - better than my method.

3 pinter, I have not tried your ,method, as this worked fine. Thank you all the same.