.NET

## .NET

Active Contributor
Posts: 40
Registered: ‎06-26-2013
Message 1 of 6 (8,391 Views)

8391 Views, 5 Replies
08-05-2013 04:41 AM

Hi all,

I am trying to create a cylinder. To accomplish this I am creating two ellipses and two lines. After I try to insert them in the DWG dwaing I can see only the lines. Here is a code sniped so you can see what am i doing.

```Double ellipseRadiusRatio = 0.4;
Vector3d ellipseMajorAxis = new Vector3d(0.0, 1500.0, 0.0);
Vector3d ellipseLeftCenter = new Vector3d(72541.7, 80198.5, 0.0);
Vector3d ellipseRightCenter = new Vector3d(77145.7, 80173.6, 0.0);

Ellipse leftEllipse = new Ellipse();
leftEllipse.StartAngle = 0;

Ellipse rightEllipse = new Ellipse();
rightEllipse.StartAngle = 0;

Point3d ellipseTopStart = new Point3d(77154.7, 81673.6, 0.0);
Point3d ellipseTopEnd = new Point3d(72541.7, 81698.5, 0.0);
Point3d ellipseBottumStart = new Point3d(77154.7, 78673.6, 0.0);
Point3d ellipseBottumEnd = new Point3d(72578.5, 78701.8, 0.0);

Line ellipseTop = new Line(ellipseTopStart, ellipseTopEnd);
Line ellipseButtom = new Line(ellipseBottumStart, ellipseBottumEnd);

acBlkTblRec.AppendEntity(rightEllipse);
acBlkTblRec.AppendEntity(leftEllipse);
acBlkTblRec.AppendEntity(ellipseTop);
acBlkTblRec.AppendEntity(ellipseButtom);

acTrans.Commit();```

I hope you can see the problem.

Best regards,

Dimitar Georgiev

probably I understand the point that why ellipse drawing is not wokring.

"The way to create an ellipse is to use the constructor of ellipse class and pass the parameters." - I got this line from adndevblog.The way you try to draw ellipse is not valid. try to see below link. There you will get full code of how to create ellipse:

I hope this will solve your issue.

Regards

Zakir
Mentor
Posts: 231
Registered: ‎11-09-2012
Message 2 of 6 (8,379 Views)

# Re: Add ellipse in drawing.

08-05-2013 05:28 AM in reply to: chikito1990
Try to add below lines before doing acTrans.commit():

Active Contributor
Posts: 40
Registered: ‎06-26-2013
Message 3 of 6 (8,375 Views)

# Re: Add ellipse in drawing.

08-05-2013 05:40 AM in reply to: mzakiralam

still the same result. I uploaded 2 pictures "result"  is the current pucture,  but i wnat to be like "result2" (ignore colors and extra elements)

Mentor
Posts: 231
Registered: ‎11-09-2012
Message 4 of 6 (8,351 Views)

# Re: Add ellipse in drawing.

08-05-2013 07:15 AM in reply to: chikito1990

As I did not see your full code so I can't tell why it is going wrong. However, in below there are 2 links where drawing ellipse is involved. Try to compare your ellipse with those code:

http://forums.autodesk.com/t5/NET/How-can-I-use-a-graphic-ellipse-with-text-together/m-p/3806417/hig...

http://forums.autodesk.com/t5/NET/VB-NET-SET-METHOD-ON-ELLIPSE/td-p/2824426

*Expert Elite*
Posts: 1,569
Registered: ‎10-08-2008
Message 5 of 6 (8,347 Views)

# Re: Add ellipse in drawing.

08-05-2013 07:22 AM in reply to: chikito1990
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Mentor
Posts: 231
Registered: ‎11-09-2012
Message 6 of 6 (8,345 Views)

# Re: Add ellipse in drawing.

08-05-2013 07:25 AM in reply to: chikito1990

probably I understand the point that why ellipse drawing is not wokring.

"The way to create an ellipse is to use the constructor of ellipse class and pass the parameters." - I got this line from adndevblog.The way you try to draw ellipse is not valid. try to see below link. There you will get full code of how to create ellipse:

I hope this will solve your issue.

Regards

Zakir
Post to the Community