;;------------------------------------------------------------------------------------- ;; for CoCreate OneSpace Designer ;; ;; Author : PeterO@forum@cad.de ;; Filename : gdm_anno_dim_copy.lsp ;; os / 30.01.2018 ;; Description: ;; 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 ;; ;; Issue : http://ww3.cad.de/foren/ubb/Forum29/HTML/004645.shtml ;; ;; Change : MiBr@forum@cad.de ;; Date : 02. Feb. 2018 ;; Auswahl des Fix automatisch ermitteln hinzugefügt ;; ;; Change : der_Wolfgang@forum@cad.de ;; Date : 03. Feb. 2018 ;; more localization, usage of sd-num-equal-p, proposals added ;;------------------------------------------------------------------------------------- (in-package :GDM) (use-package :OLI) (sd-defdialog 'gdm-dim-copy-dialog :dialog-title '(sd-multi-lang-string "DIM Copy" :german "Bem Kopie") :persistent-proposals t ;; keep user entered value of proposals across osdm sessions :toolbox-button t :variables '( (DIM_INDEX :title (sd-multi-lang-string "Index" :german "Index") :value-type :positive-number :proposals '(1 2 3 4 5 6 7 8) :auto-add-proposal t :proposals-order :sorted :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 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 (sd-num-equal-p (gpnt2d_y (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_y (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) (> (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 (sd-num-equal-p (gpnt2d_y (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_y (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) (< (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 (sd-num-equal-p (gpnt2d_x (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_x (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) (> (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 (sd-num-equal-p (gpnt2d_x (sd-am-inq-dim-extline1-begin-pnt DIM_SEL)) (gpnt2d_x (sd-am-inq-dim-extline1-end-pnt DIM_SEL))) (< (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 (let ((user-answer (sd-display-warning (sd-multi-lang-string "Specify Position for old dim" :german "Bitte Position des Maß angeben") :title "Fix" :push-1 "Prefix" :push-2 "Postfix" :severity :low))) (if (eql user-answer :yes) (setf TEXT_POSTFIX nil) (setf TEXT_POSTFIX t)) ) ; end let ) ) ;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