;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Author: Thomas Kirkman ; Created: 1-7-2008 ; Modified: -- ; Language: LISP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :OI_TOOLS) (use-package :oli) (sd-define-available-command "Annotation" "O-I Commands" "Print_sheets_to_PDF" :action "Print_sheets_to_PDF" :description "Prints individual sheets to individual pdf files" :commandTitle "Print Sheets to PDF" :image "Annotation/O-I_Commands/Print_sheets_to_PDF") (sd-defdialog 'Print_sheets_to_PDF :dialog-title "Sheets -> PDF" :variables '( ("Suffix (for example _A)") (suf :value-type :String :prompt-text "Enter a suffix such as the revision letter" :title "Suffix" :initial-value "") );variables :ok-action '(OI_TOOLS::all-sheets-to-pdf suf)) (defun all-sheets-to-pdf (suf) ;checks for c:\working\out and creates it if it does not exist (unless (sd-directory-p "c:/working") (sd-make-directory "c:/working")) (unless (sd-directory-p "c:/working/out") (sd-make-directory "c:/working/out")) (dolist (a-s (sd-am-inq-all-sheets)) (let ((sheet-num nil)) (setf sheet-num (sd-am-sheet-struct-name (sd-am-inq-sheet a-s))) (setf dwgnm (format nil "~A" (subseq (docu::docu_inq_drawing_number_text) 0 (search "-DWG" (docu::docu_inq_drawing_number_text))))) ;;increment to the next sheet (am_current_sheet sheet-num) ;; display the name of the files created (display (format nil "~A~A~A_~A~A.pdf~A" "\"" "c:/working/out/" dwgnm sheet-num suf "\"")) ;;plot the pdf files (am_plot_ex :PLOT_STYLE :PDF_-_SINGLE_PAGE :DESTINATION (format nil "~A~A_~A~A.pdf" "c:/working/out/" dwgnm sheet-num suf) :done :plot) );let );dolist )