.NET

.NET

Reply
Active Contributor
40 Posts
0 Kudos
Registered: ‎06-26-2013
Post 1 of 3
Accepted Solution

Draw Rectangle using ObjectARX and SDK

752 Views, 2 Replies
06-26-2013 06:00 AM

Hi all, 

 

I am still super new here just joined :smileyhappy:

I have to draw a rectangle using ObjectARX but the problem is that i cannot find a method for the task, I found all kind of other methods like Line, Circle, ..... I managed to do it like that:

            Point3d pointA = new Point3d(20,20,0);
            Point3d pointB = new Point3d(40,20,0);
            Point3d pointC = new Point3d(20,10,0);
            Point3d pointD = new Point3d(40,10,0);

            Line line1 = new Line(pointA, pointB);
            Line line2 = new Line(pointA, pointC);
            Line line3 = new Line(pointB, pointD);
            Line line4 = new Line(pointC, pointD);

But I thnk there must be a way to do it more easily. Can some one please help me or send me a link with some good tutorial(i checked nothing useful) Thank you in advance!

P.S.
I am still new in ObjectARX(started 2 day ago)

 

Hi,

 

AutoCAD Rectangles are closed polylines.

 

Polyline pline = new Polyline();
pline.AddVertexAt(0, new Point2d(20.0, 10.0), 0.0, 0.0, 0.0);
pline.AddVertexAt(0, new Point2d(40.0, 10.0), 0.0, 0.0, 0.0);
pline.AddVertexAt(0, new Point2d(40.0, 20.0), 0.0, 0.0, 0.0);
pline.AddVertexAt(0, new Point2d(20.0, 20.0), 0.0, 0.0, 0.0);
pline.Closed = true;

 

*Expert Elite*
2,141 Posts
254 Kudos
Registered: ‎04-29-2006
Post 2 of 3

Re : Draw Rectangle using ObjectARX and SDK

06-26-2013 06:17 AM in reply to: chikito1990

Hi,

 

AutoCAD Rectangles are closed polylines.

 

Polyline pline = new Polyline();
pline.AddVertexAt(0, new Point2d(20.0, 10.0), 0.0, 0.0, 0.0);
pline.AddVertexAt(0, new Point2d(40.0, 10.0), 0.0, 0.0, 0.0);
pline.AddVertexAt(0, new Point2d(40.0, 20.0), 0.0, 0.0, 0.0);
pline.AddVertexAt(0, new Point2d(20.0, 20.0), 0.0, 0.0, 0.0);
pline.Closed = true;

 

Gilles Chanteau
Active Contributor
40 Posts
0 Kudos
Registered: ‎06-26-2013
Post 3 of 3

Re : Draw Rectangle using ObjectARX and SDK

06-26-2013 06:36 AM in reply to: _gile

Thnak you for the help!!!!!! Really appreciated :smileyhappy:

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!