02-02-2016
06:25 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
02-02-2016
06:25 AM
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
Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.
Maxim Kanaev
Architect
MARSS
Etiquette and Ground Rules of Autodesk Community