This project has moved. For the latest updates, please go here.

Loading Rectangle from DXF?

Apr 27, 2016 at 12:28 PM
Just looking for advice / confirmation really. Since DXF stores all rectangles (and rounded rectangles) as lines and arcs is the only way to load these in to check each line for lines that have the same points and create the rectangle manually?

Apr 27, 2016 at 8:12 PM
AutoCad has no entity to store rectangles or rounded rectangles, they are created as lightweight polylines (LWPOLYLINE). If what you are seeing in the dxf are just lines and arcs, perhaps is that the polyline has been exploded or the rectangle has been manually created from a set of line.

Therefore, if you are looking for is some kind of rectangle entity there is none.

Apr 28, 2016 at 7:55 AM
Hi Daniel,

I knew there was no rectangle / rounded rectangle entity hence my question. I am looking for advice on the best way to find rectangles / rounded rectangles within a dxf regardless of that, so that I may load them into my programs file structure.
Apr 28, 2016 at 7:34 PM
In that case, as you pointed it out in your first post you will have to do it manually.

If you could, at least, have some control over the dxf creation process, you could use the extended data to store additional information to ease the process. In AutoCad you could create your own command through lisp, vba, or arx to create rectangles with extended data to recognize it.

But, since you are making this question I guess you don't.

Apr 28, 2016 at 9:39 PM
The DXF files are coming from users so I don't really have access to them during their creation process.

Appreciate the advice!