Draw Rectangle

Draw Rectangle

Anonymous
Not applicable
4,574 Views
3 Replies
Message 1 of 4

Draw Rectangle

Anonymous
Not applicable

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

how to draw?Please send code for this.

0 Likes
Accepted solutions (1)
4,575 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 4

Hallex
Advisor
Advisor
Accepted solution

You can try this code as well:

http://forums.autodesk.com/t5/NET/Create-Objects-and-then-replace-them-with-userinput/m-p/3434003/hi...

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 4 of 4

Anonymous
Not applicable

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?