hmsilva Has helped me get a auto PDF generator to work in windows. The lisp replaces the qsave command and when you type qsave, it auto generates to a specific location and works really good. I wanted to try on the MAC. You can see whole convo here.
More specifically he stared helping on the MAC but he is not a mac user. That convo starts here.
I am pretty sure it can be come but need some assistance and hopefully someone can help out.
Basically I want to see I can create a PDF completely from the command line and use in the aucaddoc.lsp which I have confirmed loads and works.
Solved! Go to Solution.
Solved by maxim_k. Go to Solution.
OK, here it is:
This version works without redefinig QSAVE command - after loading yoiu will get ne command QS:
(defun c:qs (/ *error* echo pdf_file lst mutt) (defun *error* (msg) (if mutt (setvar 'nomutt mutt) ) (if echo (setvar 'cmdecho echo) ) (cond ((not msg)) ((member msg '("Function cancelled" "quit / exit abort"))) ((princ (strcat "\n** Error: " msg " ** "))) ) (princ) ) (setq mutt (getvar 'nomutt) echo (getvar 'cmdecho)) (setvar 'cmdecho 0) (setvar 'nomutt 1) (setq pdf_file (strcat (getvar "dwgprefix") (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4)))) (setq lst (dictsearch (namedobjdict) "acad_layout")) (setq lst (dictsearch (cdar lst) (getvar "ctab"))) (if (or (eq (cdr (assoc 2 lst)) "none_device") (eq (cdr (assoc 2 lst)) "None")) (command "_plot" "_N" "" "" "" pdf_file "_N" "_Y") (command "_plot" "_N" "" "" "" "_Y" pdf_file "_N" "_Y") ) (command "_.qsave") (*error* nil) (princ) )
after executing QS you will get PDF file with the same name as your drawing file in the same folder where this DWG is. Plus current DWG will be saved with QSAVE command.
You can use this routine with or without editing Page Setup in Page Setup manager.
If the drawing was previously saved after printing in Windows version of AutoCAD or Page Setups in it were edited on another Mac, you need to edit Page setup for all Layouts in the drawing to avoid errors in PDF output.
Maxim
I had a few mintues to test. It appears to work but the command is asking questions each time
Printer Name - have to manually enter (defauly is always the OKI)
Plot to file - Y
Create plot file screen comes up - click save. (it then creates)
Then asked to save changes to page setup. click N is default (accept)
Proceed to plot (say No)
Command over.
Basically it works, but I have to manually enter the above responses. Typing export and hitting enter is much much quicker.
Here is command line screenshot:
I did read your bold text and was looking for errors - I was not considering what I meantioned as an error. I will play around with. I have over 3k drawings and some have various setups etc.
Thank you so much for the time you put into this and I hope it helps someone else as well.
99% of my prints are printed on 8.5x11. The only differnce in that is it may differ between landscape and portrait.
Absolutely, - you are helping me. It can wait until next week if needed. I just dont want to keep getting Autodesk emails asking if this is resolved.
I am not sure I am following so bare with me. Almost 90% of my drawings can be batch plotted as the layout is already predifend. So in any of the drawings, when opened, you can export to PDF and it works, without doing anything.
If I understatnd you, you are saying that everytime your command begins, it has to get the window coordinates again, then it may not be worth continuing.
Currnently I do everything in Windows, however I like the smoothness of how MAC version runs (clean, nice pan etc etc) and would like to start using this. RIght now I have about 3k in drawings that co-workers do not need to interact with, just open, PDF it and send with quotes etc. So the idea was to remove them from having to use a DWG Viewer and the plot process. I have all the drawings created to PDF, so from this point fwd, everytime I save it prints it PDF so the PDF's they see are updated without me having to remember to PDF it.
So If my second paragraph is true, then there is probably no need to move forward as I could just keep using WIN version and the save command you did for me there.
I have attached a DWG that contains the LAYOUT that I have in probably 75% of all the drawings. In case you would need to understand.
Can't find what you're looking for? Ask the community or share your knowledge.