Is there a node or way in Python to get a 2D Polygon from a pipe in Civil 3D? I want to check if a certain point falls within a pipe as shown in plan view using the Polygon.ContainmentTest node.
For a polygon, you could do the following: Get the location line, pull it to your plan level (Curve.Project), and use the PolyCurve.ByThickeningCurveNormal node to get the extent of the pipes. Explode that, pull the start points from each of the curves, and build a polygon by the points.
That said, this will likely be more time consuming then patching the polycurve into a surface and using a geometry.intersect node for data sets with multiple pipes and points.
And it may be that keeping the 3D dataset would could be faster still for large data sets if you’re smart about it.
Gotcha. I’ve tried using the Geometry.Intersect and Geometry.DoesIntersect nodes. However the problem with those is that a lot of my lines come to a T-shape. The nodes won’t recognize those ones as Intersecting. They only return “True” if they fully cross.
Not quite sure I follow… can you post a sample DWG?
It turns out, I don’t need this anymore. I was able to resolve my problem by finding the line closest to a given point using Python.