Message 1 of 2
How to find the last version file was saved as.

Not applicable
10-22-2003
09:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In AutoDESK Knowledge base(ID: TS66820) Determine the version a drawing is using Visual LISP/AutoLISP
It gives the following LISP routine, however I can not get to work. I have it loaded in my Support folder, (like nine levels down in A2K4), I have (load "dwgver")in my acad.lsp. However when I am in A2K4 and try typing "dwgver" I get
Command: dwgver
; error: An error has occurred inside the *error* functionAutoCAD variable
setting rejected: "osmode" nil
Does any one know how to correct this?
Thanks for any help.
;;;;
;;;;Beginning of the AutoLISP routine
;;;
(prompt "\nType in DWGVER to run this routine")
(defun C:DWGVER (/ dwgfile rfile dwgver acadv)
(setq dwgfile (strcat (getvar "dwgprefix")(getvar "dwgname")))
(setq rfile (open dwgfile "r"))
(setq dwgver (substr (read-line rfile) 1 6))
(close rfile)
(cond
((= dwgver "AC1015")
(setq acadv "AutoCAD 2000, 2000i or 2002")
)
((= dwgver "AC1014")
(setq acadv "AutoCAD R14")
)
((= dwgver "AC1012")
(setq acadv "AutoCAD R13")
)
((= dwgver "AC1009")
(setq acadv "AutoCAD R11 or R12")
)
((= dwgver "AC1006")
(setq acadv "AutoCAD R10")
)
((= dwgver "AC1004")
(setq acadv "AutoCAD R9")
)
((= dwgver "AC1002")
(setq acadv "AutoCAD R2.6")
)
((= dwgver "AC1.50")
(setq acadv "AutoCAD R2.05")
)
)
(alert (strcat "The current drawing was created in " acadv))
)
;;;;
;;;;End of the AutoLISP routine
;;;
It gives the following LISP routine, however I can not get to work. I have it loaded in my Support folder, (like nine levels down in A2K4), I have (load "dwgver")in my acad.lsp. However when I am in A2K4 and try typing "dwgver" I get
Command: dwgver
; error: An error has occurred inside the *error* functionAutoCAD variable
setting rejected: "osmode" nil
Does any one know how to correct this?
Thanks for any help.
;;;;
;;;;Beginning of the AutoLISP routine
;;;
(prompt "\nType in DWGVER to run this routine")
(defun C:DWGVER (/ dwgfile rfile dwgver acadv)
(setq dwgfile (strcat (getvar "dwgprefix")(getvar "dwgname")))
(setq rfile (open dwgfile "r"))
(setq dwgver (substr (read-line rfile) 1 6))
(close rfile)
(cond
((= dwgver "AC1015")
(setq acadv "AutoCAD 2000, 2000i or 2002")
)
((= dwgver "AC1014")
(setq acadv "AutoCAD R14")
)
((= dwgver "AC1012")
(setq acadv "AutoCAD R13")
)
((= dwgver "AC1009")
(setq acadv "AutoCAD R11 or R12")
)
((= dwgver "AC1006")
(setq acadv "AutoCAD R10")
)
((= dwgver "AC1004")
(setq acadv "AutoCAD R9")
)
((= dwgver "AC1002")
(setq acadv "AutoCAD R2.6")
)
((= dwgver "AC1.50")
(setq acadv "AutoCAD R2.05")
)
)
(alert (strcat "The current drawing was created in " acadv))
)
;;;;
;;;;End of the AutoLISP routine
;;;