Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro for 8x11 PDF quick plot button

4 REPLIES 4
Reply
Message 1 of 5
mail
623 Views, 4 Replies

Macro for 8x11 PDF quick plot button

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

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: mail

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

EESignature

Message 3 of 5
hmsilva
in reply to: mail

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

EESignature

Message 4 of 5
mail
in reply to: mail

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

Message 5 of 5
hmsilva
in reply to: mail

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

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost