How to find the last version file was saved as.

How to find the last version file was saved as.

Anonymous
Not applicable
377 Views
1 Reply
Message 1 of 2

How to find the last version file was saved as.

Anonymous
Not applicable
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
;;;
0 Likes
378 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Looks like that routine is not at fault, has to be some other
routine that is being loaded/called before you run DwgVer.


--

-Jason
Member of the Autodesk Discussion Forum Moderator Program


"cparnell" wrote in message
news:f195b1e.-1@WebX.maYIadrTaRb...
> 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?

> (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))
> )
0 Likes