;;--------------------------------------------------------------------------* ;; Modulbeschreibung: ;; Tool zum einfärben von Flächenf ;;--------------------------------------------------------------------------* ;; Dateiname: Flaechen_umfaerben.lsp ;; Version : 1.0 ;; Datum : 07.09.2021 ;; Author : MiBr ;;--------------------------------------------------------------------------* (in-package :mibr) (use-package :oli) ;;--------------------------------------------------------------------------* (sd-defdialog 'Flaechenfarbe-setzen :dialog-title "Eigenschaften setzen" :toolbox-button t :after-initialization '(col_back) :variables '( (para_efs :title "Eigene Farben setzen" :expand-shrink (name_1 name_2 name_3 name_4 name_5 name_6 name_7 name_8 name_9 set_back)) (name_1 :value-type :string :prompt-text "Oben-Links" :title "Oben-Links" :after-input (progn (sd-set-variable-status 'own_col_1 :title name_1) (setq own-col (list :col1 farbe_Se :name1 name_1)) (sd-set-persistent-data "ALL" "Eigene_Farben1" own-col :subkey :own_color1 :store-flag t) ) :initial-optional nil) (name_2 :value-type :string :prompt-text "Oben" :title "Oben" :after-input(progn (sd-set-variable-status 'own_col_2 :title name_2) (setq own-col (list :col2 farbe_Se :name2 name_2)) (sd-set-persistent-data "ALL" "Eigene_Farben2" own-col :subkey :own_color2 :store-flag t) ) :initial-optional nil) (name_3 :value-type :string :prompt-text "Oben-Rechts" :title "Oben-Rechts" :after-input (progn (sd-set-variable-status 'own_col_3 :title name_3) (setq own-col (list :col3 farbe_Se :name3 name_3)) (sd-set-persistent-data "ALL" "Eigene_Farben3" own-col :subkey :own_color3 :store-flag t) ) :initial-optional nil) (name_4 :value-type :string :prompt-text "Mitte-Links" :title "Mitte-Links" :after-input (progn (sd-set-variable-status 'own_col_4 :title name_4) (setq own-col (list :col4 farbe_Se :name4 name_4)) (sd-set-persistent-data "ALL" "Eigene_Farben4" own-col :subkey :own_color4 :store-flag t) ) :initial-optional nil) (name_5 :value-type :string :prompt-text "Mitte" :title "Mitte" :after-input (progn (sd-set-variable-status 'own_col_5 :title name_5) (setq own-col (list :col5 farbe_Se :name5 name_5)) (sd-set-persistent-data "ALL" "Eigene_Farben5" own-col :subkey :own_color5 :store-flag t) ) :initial-optional nil) (name_6 :value-type :string :prompt-text "Mitte-Rechte" :title "Mitte-Rechts" :after-input (progn (sd-set-variable-status 'own_col_6 :title name_6) (setq own-col (list :col6 farbe_Se :name6 name_6)) (sd-set-persistent-data "ALL" "Eigene_Farben6" own-col :subkey :own_color6 :store-flag t) ) :initial-optional nil) (name_7 :value-type :string :prompt-text "Unten-Links" :title "Unten-Links" :after-input (progn (sd-set-variable-status 'own_col_7 :title name_7) (setq own-col (list :col7 farbe_Se :name7 name_7)) (sd-set-persistent-data "ALL" "Eigene_Farben7" own-col :subkey :own_color7 :store-flag t) ) :initial-optional nil) (name_8 :value-type :string :prompt-text "Unten" :title "Unten" :after-input (progn (sd-set-variable-status 'own_col_8 :title name_8) (setq own-col (list :col8 farbe_Se :name8 name_8)) (sd-set-persistent-data "ALL" "Eigene_Farben8" own-col :subkey :own_color8 :store-flag t) ) :initial-optional nil) (name_9 :value-type :string :prompt-text "Unten-Rechts" :title "Unten-Rechts" :after-input (progn (sd-set-variable-status 'own_col_9 :title name_9) (setq own-col (list :col9 farbe_Se :name9 name_9)) (sd-set-persistent-data "ALL" "Eigene_Farben9" own-col :subkey :own_color9 :store-flag t) ) :initial-optional nil) (set_back :title "Eigene Farben Zurücksetzen" :push-action (progn (setq own-col (list :col1 nil :name1 nil)) (sd-set-persistent-data "ALL" "Eigene_Farben1" own-col :subkey :own_color1 :store-flag t) (col_back) ) :toggle-type :wide-toggle) ("Optionen") (farbe_Se :value-type :RGB-color :title "Farbe" :initial-value 10066329 :initial-enable t :after-input (progn (sd-set-persistent-data "ALL" "Flaechenfarbe" (list farbe_Se) :subkey :farbe_Se :store-flag t) (pprint farbe_Se) ) ) (Flaechen :value-type :face :toggle-type :invisible :title "Fläche" :prompt-text "Fläche auswählen" :initial-value nil :multiple-items t :modifies nil :before-input (when (sd-get-persistent-data "ALL" "Flaechenfarbe" :subkey :farbe_Se) (setf farbe_Se (first (sd-get-persistent-data "ALL" "Flaechenfarbe" :subkey :farbe_Se)))) :after-input (cond ((and (equal farbe_loe nil) (equal Folge_set nil)) (dolist (Flaechen-einzeln Flaechen) (sd-call-cmds (set_face_Color Flaechen-einzeln farbe_Se)))) ((and (equal farbe_loe t) (equal Folge_set nil)) (dolist (Flaechen-einzeln Flaechen) (sd-call-cmds (CLEAR_FACE_COLOR Flaechen-einzeln)))) ((and (equal farbe_loe nil) (equal Folge_set t)) (dolist (Flaechen-einzeln Flaechen) (sd-call-cmds (set_face_Color :smooth_elem_3d Flaechen-einzeln farbe_Se)))) ((and (equal farbe_loe t) (equal Folge_set t)) (dolist (Flaechen-einzeln Flaechen) (sd-call-cmds (CLEAR_FACE_COLOR :smooth_elem_3d Flaechen-einzeln)))) ) ;end cond ) ;; end variable Fläche (fvholen :value-type :face :initial-value nil :initial-optional t :initial-enable t :title "von Fläche" :prompt-text "Fläche, von dem die Farbe uebernommen werden soll, angeben" :modifies nil :after-input (let (neue_farbe) (setf neue_farbe (sd-inq-face-color fvholen)) (if neue_farbe (sd-set-variable-status 'farbe_Se :value (sd-rgb-to-color neue_farbe)) (progn (setf neue_farbe (sd-inq-part-color (sd-inq-parent-obj fvholen))) (sd-set-variable-status 'farbe_Se :value (sd-rgb-to-color neue_farbe)) );;progn );;if (setf fvholen nil) );;let ) ("-") (farbe_loe :toggle-type :grouped-toggle :value-type :boolean :indicator-type :none :title "Farbe löschen" :prompt-text "Flächenf. löschen" :initial-value nil :after-input (if (equal farbe_loe t) (progn (sd-set-variable-status 'farbe_Se :enable nil) (sd-set-variable-status 'fvholen :enable nil)) (progn (sd-set-variable-status 'farbe_Se :enable t) (sd-set-variable-status 'fvholen :enable t)) ) ;end if ) ;;end variable Farbe löschen (Folge_set :value-type :boolean :toggle-type :grouped-toggle :title "Folge akt." :prompt-text "Folge nutzen" :indicator-type :diamond :initial-value nil) ("Eigene Farben") (own_col_1 :title "OL" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben1" :subkey :own_color1) :col1)) :toggle-type :grouped-toggle :size :third) (own_col_2 :title "O" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben2" :subkey :own_color2) :col2)) :toggle-type :grouped-toggle :size :third) (own_col_3 :title "OR" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben3" :subkey :own_color3) :col3)) :toggle-type :grouped-toggle :size :third) (own_col_4 :title "ML" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben4" :subkey :own_color4) :col4)) :toggle-type :grouped-toggle :size :third) (own_col_5 :title "M" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben5" :subkey :own_color5) :col5)) :toggle-type :grouped-toggle :size :third) (own_col_6 :title "MR" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben6" :subkey :own_color6) :col6)) :toggle-type :grouped-toggle :size :third) (own_col_7 :title "UL" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben7" :subkey :own_color7) :col7)) :toggle-type :grouped-toggle :size :third) (own_col_8 :title "U" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben8" :subkey :own_color8) :col8)) :toggle-type :grouped-toggle :size :third) (own_col_9 :title "UR" :push-action (sd-set-variable-status 'farbe_Se :value (getf (sd-get-persistent-data "ALL" "Eigene_Farben9" :subkey :own_color9) :col9)) :toggle-type :grouped-toggle :size :third) (own-col) ) ;;end variable :prompt-variable 'Flaechen :ok-action '() :local-functions '( (col_back () (unless (getf (sd-get-persistent-data "ALL" "Eigene_Farben1" :subkey :own_color1) :name1) (setq own-col (list :col1 8888704 :name1 "Blaugrün")) (sd-set-persistent-data "ALL" "Eigene_Farben1" own-col :subkey :own_color1 :store-flag t) (setq own-col (list :col2 6525360 :name2 "Pastelblau")) (sd-set-persistent-data "ALL" "Eigene_Farben2" own-col :subkey :own_color2 :store-flag t) (setq own-col (list :col3 3694988 :name3 "Brilliantblau")) (sd-set-persistent-data "ALL" "Eigene_Farben3" own-col :subkey :own_color3 :store-flag t) (setq own-col (list :col4 3307107 :name4 "Patinagrün")) (sd-set-persistent-data "ALL" "Eigene_Farben4" own-col :subkey :own_color4 :store-flag t) (setq own-col (list :col5 7764059 :name5 "Schifgrün")) (sd-set-persistent-data "ALL" "Eigene_Farben5" own-col :subkey :own_color5 :store-flag t) (setq own-col (list :col6 5133629 :name6 "Olivgrün")) (sd-set-persistent-data "ALL" "Eigene_Farben6" own-col :subkey :own_color6 :store-flag t) (setq own-col (list :col7 9138245 :name7 "Grünbraun")) (sd-set-persistent-data "ALL" "Eigene_Farben7" own-col :subkey :own_color7 :store-flag t) (setq own-col (list :col8 14251524 :name8 "Gelborange")) (sd-set-persistent-data "ALL" "Eigene_Farben8" own-col :subkey :own_color8 :store-flag t) (setq own-col (list :col9 12273958 :name9 "Rotorange")) (sd-set-persistent-data "ALL" "Eigene_Farben9" own-col :subkey :own_color9 :store-flag t) ) ;end unless (sd-set-variable-status 'own_col_1 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben1" :subkey :own_color1) :name1)) (sd-set-variable-status 'own_col_2 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben2" :subkey :own_color2) :name2)) (sd-set-variable-status 'own_col_3 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben3" :subkey :own_color3) :name3)) (sd-set-variable-status 'own_col_4 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben4" :subkey :own_color4) :name4)) (sd-set-variable-status 'own_col_5 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben5" :subkey :own_color5) :name5)) (sd-set-variable-status 'own_col_6 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben6" :subkey :own_color6) :name6)) (sd-set-variable-status 'own_col_7 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben7" :subkey :own_color7) :name7)) (sd-set-variable-status 'own_col_8 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben8" :subkey :own_color8) :name8)) (sd-set-variable-status 'own_col_9 :title (getf (sd-get-persistent-data "ALL" "Eigene_Farben9" :subkey :own_color9) :name9)) );end col_back );end lokal-functions );end sd-defdialog