|
|
|
R.K. McSwain | CAD Panacea |
Now that you are trying to modify the acaddoc.lsp file, are you sure that it exists?
After you get the path for acaddoc.lsp, you should check to see if the file exists and if not create it.
matt worland
All you should need to add to acaddoc.lsp is.Code:(load "Wat.lsp")
Matt,
When OPEN is called with "a"(append) the file is created if it doesn't exist.
It should yes, but Program Files\ is locked down on many computers. Testing on my system, it would not create the file using Open "a", that's why its recommended to test if it exists.
After I manually created the file and it found it with the lisp, I was able to append your text. You may need to look for another directory to create the file, then copy it to Program Files\ or just use a different location altogether.
matt worland
R.K. McSwain | CAD Panacea |
no luck
Code:(PRINC) (PROMPT "\n*AUTOLOAD WATSON SETUP* ") (SETQ PGPF NIL) (SETQ PGPLN "(LOAD \"Wat.lsp\")" ) (SETQ PGPFN (FINDFILE "ACAD2020.lsp" )) (IF (/= PGPFN NIL) (PROGN (SETQ PGPFNL (STRLEN PGPFN)) (SETQ PGPFN2 (SUBSTR PGPFN 1 (- PGPFNL 12))) (SETQ PGPFN2 (STRCAT PGPFN2 "ACADDOC.LSP")) (SETQ PGPFN2T (FINDFILE PGPFN2)) (IF (= PGPFN2T NIL) (PROGN (SETQ PGPFN3 (OPEN PGPFN2 "w")) (CLOSE PGPFN3) ));END PRGN IF PGPFN2T (SETQ PGPF (OPEN PGPFN2 "a")) (WRITE-LINE " " PGPF) (WRITE-LINE PGPLN PGPF) (PROMPT "\nWat.lsp added to ") (PRINC PGPFN2) (CLOSE PGPF) ));END PROGN/IF PGPFN
Last edited by aaronic_abacus; 2019-06-18 at 07:26 PM.
Your load wat will not work
try a strcat to create the parts with "
(setq pgpln (strcat "load " (chr 34) "wat.lsp" (chr 34) ))
works fine in 2000, not a coding error
vl huh?
still no luck.
if I can't write to the files how will programs load automatically, i'm just trying to AUTOLOAD a string
Code:(SETQ PGPLN "(vl-load-com) (vl-load-all \"wat.lsp\")" ) (SETQ PGPFN (FINDFILE "ACAD2000.lsp" )) (IF (/= PGPFN NIL) (PROGN (SETQ PGPFNL (STRLEN PGPFN)) (SETQ PGPFN2 (SUBSTR PGPFN 1 (- PGPFNL 12))) (SETQ PGPFN2 (STRCAT PGPFN2 "acad.lsp")) (SETQ PGPFN2T (FINDFILE PGPFN2)) (IF (= PGPFN2T NIL) (PROGN (SETQ PGPFN3 (OPEN PGPFN2 "w")) (CLOSE PGPFN3) ));END PROGN IF PGPFN2T (SETQ PGPF (OPEN PGPFN2 "a")) (WRITE-LINE " " PGPF) (WRITE-LINE PGPLN PGPF) (PROMPT "\nWat.lsp added to ") (PRINC PGPFN2) (CLOSE PGPF) ));END PROGN/IF PGPFN (SETQ PGPFN (FINDFILE "ACAD2020.lsp" )) (IF (/= PGPFN NIL) (PROGN (SETQ PGPFNL (STRLEN PGPFN)) (SETQ PGPFN2 (SUBSTR PGPFN 1 (- PGPFNL 12))) (SETQ PGPFN2 (STRCAT PGPFN2 "acad.lsp")) (SETQ PGPFN2T (FINDFILE PGPFN2)) (IF (= PGPFN2T NIL) (PROGN (SETQ PGPFN3 (OPEN PGPFN2 "w")) (CLOSE PGPFN3) ));END PRGN IF PGPFN2T (SETQ PGPF (OPEN PGPFN2 "a")) (WRITE-LINE " " PGPF) (WRITE-LINE PGPLN PGPF) (PROMPT "\nWat.lsp added to ") (PRINC PGPFN2) (CLOSE PGPF) ));END PROGN/IF PGPFN ;(IF (= PGPFN NIL) (SETQ PGPFN (GETFILED "LOCATE ACAD2000.LSP ACAD2020.LSP FILE" "" "LSP" 2)))
Last edited by aaronic_abacus; 2019-06-20 at 09:01 AM.