How to determine if the point is on the line?

I’ve just started using dynamo and i was trying to determine if the point is on the line.
I would like to ask if there are any similar nodes in Dynamo that have this function?

Hi,
you can use Geometry.DoesIntersect node

Or Geometry.DistanceTo, and an == node.

Geometry.DoesIntersect is likely easier.

Hi Fellas,
I am not getting the desired result with the Geometry.DoesIntersect node.
As you can see, the point is clearly on the Y axis, yet the node says false. Do I need to convert something? I am at a loss.

Any help is appreciated.

Looks like you are using a GetLocation node for the Wall. This outputs a point, which is usually the centroid or the origin point in the element.

Instead, you may want to use Element.Geometry or Element.Solids, which will provide 3D forms.

Edit: Nevermind, I see the line output. Perhaps there’s a tolerance issue, where the line is not exactly on Y=12.566? You could try turning the point into a tiny sphere to test that.

Hello @LoRue - What is your desired workflow here? Pairing points with lines they intersect with? :slight_smile: There are a few different approaches, and indeed this could be due to a rounding error where your point is not truly sitting on that line.

If you try getting the Point.X / Point.Y / Point.Z values from each of your Points.StringToPoint and Element.GetLocation nodes … do they sit in the same plane?

Hi @solamour, @Robert_Younger
You are correct!
My goal is to line up a list of Door insertion points derived from a CAD file with location curves from walls that were also created from CAD geometry. It is part of a larger project to translate CAD floor plans into a LOD200 model.

I see that I will need to round the curve to 3 digits like the points.
Thanks a bunch. I was going a little batty! Is there a way to deal with this rounding error globally?

I’m actually working on a task with similar properties (lifting CAD duct/pipe linework and referencing nearby textdata), maybe some of the common points will help.

Rather than compare points and lines, consider turning them into spheres and cylinders with a set diameter that covers the expected tolerance errors (maybe someone decided to forego object snapping when placing their doors). That can at least provide a structured list that relates doors to walls.

Where your workflow differs is that you’ll probably need to correct the insertion point to be a point along the curve. There should be some threads that discuss shortest-length methods to push the point onto the curve.

1 Like

Ok I’ll try the sphere method. It seems easier than exploding the curves, rounding each number and reconstituting it. I wish there was a way to set the units to be all the same tolerance.

In the interest of closure, here is my reconstituted line rounding graph. Not sure why the Curves.EndPoints node is orange, but it doesn’t seem to affect anything. “Dictionary.ValueAtKey failed”.