List management - cross referencing geometry logic back to elements to be filtered

Hi,

My understanding of how to uses lists is still not the greatest and I need help figuring out how I can cross reference between two lists. In short, my script modifies interior elevations so that the viewport is cropped to the boundary and a filled region is placed around the view (as per my office’s graphic standard). I have successfully made a script that does this for 1 room and any interior elevation inside (see attached 1) but now I need to do this for multiple rooms and their associated interior elevations (see attached 2).

My logic is, because I don’t want to track the order of selection, I need to determine which room the elevation markers are located by using the element’s geometry. I use the point of the elevation marker, the room boundary polygon, and [Polygon.ContainmentTest] to return a true or false list. This list tells me if the marker is inside a room. For every true instance, i’ll need to pull the list indices and cross reference that back to the original elements (rooms and elevation markers). I just lack the understanding of how to this… I tried [List.Map] with the boolean from the [Polygon.ContainmentTest] node, but couldn’t get it working (see image).

Any insights would be greatly appreciated.

1) MULTI SELECTION - Hatch View of Interior Elevations.dyn (46.4 KB)
2) MULTI ROOM MULTI SELECTION - Hatch View of Interior Elevations.dyn (91.0 KB)

I have two lists…

i) 1,2,3,4
ii) a,b,c,d

I need to make it look like 1 list like this…

1(abcd) 2(abcd) 3(abcd) 4(abcd)

You can count the items in the first list and duplicate the second list that many times so that each item has its own sublist to compare, but you’ll still probably need to use list levels to ensure everything follows the structure you’re after. Using list levels from the beginning is just as easy.

Assuming you get the list of ElevationMarkers down to a list of points, you would use list levels (@L1) to compare each point to each room. This will give you a result that matches your intended structure (a list of sublists representing each point and the boolean values for each room). You can then use that with FilterByBoolMask and list levels again to return the matching room for each point.

I don’t see the graph and can’t quite work out the ask, but it seems to me that looking at the elevations first rather than the rooms first will simplify stuff.

  1. Get all interior elevations using whatever method is appropriate for your firm’s standard, or via selection (project browser based selection, Datashapes UI++, or views on sheet is nice here), then pass on the elevations as a list.
  2. Get all rooms in the elevation(s), pull their solids and union that into a single solid.
  3. Pull the crop region from the elevation(s) and convert to a surface.
  4. Intersect the surface(s) with the associated solid representing the room masses (list level should be 2 count of each should match).
  5. Pull the perimeter curves and find the ’center loop’ of that resulting set of loops…
  6. Use the center loop to process the masking for the elevation.

Nick’s solution helped out, I was having an issue with the bool.
But yes, basically what you wrote is what I’m trying to do - thanks for the help.