;;-------------------------------------------------------------------------- ;; BFE - 12.10.2015 ;-------------------------------------------------------------------------- (in-package :BFE_TOOLS) (use-package '(:OLI )) (sd-defdialog 'bfe-Plot :dialog-title '(sd-multi-lang-string "Plot" :german "Drucken") :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" ) (copies :value-type :number :prompt-text "Anzahl der Kopien auswaehlen" :title "Kopien" :proposals (1 2 3) :auto-add-proposal t :persistent-proposals t :initial-value 1 ) (ausr :value-type :string :title (sd-multi-lang-string "orientation" :german "Ausrichtung") :prompt-text (sd-multi-lang-string "Ausrichtung" :german "Blattausrichtung definieren") :proposals ("hoch" "quer") :initial-value "quer" ) (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 t ) ) ;; 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")) (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A0" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A0" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A0" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A0" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if );end when A0 (when (or(string= blatt "A1") (string= blatt "DINA1")) (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A1" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A1" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A1" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A1" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if );end when A1 (when (or(string= blatt "A2") (string= blatt "DINA2")) (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A2" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A2" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A2" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A2" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if );end when A2 (when (or(string= blatt "A3") (string= blatt "DINA3")) (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A3" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A3" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A3" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A3" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if );end when A3 (when (or(string= blatt "A4") (string= blatt "DINA4")) (if (and (equal einpassen t) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A4" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and (equal einpassen t) (string= ausr "hoch")) (progn (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_drawing :scale :fit :PAPER_FORMAT_RA "A4" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "quer")) (progn (am_plot_ex :PLOT_STYLE :WIN_DEFAULT :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A4" :POSITION :CENTER :ORIENTATION :landscape :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ); end progn (if (and(equal einpassen nil) (string= ausr "hoch")) (am_plot_ex :output_box :output_pick xy-of-ll xy-of-ur :contents_curr_show :scale :fit :PAPER_FORMAT_RA "A4" :POSITION :CENTER :ORIENTATION :portrait :TRANSF_STYLE :STANDARD :COPIES copies :plot ) ;end am_plot_ex ) ;end if ) ;end if ) ;end if ) ;end if );end when A4 );end ok action ) ;; end dialog