Visual Basic Customization

Visual Basic Customization

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

Drawing Format Variable?

40 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 (40 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

Gary

; 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 "")
(cond
((null (findfile dwgname)) "Cannot find Drawing")
((null (setq fp (open dwgname "r"))) "Cannot read Drawing")
(T
(repeat 6
(setq ch (read-char fp))
(setq version (strcat version (chr ch)))
)
(close fp)
(cdr (assoc version version_list))
)
)
)
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.