I’m looking for a routine/node that’s able list objects that a spline passes through from start to finish. I’ve seen some methods on here where the use of bounding boxes of families are list mapped against points along a spline, but if you large number of families you need a lot of points (20,000 odd) and currently this is causing Dynamo to crash.
I’ve tried the following as work around but geometry intersect doesn’t like what I’m trying to do.
Basically I have a spline that crosses through the family instances and I want to order the families in the direction the spline is going, from start point of the spline to end of the spline as I’ve drawn it. See below.
I have a similar code, but the problem is when you have huge amount of piles you need a huge amount of points to be produced and hence Dynamo crashing. I’m trying to get away from producing points on splines.
Unfortunately, I can’t find any other solution with a spline.
But if you use a series of lines, and then join them with Polycurve.ByJoinedCurves or use Curve.StartPoint, you will get much less points and they will be placed where they have to be in the correct order…
I needed similar solution and here is my workaround. I use this script to renumber (change mark parmater) for any kind of family instances. You can check and see if it works for you. Good luck!
P.S. This script uses a spline but there is no need to interesct with the instances. The script get the closest point from the instance to the spline.
I used Yna_Db’s approach of using lines and using the start point. It works great. Plus its a lot quicker to draw the line instead of the polyline. Win win solution.