highrez2 Posted April 14, 2020 Posted April 14, 2020 Not sure what i have been missing here. But finally decided to do something about our custom code. The lisp looks for a file and if present on system proceeds to step 2. Step 2 it checks for match with path. this is where i get confused.. I thought a (princ) close's the file clean (no loose ends) however the settings are there (in the options) but not applied. what am I missing? I have looked for some way to apply settings under the options dialog but no success. (Setvar "cmdecho" 0) (if (= "24.0s (LMS Tech)" (getvar "ACADVER")) (progn (if (not (wcmatch (getenv "PrinterConfigDir") "*path*")) ;Looking for Printer Configuration Search Path (setenv "PrinterConfigDir" "path") ;If not found add Printer Configuration Search Path ) (if (not (wcmatch (getenv "PrinterDescDir") "*path*")) (setenv "PrinterDescDir" "path") ;If not found add Printer Description Search Path ) (if (not (wcmatch (getenv "PrinterStyleSheetDir") "*path*")) ;Looking for Path in Plot Style Table Search Path (setenv "PrinterStyleSheetDir" "path;") ;If not found add Plot Style Table Search Path ) ) ) ;(alert "message") (Setvar "cmdecho" 1) (princ) Quote
ronjonp Posted April 14, 2020 Posted April 14, 2020 (edited) Hopefully it does not work as this: (setenv "PrinterConfigDir" "path") (setenv "PrinterDescDir" "path") (setenv "PrinterStyleSheetDir" "path;") Is not setting the directory to an actual path. "PATH" most likely needs to be PATH .. post more of your code. Edited April 14, 2020 by ronjonp Quote
highrez2 Posted April 14, 2020 Author Posted April 14, 2020 If i remove the ; after path everything seams to work now. I was using the Quotes due to spacing in the path name. Quote
BIGAL Posted April 15, 2020 Posted April 15, 2020 Spacing in the path name (setq path "x:\\my tempwork\\is here now\\not over there") Quote
ronjonp Posted April 15, 2020 Posted April 15, 2020 (edited) 18 hours ago, highrez2 said: If i remove the ; after path everything seams to work now. I was using the Quotes due to spacing in the path name. I don't understand how that code can work PATH /= "PATH". Graphic to help you understand: Edited April 15, 2020 by ronjonp 2 Quote
highrez2 Posted April 15, 2020 Author Posted April 15, 2020 ;;; Comments list Ver1.0 10-07-15 Inital update (Setvar "cmdecho" 0) (if (= "24.0s (LMS Tech)" (getvar "ACADVER")) (progn (if (not (wcmatch (getenv "PrinterConfigDir") "*K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotters*")) ;Looking for Printer Configuration Search Path (setenv "PrinterConfigDir" "K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotters") ;If not found add Printer Configuration Search Path ) (if (not (wcmatch (getenv "PrinterDescDir") "*K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_PMP*")) (setenv "PrinterDescDir" "K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_PMP") ;If not found add Printer Description Search Path ) (if (not (wcmatch (getenv "PrinterStyleSheetDir") "*K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotstyles*")) ;Looking for Path in Plot Style Table Search Path (setenv "PrinterStyleSheetDir" "K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotstyles") ;If not found add Plot Style Table Search Path ) ) ) (Setvar "cmdecho" 1) (princ) This should help Quote
ronjonp Posted April 15, 2020 Posted April 15, 2020 (edited) 1 hour ago, highrez2 said: ;;; Comments list Ver1.0 10-07-15 Inital update (Setvar "cmdecho" 0) (if (= "24.0s (LMS Tech)" (getvar "ACADVER")) (progn (if (not (wcmatch (getenv "PrinterConfigDir") "*K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotters*")) ;Looking for Printer Configuration Search Path (setenv "PrinterConfigDir" "K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotters") ;If not found add Printer Configuration Search Path ) (if (not (wcmatch (getenv "PrinterDescDir") "*K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_PMP*")) (setenv "PrinterDescDir" "K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_PMP") ;If not found add Printer Description Search Path ) (if (not (wcmatch (getenv "PrinterStyleSheetDir") "*K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotstyles*")) ;Looking for Path in Plot Style Table Search Path (setenv "PrinterStyleSheetDir" "K:\\Masters\\LOOK HERE\\Another FOLDER\\Company_Plotstyles") ;If not found add Plot Style Table Search Path ) ) ) (Setvar "cmdecho" 1) (princ) This should help Be careful when checking with WCMATCH .. it is case sensitive .. here's another approach using FOREACH .. not tested. ;;; Comments list Ver1.0 10-07-15 Inital update ;; cmedecho not needed for this code ;; (setvar "cmdecho" 0) ;; Set common path (setq path "K:\\Masters\\LOOK HERE\\Another FOLDER\\") (if (= "24.0s (LMS Tech)" (getvar "ACADVER")) (foreach dir '(("PrinterConfigDir" "Company_Plotters") (("PrinterDescDir" "Company_PMP")) (("PrinterStyleSheetDir" "Company_Plotstyles")) ) ;; Added strcase for the wcmatch check (or (wcmatch (strcase (getenv (car dir))) (strcat "*" (setq a (strcase (strcat path (cadr dir)))) "*") ) ;; Beware this will remove any other paths set .. this what you want? (setenv (car dir) a) ) ) (progn) ) ;; (setvar "cmdecho" 1) (princ) Edited April 15, 2020 by ronjonp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.