;;------------------------------------------------------------------------------------- ;; gdm_anno_dim_copy.lsp ;; os / 30.01.2018 ;; die gewwählte Bemassung wird ausgelesen und je nach Auswahl in den Prefix oder Postfix geschrieben. ;; Der Text im Postfix und Prefix wird durchgestrichen dargestell . (durch den Schriftfont hp_i3098_c_durchgestrichen ) ;; Bestehende Texte im Prefix und Postfix werden überschrieben ;; Option zum Löschen von Pre- u. Postfix hinzugefügt ;; Auswahl des Fix automatisch ermitteln hinzugefügt ;;------------------------------------------------------------------------------------- (in-package :GDM) (use-package :OLI) (sd-defdialog 'gdm-dim-copy-dialog :dialog-title (sd-multi-lang-string "DIM Copy" :german "Bem Kopie") :toolbox-button t :variables '( (DIM_INDEX :title (sd-multi-lang-string "Index" :german "Index") :value-type :positive-number :initial-value 1) (DIM_SEL :selection (*sd-anno-dimension-seltype*) :title (sd-multi-lang-string "Dimension" :german "Bemassung") :toggle-type :invisible :prompt-text (sd-multi-lang-string "Pick Dimension." :german "Wähle Bemassung.") :after-input (os-am-dim-copy) :next-variable 'DIM_SEL) (DEL_FIX :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Del Fix Texts" :german "Fix Text löschen") :initial-value nil) );;variables :local-functions '( (os-am-dim-copy () (let (DIM_OLD INDEX input TEXT_POSTFIX) ;; set index to superfix (setf INDEX (format nil "(~a)" DIM_INDEX)) (if DEL_FIX (sd-call-cmds (AM_DIM_PROPS :dim_list DIM_SEL :dim_postfix "" :dim_prefix "")) (progn (cond ((and (= (- (gpnt2d_y (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_y (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) 0) (> (gpnt2d_x (sd-am-inq-dim-text-cen-pnt DIM_SEL)) (gpnt2d_x (sd-am-inq-dim-extline1-end-pnt DIM_SEL)))) (setq TEXT_POSTFIX t) ) ((and (= (- (gpnt2d_y (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_y (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) 0) (< (gpnt2d_x (sd-am-inq-dim-text-cen-pnt DIM_SEL)) (gpnt2d_x (sd-am-inq-dim-extline1-end-pnt DIM_SEL)))) (setq TEXT_POSTFIX nil) ) ((and (= (- (gpnt2d_x (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_x (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) 0) (> (gpnt2d_y (sd-am-inq-dim-text-cen-pnt DIM_SEL)) (gpnt2d_y (sd-am-inq-dim-extline1-end-pnt DIM_SEL)))) (setq TEXT_POSTFIX t) ) ((and (= (- (gpnt2d_x (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_x (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) 0) (< (gpnt2d_y (sd-am-inq-dim-text-cen-pnt DIM_SEL)) (gpnt2d_y (sd-am-inq-dim-extline1-end-pnt DIM_SEL)))) (setq TEXT_POSTFIX nil) ) (t (setf input (sd-display-warning (format nil "Bitte Position des Maß angeben") :title "Fix" :push-1 "Prefix" :push-2 "Postfix" :severity :low)) (if (eql input :yes) (setf TEXT_POSTFIX nil) (setf TEXT_POSTFIX t)) ) ) ;end cond (if TEXT_POSTFIX (progn ;; copy Bem. to postfix (setf DIM_OLD (format nil " ~a" (sd-am-inq-dim-main-value-text DIM_SEL))) (sd-call-cmds (AM_DIM_PROPS :dim_list DIM_SEL :dim_postfix DIM_OLD :page :text_props :TEXT_SCOPE :POSTFIX :line_color_setting :off :TEXT_COLOR 65280 :done :TEXT_REL_SIZE 1 :TEXT_FONT_1B "hp_i3098_c_durchgestrichen")) (sd-call-cmds (AM_DIM_PROPS :dim_list DIM_SEL :dim_prefix INDEX :page :text_props :TEXT_SCOPE :PREFIX :line_color_setting :off :TEXT_COLOR 65280 :done :TEXT_REL_SIZE 0.7)) ) (progn ;; copy Bem. to prefix (setf DIM_OLD (format nil "~a " (sd-am-inq-dim-main-value-text DIM_SEL))) (sd-call-cmds (AM_DIM_PROPS :dim_list DIM_SEL :dim_prefix DIM_OLD :page :text_props :TEXT_SCOPE :PREFIX :line_color_setting :off :TEXT_COLOR 65280 :done :TEXT_REL_SIZE 1 :TEXT_FONT_1B "hp_i3098_c_durchgestrichen")) (sd-call-cmds (AM_DIM_PROPS :dim_list DIM_SEL :dim_postfix INDEX :page :text_props :TEXT_SCOPE :POSTFIX :line_color_setting :off :TEXT_COLOR 65280 :done :TEXT_REL_SIZE 0.7)) ) ) ) ) ) ) ) :prompt-variable 'DIM_SEL :ok-action '(cancel) );; sd-defdialog