Spline Intersect family node?

Hi there,

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.

Any suggestions will be appreciated.

Regards

try
extrude curve

or translate curve in z direction

Nico,

I’ve tried what you said and It doesn’t work. I don’t see how this would work since the spline actually intersect the family in question anyway.

Regards

BoundingBox.Intersects would probably work in this case:

Yna_Db,

That works great. How would I then order the categories in the sequence with the start and end point of spline?

Regards

Could you be more specific? What do you mean by “order the categories in the sequence”?

Yna_Db

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.

See here:

Yna_DB

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.

Regards

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…

This might be the solution, thanks I’ll give it a try.

when you get a reproducible crash please post it to the github with files needed to reproduce - then we can fix it or use it as a performance case.

Its probabably not a crash as such it just takes several minutes to run. I’ve only realised this today.

I have seen this today that could reduce the number of points you need: Geometry.ClosestPointTo, see this post:

Hi @James_Washbourne

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.

Thanks all,

I should have replied to this earlier.

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.

Regards

I worked perfectly. thank you

1 Like