#| Beschreibung: Tool zum erstellen der Oberflächen Sammelangaben Version: 2.1 Datum: 17.11.2014 Ersteller: Marc J. |# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ä Ì Ä Ø ö Î Ö Ú ü Ï Ü Û ß Þ ; 65280 Grün 16776960 Gelb 16777215 Weiss 16711680 Rot 255 Blau ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :custom) (use-package :oli) ;;----------------------------------Variablen------------------------------------------------* (setf pos_o1_offset -46.1) (setf pos_o2_offset -46.1) (setf pos_o3_offset -46.1) (setf pos_o4_offset -46.1) (setf pos_o5_offset -46.1) (setf pos_o6_offset -58.1) (setf pos_klauf_offset -41.1) (setf pos_klzu_offset -38.1) (setf pos_allg_offset -35) (setf offset_y_links 2) (setf offset_y_oben 30) (setf offset_x_links -34) (setf oberfl_1_merker "x") (setf oberfl_2_merker nil) (setf oberfl_3_merker nil) (setf oberfl_4_merker nil) (setf oberfl_5_merker nil) (setf oberfl_6_merker nil) (setf sketch1 "Zusatzangaben") (setf kant1 t) (setf kant1_innen_ut_pre "+0,1") (setf kant1_innen_ot_pre "+0,5") (setf kant1_aussen_ut_pre "-0,1") (setf kant1_aussen_ot_pre "-0,5") (setf pos_kanten1_x_offset -48) (setf pos_kanten1_single_x_offset -25) (setf txt_beschr_pre1 "WerkstÏck mit Zeichnungs- & Indexnummer und ") (setf txt_beschr_pre2 "Teile- & Indexnummer (sofern vorhanden) beschriften.") (setf pos_txt_x_offset -5) (setf pos_txt_single_x_offset -10) (setf pos_txt_double_x_offset -20) ;(defvar *pfad*) ;(setq *pfad* (format nil "~A/symbole/_LSP" *is-cur-stylepath*)) ;(setf pfad (format nil "~A/symbole/_LSP" *is-cur-stylepath*)) (setf pfad "C:/temp") (sd-defdialog 'am_oberfl :dialog-title "Zusatzangaben" :toolbox-button t :variables '( (ppnt :value-type :docupntcnp :prompt-text "Bezugspunkt fÏr Allgemeines OberflÌchensymbol angeben" :title "Position" ) ("OberflÌchenangaben") (pos_links :value-type :boolean :title "A3+" :toggle-type :grouped-toggle :initial-value t :after-input (progn (setf pos_links t) (setf pos_oben nil) ) ) (pos_oben :value-type :boolean :title "A4" :toggle-type :grouped-toggle :initial-value nil :after-input (progn (setf pos_oben t) (setf pos_links nil) ) ) (oberfl_1 :range (("roh")("w")("x")("y")("z")) :title "standardoberfl." :initial-value oberfl_1_merker :after-input (progn (setf oberfl_2 nil) (setf oberfl_3 nil) (setf oberfl_4 nil) (setf oberfl_5 nil) (setf oberfl_6 nil) ) ) (oberfl_zusatz :title "weitere Angaben" :toggle-type :wide-toggle :push-action (progn (sd-set-variable-status 'oberfl_2 :visible t) (sd-set-variable-status 'oberfl_3 :visible t) (sd-set-variable-status 'oberfl_4 :visible t) (sd-set-variable-status 'oberfl_5 :visible t) (sd-set-variable-status 'oberfl_6 :visible t) (sd-set-variable-status 'oberfl_zusatz :visible nil) ) ) (oberfl_2 :value-type :boolean :title "x" :toggle-type :grouped-toggle :size :third :initial-value oberfl_2_merker :initial-visible nil :after-input (progn (if (equal oberfl_1 "x") (setf oberfl_2 nil)) ) ) (oberfl_3 :value-type :boolean :title "y" :toggle-type :grouped-toggle :size :third :initial-value oberfl_3_merker :initial-visible nil :after-input (progn (if (equal oberfl_1 "y") (setf oberfl_3 nil)) ) ) (oberfl_4 :value-type :boolean :title "w" :toggle-type :grouped-toggle :size :third :initial-value oberfl_4_merker :initial-visible nil :after-input (progn (if (equal oberfl_1 "w") (setf oberfl_4 nil)) ) ) (oberfl_5 :value-type :boolean :title "z" :toggle-type :grouped-toggle :size :third :initial-value oberfl_5_merker :initial-visible nil :after-input (progn (if (equal oberfl_1 "z") (setf oberfl_5 nil)) ) ) (oberfl_6 :value-type :boolean :title "roh" :toggle-type :grouped-toggle :size :third :initial-value oberfl_6_merker :initial-visible nil :after-input (progn (if (equal oberfl_1 "roh") (setf oberfl_6 nil)) ) ) ("Kantensymbole") (kanten_1 :value-type :boolean :title "Kantensymbole setzen" :toggle-type :wide-toggle :initial-value kant1 :after-input (progn (if (equal kanten_1 t) (progn (setf kant1_innen t) (setf kant1_aussen t) (sd-set-variable-status 'kant_1_zusatz :enable t) ) (progn (setf kant1_innen nil) (setf kant1_aussen nil) (sd-set-variable-status 'kant1_innen :visible nil) (sd-set-variable-status 'kant1_innen_ut :visible nil) (sd-set-variable-status 'kant1_innen_ot :visible nil) (sd-set-variable-status 'kant1_aussen :visible nil) (sd-set-variable-status 'kant1_aussen_ut :visible nil) (sd-set-variable-status 'kant1_aussen_ot :visible nil) (sd-set-variable-status 'kant_1_zusatz :visible t) (sd-set-variable-status 'kant_1_zusatz :enable nil) ) ) ) ) (kant_1_zusatz :title "Angaben editieren" :toggle-type :wide-toggle :initial-enable t :push-action (if (equal kanten_1 t) (progn (sd-set-variable-status 'kant1_innen :visible t) (sd-set-variable-status 'kant1_innen_ut :visible t) (sd-set-variable-status 'kant1_innen_ot :visible t) (sd-set-variable-status 'kant1_aussen :visible t) (sd-set-variable-status 'kant1_aussen_ut :visible t) (sd-set-variable-status 'kant1_aussen_ot :visible t) (sd-set-variable-status 'kant_1_zusatz :visible nil) (sd-set-variable-status 'kant1_innen_ut :enable t) (sd-set-variable-status 'kant1_innen_ot :enable t) (sd-set-variable-status 'kant1_aussen_ut :enable t) (sd-set-variable-status 'kant1_aussen_ot :enable t) ) ) ) (kant1_innen :value-type :boolean :title "Kantensymbol innen" :toggle-type :wide-toggle :initial-value t :initial-visible nil :after-input (progn (if (equal kant1_innen nil) (progn (sd-set-variable-status 'kant1_innen_ut :enable nil) (sd-set-variable-status 'kant1_innen_ot :enable nil)) (progn (sd-set-variable-status 'kant1_innen_ut :enable t) (sd-set-variable-status 'kant1_innen_ot :enable t) (setf kanten_1 t))) (if (and (equal kant1_innen nil) (equal kant1_aussen nil)) (progn (setf kanten_1 nil) (sd-set-variable-status 'kant1_innen :visible nil) (sd-set-variable-status 'kant1_innen_ut :visible nil) (sd-set-variable-status 'kant1_innen_ot :visible nil) (sd-set-variable-status 'kant1_aussen :visible nil) (sd-set-variable-status 'kant1_aussen_ut :visible nil) (sd-set-variable-status 'kant1_aussen_ot :visible nil) (sd-set-variable-status 'kant_1_zusatz :visible t) (sd-set-variable-status 'kant_1_zusatz :enable nil) ) ) ) ) (kant1_innen_ut :value-type :string :title "Innen UT" :initial-visible nil :initial-value kant1_innen_ut_pre ) (kant1_innen_ot :value-type :string :title "Innen OT" :initial-visible nil :initial-value kant1_innen_ot_pre ) (kant1_aussen :value-type :boolean :title "Kantensymbol aussen" :toggle-type :wide-toggle :initial-value t :initial-visible nil :after-input (progn (if (equal kant1_aussen nil) (progn (sd-set-variable-status 'kant1_aussen_ut :enable nil) (sd-set-variable-status 'kant1_aussen_ot :enable nil)) (progn (sd-set-variable-status 'kant1_aussen_ut :enable t) (sd-set-variable-status 'kant1_aussen_ot :enable t) (setf kanten_1 t))) (if (and (equal kant1_innen nil) (equal kant1_aussen nil)) (progn (setf kanten_1 nil) (sd-set-variable-status 'kant1_innen :visible nil) (sd-set-variable-status 'kant1_innen_ut :visible nil) (sd-set-variable-status 'kant1_innen_ot :visible nil) (sd-set-variable-status 'kant1_aussen :visible nil) (sd-set-variable-status 'kant1_aussen_ut :visible nil) (sd-set-variable-status 'kant1_aussen_ot :visible nil) (sd-set-variable-status 'kant_1_zusatz :visible t) (sd-set-variable-status 'kant_1_zusatz :enable nil) ) ) ) ) (kant1_aussen_ut :value-type :string :title "Aussen UT" :initial-visible nil :initial-value kant1_aussen_ut_pre ) (kant1_aussen_ot :value-type :string :title "Aussen OT" :initial-visible nil :initial-value kant1_aussen_ot_pre ) ("Zusatztexte") (txt_XXX :value-type :boolean :title "WerkstÏckmarkierung" :toggle-type :wide-toggle :initial-value t :after-input (progn (if (equal txt_XXX t) (sd-set-variable-status 'txt_beschr :enable t)) (if (equal txt_XXX nil) (sd-set-variable-status 'txt_beschr :enable nil)) ) ) (txt_beschr :value-type :string :title "Text" :size :third :initial-value (format nil "~a~%~a" txt_beschr_pre1 txt_beschr_pre2) :show-input-tool (sd-show-general-text-editor :initialText txt_beschr ;;:position '("Zusatzangaben" :leftbottom 0 0) :trimString nil :columns 100) ) ) :local-functions '( (def_pos () ;; Allgemeine Position der Oberflächenzeichen auf der X-Achse setzen (links/oben) (progn (if (equal pos_links t) (progn (setf pos_o1_pnt pos_o1_offset) (setf pos_o2_pnt pos_o2_offset) (setf pos_o3_pnt pos_o3_offset) (setf pos_o4_pnt pos_o4_offset) (setf pos_o5_pnt pos_o5_offset) (setf pos_o6_pnt pos_o6_offset) (setf pos_klauf_pnt pos_klauf_offset) (setf pos_klzu_pnt pos_klzu_offset) ) ) (if (equal pos_oben t) (progn (setf pos_o1_pnt (- pos_o1_offset offset_x_links)) (setf pos_o2_pnt (- pos_o2_offset offset_x_links)) (setf pos_o3_pnt (- pos_o3_offset offset_x_links)) (setf pos_o4_pnt (- pos_o4_offset offset_x_links)) (setf pos_o5_pnt (- pos_o5_offset offset_x_links)) (setf pos_o6_pnt (- pos_o6_offset offset_x_links)) (setf pos_klauf_pnt (- pos_klauf_offset offset_x_links)) (setf pos_klzu_pnt (- pos_klzu_offset offset_x_links)) ) ) ) ;; Allgemeine Position mit der selektierten Blattposition verrechnen (progn (if (equal pos_oben t)(setf offset_y offset_y_oben)) (if (equal pos_links t) (setf offset_y offset_y_links)) (setf pos_o1 (+ pos_o1_pnt (gpnt2d_x ppnt))) (setf pos_o2 (+ pos_o2_pnt (gpnt2d_x ppnt))) (setf pos_o3 (+ pos_o3_pnt (gpnt2d_x ppnt))) (setf pos_o4 (+ pos_o4_pnt (gpnt2d_x ppnt))) (setf pos_o5 (+ pos_o5_pnt (gpnt2d_x ppnt))) (setf pos_o6 (+ pos_o6_pnt (gpnt2d_x ppnt))) (setf pos_klauf (+ pos_klauf_pnt (gpnt2d_x ppnt))) (setf pos_klzu (+ pos_klzu_pnt (gpnt2d_x ppnt))) (setf pos_y (+ (gpnt2d_y ppnt) offset_y)) (setf pos_allg (make-gpnt2d :x (+ pos_allg_offset (gpnt2d_x ppnt)) :y pos_y)) (setf pos_sketch1 ppnt) ) ;; Verrechnung wenn mehrere Symbole gesetzt werden (progn (if (equal oberfl_6 t) (progn (setf pos_o1 (+ pos_o1 -24)) (setf pos_klauf (+ pos_klauf -24)) (setf pos_o2 (+ pos_o2 -24)) (setf pos_o3 (+ pos_o3 -24)) (setf pos_o4 (+ pos_o4 -24)) (setf pos_o5 (+ pos_o5 -24)) ) ) (if (equal oberfl_5 t) (progn (setf pos_o1 (+ pos_o1 -12)) (setf pos_klauf (+ pos_klauf -12)) (setf pos_o2 (+ pos_o2 -12)) (setf pos_o3 (+ pos_o3 -12)) (setf pos_o4 (+ pos_o4 -12)) ) ) (if (equal oberfl_4 t) (progn (setf pos_o1 (+ pos_o1 -12)) (setf pos_klauf (+ pos_klauf -12)) (setf pos_o2 (+ pos_o2 -12)) (setf pos_o3 (+ pos_o3 -12)) ) ) (if (equal oberfl_3 t) (progn (setf pos_o1 (+ pos_o1 -12)) (setf pos_klauf (+ pos_klauf -12)) (setf pos_o2 (+ pos_o2 -12)) ) ) (if (equal oberfl_2 t) (progn (setf pos_o1 (+ pos_o1 -12)) (setf pos_klauf (+ pos_klauf -12)) ) ) (if (or (equal oberfl_6 t) (or (equal oberfl_5 t) (or (equal oberfl_4 t) (or (equal oberfl_3 t) (equal oberfl_2 t))))) (progn (setf pos_o1 (+ pos_o1 -5)) ) ) (if (equal oberfl_1 "roh") (progn (setf pos_o1 (+ pos_o1 -10)) ) ) ) ;; Verrechnung der Kantenposition (progn (setf pos_kanten pos_o1) (print pos_kanten) (if (and (equal kant1_innen t) (equal kant1_aussen t)) (progn (setf pos_kanten (+ pos_o1 pos_kanten1_x_offset)) ) (progn (if (or (equal kant1_innen t) (equal kant1_aussen t)) (progn (setf pos_kanten (+ pos_o1 pos_kanten1_single_x_offset)) ) ) ) ) ) ;; Verrechnung der Textposition (progn (cond ((and (equal kant1_innen t) (equal kant1_aussen t)) (print 1) ) ((or (equal kant1_innen t) (equal kant1_aussen t)) (print 2) ) (t (print 3) ) ) ) );;def_pos (ok_oberfl () (progn (def_pos) ) (setf csn (sd-am-inq-curr-sheet-name)) (progn ;; Vorhandende skizze sketch1 falls vorhanden suchen und löschen (setf alle_skizzen nil) (setf alle_skizzen (sd-am-inq-all-sketches (sd-am-inq-curr-sheet))) (dolist (skizzen alle_skizzen) (when (sd-string-match-pattern-p sketch1 (sd-am-inq-name skizzen)) (AM_SKETCH_DELETE :sketch (format nil "/~a/~a" csn sketch1) :YES) );;when );;dolist ;; Skizze sketch1 erstellen (AM_SKETCH_CREATE :sketch_name sketch1 :owner :current_sheet :ref_point pos_sketch1 );;am_sketch );;progn (progn (setf docu::*docu-hide-wrong-owner-warning* t) (am_load_sketch :owner (format nil "/~a/~a" csn sketch1) :filename (format nil "~a/oberfl.mi" pfad) :adjust 3 :pick_pnt ppnt ) );;progn (progn ;;standardzeichen setzen (cond ((equal oberfl_1 "roh") (am_create_symbol_surface :standard :ISO2002 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :b oberfl_1 :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o1 pos_y) );;am_create ) (t (am_create_symbol_surface :standard :ISO1992 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :a1 oberfl_1 :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o1 pos_y) );;am_create );;t );;cond );;progn (if (or (equal oberfl_6 t) (or (equal oberfl_5 t) (or (equal oberfl_4 t) (or (equal oberfl_3 t) (equal oberfl_2 t))))) (progn (AM_CREATE_TEXT :docu-text "(" :owner (format nil "/~a/~a" csn sketch1) :size 11 :color 16776960 :done :ratio 0.85 (gpnt2d pos_klauf pos_y) ) (if (equal oberfl_2 t) (am_create_symbol_surface :standard :ISO1992 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :a1 "x" :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o2 pos_y) );;am_create ) (if (equal oberfl_3 t) (am_create_symbol_surface :standard :ISO1992 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :a1 "y" :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o3 pos_y) );;am_create ) (if (equal oberfl_4 t) (am_create_symbol_surface :standard :ISO1992 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :a1 "w" :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o4 pos_y) );;am_create ) (if (equal oberfl_5 t) (am_create_symbol_surface :standard :ISO1992 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :a1 "z" :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o5 pos_y) );;am_create ) (if (equal oberfl_6 t) (am_create_symbol_surface :standard :ISO1992 :form 1 :text_color 16776960 :done :geo_color 16776960 :done :size_abs 3.5 :b "roh" :owner (format nil "/~a/~a" csn sketch1) (gpnt2d pos_o6 pos_y) );;am_create ) (AM_CREATE_TEXT :docu-text ")" :owner (format nil "/~a/~a" csn sketch1) :size 11 :color 16776960 :done :ratio 0.85 (gpnt2d pos_klzu pos_y) ) );;progn );;if ;; Kantensymbole setzen (if (equal kanten_1 t) (progn (if (and (equal kant1_innen t) (equal kant1_aussen t)) (progn (am_create_symbol_generic :file2d_in (format nil "~a/Innen & aussen.mi" pfad) :owner (format nil "/~a/~a" csn sketch1) :SYMBOL_POSITION (gpnt2d pos_kanten pos_y) :p00 kant1_aussen_ut :p01 kant1_innen_ut :p02 kant1_aussen_ot :p03 kant1_innen_ot ) ) ) (if (and (equal kant1_innen t) (equal kant1_aussen nil)) (progn (am_create_symbol_generic :file2d_in (format nil "~a/Innen.mi" pfad) :owner (format nil "/~a/~a" csn sketch1) :SYMBOL_POSITION (gpnt2d pos_kanten pos_y) :p00 kant1_innen_ut :p01 kant1_innen_ot ) ) ) (if (and (equal kant1_innen nil) (equal kant1_aussen t)) (progn (am_create_symbol_generic :file2d_in (format nil "~a/aussen.mi" pfad) :owner (format nil "/~a/~a" csn sketch1) :SYMBOL_POSITION (gpnt2d pos_kanten pos_y) :p00 kant1_aussen_ut :p01 kant1_aussen_ot ) ) ) ) ) (if (equal txt_XXX t) (progn (AM_CREATE_TEXT :docu-text (format nil "~a" txt_beschr) :owner (format nil "/~a/~a" csn sketch1) :size 3.5 :color 16776960 :done :ratio 0.8 :adjust 3 (gpnt2d (+ pos_kanten -5) pos_y) ) ) ) (setf docu::*docu-hide-wrong-owner-warning* nil) );;ok_oberfl );;local-functions :ok-action '(sd-call-cmds (ok_oberfl)) :cancel-action '() :cleanup-action '() )