PDA

View Full Version : How does AutoCAD (R13) stores a 3D BOX in DXF



Slammer
26th Sep 2003, 10:18 am
I was wondering about the different approaches that can be used the write a 3D box (cube) into a DXF file.

A cube drawn in AutoCAD (version 13 i thought) resulted in a DXF files that begins like this:

Polyline
8
0
66
1
10
0.0
20
0.0
30
0.0
70
16
71
6
72
3
0

18 VERTEX entities follow

Each VERTEX looks like this:

VERTEX
8
0
10
1010.0
20
20.0
30
3030.0
70
64
0

Some of the VERTEX entities are double all of them end with the 70-64 bitcode and all of them have their 10, 20 and 30 values set.

I don't really understand how this information leads to a cube.
A cube drawn in 3D Studio MAX resulted in a different way to store the cube bitcodes (71-8, 72-12) and 20 following vertices, reading the 3Dstudio generated DXF I could reconstruct the cube (on paper) since it uses 8 'points' that have coordinates and 12 vertex entities defining edges.

I don't understand how AutoCAD produces the cube, and since both files are correcly shown in a viewer (AutoCAD and 3Dstudio generated) there must be several ways to store 3D object (at least cubes)

The actual question is something like, how do I recontruct a cube from the DXF file with those information?

Flores
26th Sep 2003, 03:55 pm
Copy this little routine:

; scode.lsp
; Select entity to get code

(defun C:SCODE ()
(setq ENT_LIST (entget (car (entsel))))
(textscr)
(prompt "\nAssociation codes for selected entity are:")
(prompt "\n------------------------------------------")
(foreach ENTIT ENT_LIST
(print ENTIT)
)
(princ)
)
(princ)



Go here to get the DXF codes:
http://www.hyperpics.com/cad/AutoCAD/tables.htm
(Actually, that site has some pretty good info so you might want to scrounge around)

The LISP routine is easier to read 2D objects than 3D, but will still work. Even though 3DSMax and ACAD are made by Autodesk, for whatever reason there are many times that ACAD reads the same file differently. I have noticed this on complex 3D objects.

Flores