Ellipse's arc - DXFExport.NET

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
francoas
Posts: 10
Joined: 26 Jun 2007, 18:22

Ellipse's arc - DXFExport.NET

Post by francoas » 17 Sep 2007, 11:52

Hi.

I need some help.

I am trying to write arc of ellipses using the DXFExport.net.
Using the DXFData structure, I fill

- point
- point1
- radius
- startAngle
- endAngle

and then I call AddElipse

On the file all data are written BUT the angles with the result that instead of writing an arc, i write an entire ellipse.

Can you help me ?

Franco

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

Post by support » 17 Sep 2007, 15:11

Hello!

The following example is based on <b>DXF Export Demo</b> from <b>DXF Export .NET</b> package (available at: http://www.cadsofttools.com/download/dxfexportnet.zip):

Code: Select all

<font color="blue">private void</font id="blue"> AddEllipticArc_Click(<font color="blue">object</font id="blue"> sender, System.EventArgs e)
{
	DXFExport vDXF = <font color="blue">new</font id="blue"> DXFExport();
	vDXF.AddLType("_DASH",<font color="blue">new float</font id="blue">[]{5,-2});
	DXFData Data = <font color="blue">new</font id="blue"> DXFData();

	Data.Clear();
	Data.color = DXFExport.ColorToDXF(Color.Green);
	Data.text = "_DASH";
	Data.thickness = 3;
	Data.point.X = 0;
	Data.point.Y = 0;
	Data.point1.X = 50;
	Data.point1.Y = 40;
	Data.selfType =	(<font color="blue">byte</font id="blue">)ArcType.atEllipse;
	Data.radius = (<font color="blue">float</font id="blue">)0.3;			
	Data.startAngle = (<font color="blue">float</font id="blue">)0.0;
	Data.endAngle = (<font color="blue">float</font id="blue">)1.3;
			
	vDXF.AddArc(Data);
	vDXF.SaveToFile("c:\\AddArc.dxf");		
}
<b>Important</b>: Data.startAngle and Data.endAngle are radians.

Sergey.

Please post questions to the forum or write to support@cadsofttools.com

francoas
Posts: 10
Joined: 26 Jun 2007, 18:22

Post by francoas » 17 Sep 2007, 19:32

Thanks.

It worked.

Anyway I find curious that for Circle Arcs angles have to be specified in dgrees while for Elliptical Arcs they have to be specified in radians.

Franco Andrea

Post Reply