Your suggestion here only works if the perimeter curves and holes are already in separate lists.
How to distinguish between a surfaces perimeter curves and holes?
This seems like it should be a simple problem: sort by area, largest is perimeter, others are holes. But it’s not, because Surface.PerimeterCurves returns a flat list of all edges for each surface and PolyCurve.ByJoinedCurves fails to return a result for unconnected ‘wires’ (https://github.com/DynamoDS/Dynamo/issues/2669)
I have several lists of surfaces (from MassLevelData.Faces). Some surfaces have internal holes. I would like to create floors on each surface using Floor.ByOutlineTypeAndLevel, and then Openings where needed.
I have tried using the Archi-Lab ‘Group Curves’ node (@Konrad_K_Sobon) and CurvesToPolyCurve by EnjoyRevit to sort curves into connected lists/PolyCurves, however neither return a result on nested lists.
I can’t attach the .rvt file since it exceeds 3MB, but i have attached the masses i was using, which linked inside mass families with mass floors added
Once you have your floor plate surfaces (either by intersection, or by grouping them by level), you could use the excellent “Group Curves” node from archi-lab. You can then sort the resulting curves by their total length (the biggest one being the outer-most curve and everything else being a hole) and proceed as usual:
Your explanation works for a two dimensional list (a list of lists), however I can’t get the Group Curves node to work for a three dimensional list (a list of lists of lists).
See image:
The top graph is operating on one solid, whereas the bottom graph is operating on three solids.
I’d like to avoid flattening completely, otherwise the data-structure of the curves will no longer match MassFloors and levels. Each floor must be placed on it’s appropriate level, rather than ‘Height Offset from Level’.
I’ll just have to find a way to make sure the lists can be re-organised afterwards.
P.S. as an aside, how is list lacing relevant on a component that only has one input (such as Curve Group? using the @level makes sense to access inner lists, is that what Longest list lacing is doing in this instance?
Might also want to convert the curves into a surface and then get the area, smallest area being the hole, instead of going by perimeter. While unlikely it is possible to get a false positive when comparing the curve lengths.
Just what was happening in my case. The outer perimeter was a smooth rectangle and the inner perimeter was a weird long curve. Thanks for the suggestion.