Author Topic: Creating a Reference Polyline along an existing boundary (AutoCAD .NET API)  (Read 242 times)

0 Members and 1 Guest are viewing this topic.

wisenickel

  • Mosquito
  • Posts: 1
Greetings.

First, let me provide some context to my problem. The goal is to create a reference Polyline - bocPolyline from the existing closed boundary - lotLine, if the roadLine is close to && parallel to the lotLine . I have an ObjectIdCollection - roadLines and a Point3dCollection foundIntPoints. I have been searching for a way to simply get the distance between the roadLines and foundIntPoints. This was not a hard task previously when the roadLines were Polylines, but I am not sure how to approach this problem now.

 

The previous way I got distance from the polyline to the Point Collection:
Code: [Select]
protected Polyline createBOCReferencePolyline(Polyline roadLines, Polyline lotline, Point3dCollection foundIntPoints)
        {
            Polyline bocPolyline = new Polyline();
            var plane = new Plane(Point3d.Origin, Vector3d.ZAxis);
           
            for (int i = 0; i < foundIntPoints.Count; i++)
            {
                if (roadLines.(foundIntPoints[i]) < 20)
                {
                    if (roadLines.Angle == lotline.Angle)
                    {
                        bocPolyline.AddVertexAt(i, foundIntPoints[i].Convert2d(plane), 0.0, 0.0, 0.0);
                    }
                }
            }

            return bocPolyline;
        }

Btw - I know that the .Angle call is not a real thing, I included it for the sake of simplicity.
I would greatly appreciate anyone's help on this. If a part of my question needs more context, please let me know thank you.