;;-------------------------------------------------------------------------- ;; BFE - 12.10.2015 ;-------------------------------------------------------------------------- (in-package :BFE_TOOLS) (use-package '(:OLI )) (sd-defdialog 'bfe-Plot :dialog-title '(sd-multi-lang-string "PDF" :german "PDF erstellen") :after-initialization '(Kasten-definieren) :variables '( (blatt :value-type :string :prompt-text "Blattformat auswählen" :title "Blattformat" :proposals ("Automatisch" "A0" "A1" "A2" "A3" "A4") :auto-add-proposal nil :persistent-proposals t :initial-value "Automatisch" ) (ausr :value-type :string :title (sd-multi-lang-string "orientation" :german "Ausrichtung") :prompt-text (sd-multi-lang-string "Ausrichtung" :german "Blattausrichtung definieren") :proposals ("Automatisch" "hoch" "quer") :initial-value "Automatisch" ) (einpassen :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "fit" :german "Einpassen") :prompt-text (sd-multi-lang-string "Einpassen" :german "Zeichnung automatisch einpassen") :initial-value nil ) ) ;; end variables :local-functions '( (rahmen-identifizieren () (when (string= blatt "Automatisch") (defun get-frame-name () (let ((sht-struct (oli:sd-am-inq-sheet (oli:sd-am-inq-curr-sheet)))) (oli:sd-am-inq-name (sd-am-sheet-struct-frame sht-struct)))) (setf blatt (get-frame-name)) ;; (display blatt) ) ) (Kasten-definieren () (let (x-of-ll y-of-ll x-of-ur y-of-ur) (progn (setq part-id (sd-am-inq-unique-name (sd-am-sheet-struct-frame (sd-am-inq-sheet (sd-am-inq-curr-sheet))))) (setq x-of-ll (sd-read-from-string (car (getf (oli::sd-execute-annotator-function :fnc (format nil "Docu_get_part_box '~A'" part-id)) :LL)))) (setq y-of-ll (sd-read-from-string(cadr (getf (oli::sd-execute-annotator-function :fnc (format nil "Docu_get_part_box '~A'" part-id)) :LL)))) (setq x-of-ur (sd-read-from-string(car (getf (oli::sd-execute-annotator-function :fnc (format nil "Docu_get_part_box '~A'" part-id)) :ur)))) (setq y-of-ur (sd-read-from-string(cadr (getf (oli::sd-execute-annotator-function :fnc (format nil "Docu_get_part_box '~A'" part-id)) :ur)))) (setq xy-of-ll (make-gpnt2d :x x-of-ll :y y-of-ll)) (setq xy-of-ur (make-gpnt2d :x x-of-ur :y y-of-ur)) ) ) ) ) :ok-action '(let () (rahmen-identifizieren) (when (or(string= blatt "A0") (string= blatt "DINA0") (string= blatt ".sfeld_rahmen_A0")) (if (and (equal einpassen t) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a0 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen nil) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a0 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a0 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :Plot_style :pdf_a0 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a0 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :Plot_style :pdf_a0 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if );end when A0 (when (or(string= blatt "A1") (string= blatt "DINA1") (string= blatt ".sfeld_rahmen_A1")) (if (and (equal einpassen t) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a1 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen nil) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a1 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a1 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :Plot_style :pdf_a1 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a1 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :Plot_style :pdf_a1 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if );end when A1 (when (or(string= blatt "A2") (string= blatt "DINA2") (string= blatt ".sfeld_rahmen_A2")) (if (and (equal einpassen t) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a2 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen nil) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a2 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a2 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :Plot_style :pdf_a2 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a2 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :Plot_style :pdf_a2 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if );end when A2 (when (or(string= blatt "A3") (string= blatt "DINA3") (string= blatt ".sfeld_rahmen_A3")) (if (and (equal einpassen t) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a3 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen nil) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a3 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a3 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex );end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :Plot_style :pdf_a3 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex );end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a3 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :Plot_style :pdf_a3 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if );end when A3 (when (or(string= blatt "A4") (string= blatt "DINA4") (string= blatt ".sfeld_rahmen_A4")) (if (and (equal einpassen t) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a4 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen nil) (string= ausr "Automatisch")) (progn (am_plot_ex :Plot_style :pdf_a4 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a4 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :Plot_style :pdf_a4 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :fit :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :Plot_style :pdf_a4 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :landscape :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ; end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :Plot_style :pdf_a4 :output_drawing :destination "C:\\temp\\plot.pdf" :scale :factor :value 1 :ORIENTATION :portrait :POSITION :CENTER :plot :yes ) (oli:sd-display-url "C:\\TEMP\\plot.pdf"); open PDF ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if ) ;end if );end when A4 );end ok action ) ;; end dialog