Visual Basic Customization

Visual Basic Customization

*BFA, Nick Fuller
Message 1 of 2 (42 Views)

Drawing Format Variable?

42 Views, 1 Replies
07-14-2003 09:14 PM
Is there a "getvar" argument I can use to return the version of AutoCAD that
the drawing in question is saved in?
*McMaster, Gary
Message 2 of 2 (42 Views)

Re: Drawing Format Variable?

07-14-2003 10:12 PM in reply to: *BFA, Nick Fuller
No. There is no system vaiable that stores the version.

The lisp below will return the version. This snip was posted in the lisp
group. I don't remember who the author is.

In VBA you can also open the file and read in the first six characters and
make similar comparisons to those below


; Sample call, next line
;(acadver "C:/8020 Drawing Files/2D DWG/2089-2d.dwg")

(defun acadver (dwgname / version_list version ch fp)
(setq version_list '(
("MC0.0 " . "1.1")
("AC1.2 " . "1.2")
("AC1.4 " . "1.4")
("AC1.50" . "2.0")
("AC2.10" . "2.10")
("AC2.20" . "Internal version 2.20")
("AC2.21" . "Internal version 2.21")
("AC2.22" . "Internal version 2.22")
("AC1001" . "Internal version pre-2.5")
("AC1002" . "2.5")
("AC1003" . "2.6")
("AC1004" . "R9")
("AC1005" . "Internal pre-R10")
("AC1006" . "R10")
("AC1007" . "Internal pre-release R11")
("AC1008" . "Internal pre-release R11")
("AC1009" . "R11/12")
("AC1010" . "Early internal R13")
("AC1011" . "Late internal R13")
("AC1012" . "R13")
("AC1013" . "R14 Pre-Release")
("AC1014" . "R14.0, 14.01")
("AC1500" . "2000 Pre-Release")
("AC1015" . "2000/2000i/2002")
(setq version "")
((null (findfile dwgname)) "Cannot find Drawing")
((null (setq fp (open dwgname "r"))) "Cannot read Drawing")
(repeat 6
(setq ch (read-char fp))
(setq version (strcat version (chr ch)))
(close fp)
(cdr (assoc version version_list))
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.