Code Red > AutoLISP (Vanilla / Visual)

acadver info

<< < (3/5) > >>

GDF:
Thanks Lee

Updated code below:

--- Code: ---(defun GetDwgVersion (dwgName / path handle header)
    ;;  If the drawing's version can be determined
    ;;  it's returned as an integer, otherwise nil.
    (if (setq path (findfile dwgName))
        (cond
            (   (setq handle (open Path "r"))
                (setq header (substr (read-line Handle) 1 6))
                (close handle)
                (cdr
                    (assoc header
                       '(                            
                            ("AC1024" . 2010)
                            ("AC1021" . 2008)
                            ("AC1018" . 2004)
                            ("AC1015" . 2000)
                            ("AC1014" .   14)
                            ("AC1012" .   13)
                            ("AC1009" .   12)                          
                        )
                    )
                )
            )
        )
    )
)
(princ (strcat "\n*** -------- AutoCAD Release " (rtos (GetDwgVersion (getvar "dwgname")) 2 0) " -------- ***"))

--- End code ---


I'm looking for the list of AutoCAD versions that have differnt file formats. Like in the saveas "select a version"
pull down dialog box at the bottom "Files of Type". Different consultants request different versions. This just gives me a heads up on what version the current drawing is.

GDF:
http://en.wikipedia.org/wiki/.dwg

Version Internal version AutoCAD versions
DWG R1.0 MC0.0 AutoCAD Release 1.0
DWG R1.2 AC1.2 AutoCAD Release 1.2
DWG R1.40 AC1.40 AutoCAD Release 1.40
DWG R2.05 AC1.50 AutoCAD Release 2.05
DWG R2.10 AC2.10 AutoCAD Release 2.10
DWG R2.21 AC2.21 AutoCAD Release 2.21
DWG R2.22 AC1002, AC2.22 AutoCAD Release 2.22
DWG R2.50 AC1002 AutoCAD Release 2.50
DWG R2.60 AC1003 AutoCAD Release 2.60
DWG R9 AC1004 AutoCAD Release 9
DWG R10 AC1006 AutoCAD Release 10
DWG R11/12 AC1009 AutoCAD Release 11, AutoCAD Release 12
DWG R13 AC1012 AutoCAD Release 13
DWG R14 AC1014 AutoCAD Release 14
DWG 2000 AC1015 AutoCAD 2000, AutoCAD 2000i, AutoCAD 2002
DWG 2004 AC1018 AutoCAD 2004, AutoCAD 2005, AutoCAD 2006
DWG 2007 AC1021 AutoCAD 2007, AutoCAD 2008, AutoCAD 2009
DWG 2010 AC1024 AutoCAD 2010

CAB:
http://en.wikipedia.org/wiki/AutoCAD_2010
AutoCAD 2010
18.0    <----<<
24
2009, March 24
DWG 2010 file format introduced; introduction of parametrics and two 3D modeling topologies: mesh based and solid modeling

GDF:
Thanks Alan

GDF:
Updated version at startup:


--- Code: ---
(if (/= (getvar "dwgtitled") 0)
      (princ (strcat "\n*** -------- AutoCAD Release " (rtos (GetDwgVersion (getvar "dwgname")) 2 0) " -------- ***"))
    )


--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version