I gave these commands while in an autocad session
with the following results:
Command: undefine
Enter command name: open
Command: open
Unknown command "OPEN". Press F1 for help.
Command: .open
[Here, the regular open command ran, and I could have selected a dwg to open]
Command: (load "open")
C:OPEN
[I have listed my "open.lsp" below]
Command: open
.OPEN ;the open command did not accually run here
Command: Description of work, or hit enter to cancel:
Canceled
(defun C:OPEN ( / path dname usrname time note dv fil pdname cmdsave)
(command ".OPEN")
(setq note (getstring T "Description of work, or hit enter to cancel: "))
(if (= 0 (strlen note)) (princ "Canceled")
(progn
(setq dname (menucmd "M=$(getvar, dwgname)"))
(setq path (menucmd "M=$(getvar, dwgprefix)"))
(setq pdname (strcat path dname))
(setq dv "________________________________________________________________________________")
(setq fil (open "Journal.txt" "a"))
(write-line dv fil)
(write-line (menucmd "M=$(getvar, loginname)") fil)
(write-line (menucmd "M=$(edtime,$(getvar,date),DDDD\",\" D MONTH YYYY)") fil)
(write-line pdname fil)
(write-line note fil)
(close fil)))
(princ)
)
As you can see, I am trying to design a method to automatically enter information into a loging system.....
any feedback would be usefull.[/b]