Extracting points from a mixed list?

Hi, I was trying to import all the divided surfaces from revit into dynamo to place adaptive family on them. However, the problem now is that I have a list which consists of 264 sub-list (representing 264 surfaces) and every sub-list contain a mixed range of lines, nurbs-curves and points. I want to extract only points from all the sub-lists but couldn’t find a way. Can anyone here has a solution for this?

You can use the Object.Type node to determine what kind of element you’re dealing with and subsequently use its output in a filter. However, you could possibly save yourself some trouble by trying the DividedSurface.EvaluateGridNodes node from package Clockwork - I think it’ll probably give you what you want.

2 Likes

Thanks @Andreas_Dieckmann,

That really sorted it out. Now that I can have all the points on those divided surfaces, do you happen to know any quick way to sort them out into 4-point quad panels? The reason is I want to place a 4-point adaptive family on them which I used to do manually with snapping and repeat function in Revit but with this amount of divided surface it could take ages. So I’m looking for an automated way with dynamo

Are the points in a random position or in some sort of order? If they are in some sort of order you could List.Chop the list in sublists with 4points each

1 Like

All the surfaces were divided in Revit with intersection with planes so yeah they are in order. I tried List.Chop as well but since some of the surfaces have odd number of points and some have even number (ranging from 24 to somewhat 57 points per surface), it is a bit cumbersome to get it right.

And for 4-point adaptive family, the first 2 points of next panel would be the last 2 points of the previous panel. I suppose shiftindicies might help but still, having difficulty getting it right really

Here’s how you would get quads from a point grid. In your case, other rules may apply - but these are the basic mechanics:
grafik
EDIT: In the first code block v and v+1 should be switched.

2 Likes

I’ve had the same issue, but I used a different graph to sort Point objects:

Just a really simple List.GroupByKey (probably my favourite node) using Object.Type as the key.

Ignore the Flatten and Element.GetLocation nodes in my example; I was sorting Revit elements directly. In my example I needed to sort a list of lists by whether an Element’s insertion method was by Point or by Line (Curve).

The nice thing about this way is that you can maintain your overall list nesting structure, which would presumably retain the surface data; the sorted objects of each surface will stay listed by surface, making it really easy to get points-by-surface rather than having having to use List.Chop on lots of lists of varying lengths.

1 Like