Active Contributor
Posts: 43
Registered: ‎02-07-2013
Message 1 of 4 (1,138 Views)
Accepted Solution

Draw Rectangle

1138 Views, 3 Replies
02-12-2013 01:37 AM

I want to draw a Rectangle in autocad Electrical using VB.net.

how to draw?Please send code for this.

*Expert Elite*
Posts: 9,607
Registered: ‎06-29-2007
Message 2 of 4 (1,124 Views)

Re: Draw Rectangle

02-12-2013 02:53 AM in reply to: kani_mca



download the ObjectARX-kit (>>>from here<<<), there are a lot of dot-net samples using draw-functions and also crreating polylines.

At least a rectangle is a polyline, nothing more.


- alfred -

Ingenieur Studio HOLLAUS ... www.hollaus.at
*Expert Elite*
Posts: 1,569
Registered: ‎10-08-2008
Message 3 of 4 (1,113 Views)

Re: Draw Rectangle

02-12-2013 04:55 AM in reply to: Alfred.NESWADBA

You can try this code as well:


Active Contributor
Posts: 47
Registered: ‎09-04-2012
Message 4 of 4 (1,104 Views)

Re: Draw Rectangle

02-12-2013 06:08 AM in reply to: kani_mca

As you may know, this is not a language-learning forum (except for obcure methods or structs).

Instead, we ask from other people the logic of how to do something with the AutoCAD object model.

If your question was: How to draw a rectangle?

The answer would be simple: Draw a polyline with four segments in the shape of a rectangle and then set the .Closed boolean property of the polyline to true.

That is exactly what AutoCAD does when you use the command RECTANG;


If your question is: How to draw a polyline? It should be already answered in other threads.


If you have trouble getting YOUR code to work, come back  here, post your code and explain the desired behavior.


P.S. Hold on, did he just say AutoCAD Electrical? Does it use the same API as AutoCAD?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.