Page 1 of 1

How to get a line's start and end point

Posted: 25 Sep 2019, 09:36
by dlwotj4274
I found that 2DLine Class has a StartPoint and EndPoint member.

so I want to extract line's start point and end point in CadImage

However, I'm confusing how to approach 2Dline Class in CadImage.

I wrote a cod like this.

public static List<2DPoint> GetLineDataFromCad(CADImage cadImage)
{
List<2DPoint> lineData = new List<2DPoint>();
if (cadImage != null)
{
//TODO

//List<CADEntity> cadTexts = cadImage.Converter.Entities.FindAll(ent => ent.EntType == EntityType.Line);
//cadTexts.ForEach(entity => lineData.Add((entity as 2DPoint).StartPoint));
}
return lineData;
}

Re: How to get a line's start and end point

Posted: 25 Sep 2019, 13:12
by support
Hello

"2Dline" is not used for reference to the entity on a layout (just like other entity names with the prefix "2D"). You need to use "CADLine" instead. Please find out more at https://cadsofttools.com/help/cadnet/to ... 00D01.html

Andrey