I have the following macro for a quick PDF. This works the first time you use the button, however, it does not work multiple times. The new PDF won't override the previous one saved and cancels the command. I would ideally like for a diaglouge box with a save prompt to appear, but I am unsure of how to do this. Feedback would be greatly appreciated. This is a very handy macro.
Thanks!
^C^C-PLOT;Y;;DWG TO PDF.PC3;ANSI A (8.50 X 11.00 INCHES);I;P;N;W;\\;C;Y;CLIENT.CTB;Y;;;;;^C^C
mail, try
^C^C-PLOT;Y;;DWG TO PDF.PC3;ANSI A (8.50 X 11.00 INCHES);I;P;N;W;\\;C;Y;CLIENT.CTB;Y;;;Y;;;^C^C
if the file does not exist, the macro will recalls the command, but then cancels it.
Henrique
mail,
after testing my solution I found that the "Y" when there is no pdf, will save changes to page setup...
I think is a better approach that you save this code as plt.lsp
(defun c:PLT(/ fl)
(setq fl (strcat (getvar "dwgprefix") (getvar "dwgname")))
(setq fl (strcat (vl-string-right-trim ".dwg" fl) "-" (getvar "ctab") ".pdf"))
(if (findfile fl)
(command "-PLOT" "Y" "" "DWG TO PDF.PC3" "ANSI A (8.50 X 11.00 INCHES)" "I" "P" "N"
"W" pause pause "" "C" "Y" "CLIENT.CTB" "Y" "" "" "Y" "" "")
(command "-PLOT" "Y" "" "DWG TO PDF.PC3" "ANSI A (8.50 X 11.00 INCHES)" "I" "P" "N"
"W" pause pause "" "C" "Y" "CLIENT.CTB" "Y" "" "" "" "")
);if
(princ)
)
and use this macro in the button
^C^C(if (not c:plt) (load "C:/mylisp/plt"));plt
change C:/mylisp/ to your path.
Henrique
Henrique,
I really appreciate your help. I loaded the lisp and macro and changed the path, however, I get this message:
Command: (if (not c:plt) (load "F:
Is there something else I need to change? Thanks
mail,
to write the way do not forget that you can only use / or \ \ if you use a single \ does not work.
See if your path is well written and see the attached file.
Henrique