How to get a line's start and end point

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
dlwotj4274
Posts: 13
Joined: 19 Jun 2019, 07:30

How to get a line's start and end point

Post by dlwotj4274 » 25 Sep 2019, 09:36

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;
}

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

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

Post by support » 25 Sep 2019, 13:12

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply