Add Line or Arc to CADEditorControl

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
bobpenas
Posts: 4
Joined: 14 Jan 2016, 01:20

Add Line or Arc to CADEditorControl

Post by bobpenas » 14 Jan 2016, 01:59

How can I programmatically add a line or arc to a loaded drawing using the CADEditorControl?
Thanks,
Bob

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

Re: Add Line or Arc to CADEditorControl

Post by support » 14 Jan 2016, 10:35

Hello Bob,

Please look at the code examples below.

Code: Select all

CADArc vArc = new CADArc();
vArc.StartAngle = 60;
vArc.EndAngle = 210;
vArc.Radius = 50;
vArc.Point = new DPoint(110, 160, 0);
vArc.Color = Color.Green;
cadEditorControl.Image.Converter.Loads(vArc);
cadEditorControl.Image.Layouts[0].AddEntity(vArc);
cadEditorControl.Refresh();

Code: Select all

CADLine vLine = new CADLine();
vLine.Point = new DPoint(80, 100, 0);
vLine.Point1 = new DPoint(150, 150, 0);
vLine.Color = Color.Blue;
cadEditorControl.Image.Converter.Loads(vLine);
cadEditorControl.Image.Layouts[0].AddEntity(vLine);
cadEditorControl.Refresh();
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

bobpenas
Posts: 4
Joined: 14 Jan 2016, 01:20

Re: Add Line or Arc to CADEditorControl

Post by bobpenas » 14 Jan 2016, 17:08

Thank you.

Post Reply