;; ====================================================================================================== ;; gdm_m1_properies.lsp ;; os 25.08.2003 ;; geändert os / 13.11.2006 10:11 Auswahl Base - Instanz Properies ;; geändert os / 08.07.2008 17:28 Transparenz und Multi-Farbenauswahl hinzu ;; M1 - Logical Table fuer Material und Dichte ;; M2 - Zuordnen von Dichte und Farbe - auch fuer Normteile ;; M3 - Sucht in Baugruppen oder unter Root nach Teilen mit einer bestimmten Dichte ;; M4 - Dichte ueber eine vorgegebene Masse berechnen und dem Teil zuordnen ;; ====================================================================================================== (in-package :GDM) (use-package :OLI) ;; ====================================================================================================== ;; M1 - Logical Table fuer Material und Dichte (sd-create-logical-table "Dichte-Farbe-Liste" :columns '(:Benennung :Dichte_1 :Abk :Dichte :TRANS :Farbe1 :Farbe2 :Farbe3 :Farbe4 :Farbe5 :Farbe6 :Farbe7 :Farbe8) :columnNames (sd-multi-lang-string '("Material" "kg/dm^3" "-" "g/mm^3" "Transparency" "Farbe1" "Farbe2" "Farbe3" "Farbe4" "Farbe5" "Farbe6" "Farbe7" "Farbe8") :german '("Material" "kg/dm^3" "-" "g/mm^3" "Transparenz" "Farbe1" "Farbe2" "Farbe3" "Farbe4" "Farbe5" "Farbe6" "Farbe7" "Farbe8") );;sd-multi-lang-string :types '(:string :string :string :mass :number :string :string :string :string :string :string :string :string) :units '(nil nil nil :g nil nil nil nil nil nil nil nil nil) :contents (sd-multi-lang-string '(("Aluminum" "2,75" "Al" 0.00275 0.0 "0.600,1.000,1.000" "0.486,0.600,0.980" "0.514,0.616,0.980" "0.557,0.655,0.984" "0.647,0.706,0.984" "0.737,0.796,0.988" "0.808,0.847,0.992" "0.898,0.898,0.999") ("Bronze" "8,45" "CuSn" 0.00845 0.0 "0.991,0.873,0.394" "0.847,0.734,0.205" "0.870,0.775,0.245" "0.893,0.816,0.285" "0.916,0.857,0.325" "0.939,0.898,0.365" "0.962,0.939,0.405" "0.985,0.980,0.445") ("Magnesium" "1,89" "Mg" 0.00189 0.0 "1.000,0.900,0.600" "0.886,0.816,0.686" "0.808,0.796,0.656" "0.730,0.776,0.626" "0.652,0.756,0.596" "0.574,0.736,0.566" "0.496,0.716,0.536" "0.418,0.696,0.506") ("Brass" "8,50" "CuZn" 0.0085 0.0 "1.000,0.700,0.000" "0.992,0.855,0.220" "0.875,0.725,0.008" "0.784,0.647,0.008" "0.693,0.569,0.006" "0.602,0.491,0.005" "0.511,0.413,0.004" "0.420,0.335,0.003") ("Steel" "7,85" "St" 0.00785 0.0 "0.600,0.600,0.600" "0.392,0.455,0.667" "0.459,0.514,0.702" "0.557,0.604,0.757" "0.651,0.686,0.808" "0.729,0.757,0.855" "0.827,0.847,0.906" "0.827,0.847,0.906") ("Titan" "4,50" "Ti" 0.0045 0.0 "0.300,0.500,0.700" "0.260,0.570,0.740" "0.220,0.640,0.780" "0.180,0.710,0.820" "0.140,0.780,0.860" "0.100,0.850,0.900" "0.060,0.920,0.940" "0.020,0.990,0.980") ("Zinc" "7,14" "Zn" 0.00714 0.0 "0.600,0.800,1.000" "0.670,0.700,0.720" "0.710,0.750,0.760" "0.750,0.800,0.800" "0.790,0.850,0.840" "0.830,0.900,0.880" "0.870,0.950,0.920" "0.910,1.000,0.960") ("ABS/PS/SB" "1,00" "ABS/PS/SB" 0.001 0.0 "0.800,0.700,0.400" "0.900,0.850,0.740" "0.875,0.808,0.668" "0.850,0.766,0.596" "0.825,0.724,0.524" "0.800,0.682,0.452" "0.775,0.640,0.380" "0.750,0.598,0.308") ("HD-PE" "0,96" "HD-PE" 0.00096 0.0 "1.000,0.300,0.740" "1.000,0.350,0.650" "1.000,0.400,0.560" "1.000,0.450,0.470" "1.000,0.500,0.380" "1.000,0.550,0.290" "1.000,0.600,0.200" "1.000,0.650,0.110") ("laminated Paper" "1,40" "Hp/Hgw" 0.0014 0.0 "0.500,0.300,0.000" "0.570,0.400,0.000" "0.640,0.500,0.000" "0.710,0.600,0.000" "0.780,0.700,0.000" "0.850,0.800,0.000" "0.920,0.900,0.000" "0.990,1.000,0.000") ("PA" "1,13" "PA" 0.00113 0.0 "1.000,0.000,0.000" "0.760,0.850,0.730" "0.670,0.790,0.630" "0.580,0.730,0.530" "0.490,0.670,0.430" "0.400,0.610,0.330" "0.310,0.550,0.230" "0.220,0.490,0.130") ("PC" "1,20" "PC" 0.0012 0.0 "1.000,1.000,0.000" "0.922,0.996,0.996" "0.770,0.989,0.989" "0.618,0.982,0.982" "0.466,0.975,0.975" "0.314,0.968,0.968" "0.162,0.961,0.961" "0.010,0.954,0.954") ("PE" "0.93" "PE" 0.00093 0.0 "1.000,0.900,0.000" "0.596,0.737,0.620" "0.662,0.780,0.670" "0.728,0.823,0.720" "0.794,0.866,0.770" "0.860,0.909,0.820" "0.926,0.952,0.870" "0.992,0.995,0.920") ("PMMA" "1,18" "PMMA" 0.00118 0.5 "0.000,1.000,1.000" "0.918,0.933,1.000" "0.824,0.859,1.000" "0.730,0.785,1.000" "0.636,0.711,1.000" "0.542,0.637,1.000" "0.448,0.563,1.000" "0.354,0.489,1.000") ("POM" "1,40" "POM" 0.0014 0.0 "0.000,0.000,1.000" "0.008,0.090,0.435" "0.008,0.125,0.600" "0.008,0.160,0.765" "0.008,0.195,0.930" "0.008,0.230,1.000" "0.008,0.265,1.000" "0.008,0.300,1.000") ("PP" "0,90" "PP" 0.0009 0.0 "0.000,1.000,0.000" "0.906,0.796,0.855" "0.863,0.706,0.788" "0.827,0.639,0.737" "0.791,0.572,0.686" "0.755,0.505,0.635" "0.719,0.438,0.584" "0.683,0.371,0.533") ("PTFE" "2,20" "PTFE" 0.0022 0.0 "0.300,0.500,0.300" "0.835,0.761,0.878" "0.824,0.745,0.871" "0.813,0.729,0.864" "0.802,0.713,0.857" "0.791,0.697,0.850" "0.780,0.681,0.843" "0.769,0.665,0.836") ("PU-Compact" "1,30" "PU-C" 0.0013 0.0 "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643") ("PU-Foam" "0,59" "PU-F" 0.00059 0.0 "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643") ("PVC" "1,40" "PVC" 0.0014 0.0 "0.000,0.000,1.000" "0.416,0.773,0.263" "0.505,0.808,0.300" "0.594,0.843,0.337" "0.683,0.878,0.374" "0.772,0.913,0.411" "0.861,0.948,0.448" "0.950,0.983,0.485") ("Glass" "2,50" "Glas" 0.0025 0.5 "1.000,1.000,1.000" "0.757,0.800,0.835" "0.770,0.830,0.850" "0.783,0.860,0.865" "0.796,0.890,0.880" "0.809,0.920,0.895" "0.822,0.950,0.910" "0.835,0.980,0.925") ) :german '(("Aluminium" "2,75" "Al" 0.00275 0.0 "0.600,1.000,1.000" "0.486,0.600,0.980" "0.514,0.616,0.980" "0.557,0.655,0.984" "0.647,0.706,0.984" "0.737,0.796,0.988" "0.808,0.847,0.992" "0.898,0.898,0.999") ("Bronze" "8,45" "CuSn" 0.00845 0.0 "0.991,0.873,0.394" "0.847,0.734,0.205" "0.870,0.775,0.245" "0.893,0.816,0.285" "0.916,0.857,0.325" "0.939,0.898,0.365" "0.962,0.939,0.405" "0.985,0.980,0.445") ("Magnesium" "1,89" "Mg" 0.00189 0.0 "1.000,0.900,0.600" "0.886,0.816,0.686" "0.808,0.796,0.656" "0.730,0.776,0.626" "0.652,0.756,0.596" "0.574,0.736,0.566" "0.496,0.716,0.536" "0.418,0.696,0.506") ("Messing" "8,50" "CuZn" 0.0085 0.0 "1.000,0.700,0.000" "0.992,0.855,0.220" "0.875,0.725,0.008" "0.784,0.647,0.008" "0.693,0.569,0.006" "0.602,0.491,0.005" "0.511,0.413,0.004" "0.420,0.335,0.003") ("Stahl" "7,85" "St" 0.00785 0.0 "0.600,0.600,0.600" "0.392,0.455,0.667" "0.459,0.514,0.702" "0.557,0.604,0.757" "0.651,0.686,0.808" "0.729,0.757,0.855" "0.827,0.847,0.906" "0.827,0.847,0.906") ("Titan" "4,50" "Ti" 0.0045 0.0 "0.300,0.500,0.700" "0.260,0.570,0.740" "0.220,0.640,0.780" "0.180,0.710,0.820" "0.140,0.780,0.860" "0.100,0.850,0.900" "0.060,0.920,0.940" "0.020,0.990,0.980") ("Zink" "7,14" "Zn" 0.00714 0.0 "0.600,0.800,1.000" "0.670,0.700,0.720" "0.710,0.750,0.760" "0.750,0.800,0.800" "0.790,0.850,0.840" "0.830,0.900,0.880" "0.870,0.950,0.920" "0.910,1.000,0.960") ("ABS/PS/SB" "1,00" "ABS/PS/SB" 0.001 0.0 "0.800,0.700,0.400" "0.900,0.850,0.740" "0.875,0.808,0.668" "0.850,0.766,0.596" "0.825,0.724,0.524" "0.800,0.682,0.452" "0.775,0.640,0.380" "0.750,0.598,0.308") ("HD-PE" "0,96" "HD-PE" 0.00096 0.0 "1.000,0.300,0.740" "1.000,0.350,0.650" "1.000,0.400,0.560" "1.000,0.450,0.470" "1.000,0.500,0.380" "1.000,0.550,0.290" "1.000,0.600,0.200" "1.000,0.650,0.110") ("Hartpapier" "1,40" "Hp/Hgw" 0.0014 0.0 "0.500,0.300,0.000" "0.570,0.400,0.000" "0.640,0.500,0.000" "0.710,0.600,0.000" "0.780,0.700,0.000" "0.850,0.800,0.000" "0.920,0.900,0.000" "0.990,1.000,0.000") ("PA" "1,13" "PA" 0.00113 0.0 "1.000,0.000,0.000" "0.760,0.850,0.730" "0.670,0.790,0.630" "0.580,0.730,0.530" "0.490,0.670,0.430" "0.400,0.610,0.330" "0.310,0.550,0.230" "0.220,0.490,0.130") ("PC" "1,20" "PC" 0.0012 0.0 "1.000,1.000,0.000" "0.922,0.996,0.996" "0.770,0.989,0.989" "0.618,0.982,0.982" "0.466,0.975,0.975" "0.314,0.968,0.968" "0.162,0.961,0.961" "0.010,0.954,0.954") ("PE" "0.93" "PE" 0.00093 0.0 "1.000,0.900,0.000" "0.596,0.737,0.620" "0.662,0.780,0.670" "0.728,0.823,0.720" "0.794,0.866,0.770" "0.860,0.909,0.820" "0.926,0.952,0.870" "0.992,0.995,0.920") ("PMMA" "1,18" "PMMA" 0.00118 0.5 "0.000,1.000,1.000" "0.918,0.933,1.000" "0.824,0.859,1.000" "0.730,0.785,1.000" "0.636,0.711,1.000" "0.542,0.637,1.000" "0.448,0.563,1.000" "0.354,0.489,1.000") ("POM" "1,40" "POM" 0.0014 0.0 "0.000,0.000,1.000" "0.008,0.090,0.435" "0.008,0.125,0.600" "0.008,0.160,0.765" "0.008,0.195,0.930" "0.008,0.230,1.000" "0.008,0.265,1.000" "0.008,0.300,1.000") ("PP" "0,90" "PP" 0.0009 0.0 "0.000,1.000,0.000" "0.906,0.796,0.855" "0.863,0.706,0.788" "0.827,0.639,0.737" "0.791,0.572,0.686" "0.755,0.505,0.635" "0.719,0.438,0.584" "0.683,0.371,0.533") ("PTFE" "2,20" "PTFE" 0.0022 0.0 "0.300,0.500,0.300" "0.835,0.761,0.878" "0.824,0.745,0.871" "0.813,0.729,0.864" "0.802,0.713,0.857" "0.791,0.697,0.850" "0.780,0.681,0.843" "0.769,0.665,0.836") ("PU-Kompakt" "1,30" "PU-C" 0.0013 0.0 "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643") ("PU-Schaum" "0,59" "PU-F" 0.00059 0.0 "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643" "0.333,0.643,0.643") ("PVC" "1,40" "PVC" 0.0014 0.0 "0.000,0.000,1.000" "0.416,0.773,0.263" "0.505,0.808,0.300" "0.594,0.843,0.337" "0.683,0.878,0.374" "0.772,0.913,0.411" "0.861,0.948,0.448" "0.950,0.983,0.485") ("Glas" "2,50" "Glas" 0.0025 0.5 "1.000,1.000,1.000" "0.757,0.800,0.835" "0.770,0.830,0.850" "0.783,0.860,0.865" "0.796,0.890,0.880" "0.809,0.920,0.895" "0.822,0.950,0.910" "0.835,0.980,0.925") ) );;sd-multi-lang-string );;sd-create-logical-table ;; ===================== (sd-create-display-table "Material-Dichte-Liste" :tableTitle (sd-multi-lang-string "Material and Density" :german "Material und Dichte") :logicalTable "Dichte-Farbe-Liste" :columns '(:Benennung :Dichte_1 :Abk :Dichte :TRANS :Farbe1 :Farbe2 :Farbe3 :Farbe4 :Farbe5 :Farbe6 :Farbe7 :Farbe8) :applyColumns '(:Abk :Dichte :TRANS :Farbe1 :Farbe2 :Farbe3 :Farbe4 :Farbe5 :Farbe6 :Farbe7 :Farbe8) :displayHeight 350 :displayWidth 350 :filterStatusLine nil :selectionMode :single-row :applyAction :default-tokens );;sd-create-display-table ;; ===================== (sd-create-display-table "Dichte-Liste" :tableTitle (sd-multi-lang-string "Material and Density" :german "Material und Dichte") :logicalTable "Dichte-Farbe-Liste" :columns '(:Benennung :Dichte_1 :Abk :Dichte :Farbe1) :applyColumns '(:Dichte) :displayHeight 350 :filterStatusLine nil :selectionMode :single-row :applyAction :default-tokens );;sd-create-display-table ;; ====================================================================================================== ;; M2 - Zuordnen von Dichte und Farbe - auch fuer Normteile (sd-defdialog 'gdm-m1-dichte-setzen-dialog :dialog-title (sd-multi-lang-string "Assign Density" :german "Dichte zuordnen") :toolbox-button t :variables '( (UI_PART :value-type :part :modifies nil :multiple-items t :title (sd-multi-lang-string "Part" :german "Teil") :prompt-text (sd-multi-lang-string "Specify Part." :german "Teil angeben.")) (ABK :value-type :string :title (sd-multi-lang-string "Material" :german "Material") :show-input-tool (sd-show-display-table "Material-Dichte-Liste" :position '("TOP-MENU-TOOLBOX-TB" :lefttop 70 50)) :hide-input-tool (sd-hide-display-table "Material-Dichte-Liste" :ignorePin t)) (DICHTE :value-type :positive-number :title (sd-multi-lang-string "Density" :german "Dichte") :prompt-text (sd-multi-lang-string "Specify Density." :german "Dichte angeben.") :show-input-tool (sd-show-display-table "Material-Dichte-Liste" :position '("TOP-MENU-TOOLBOX-TB" :lefttop 70 50)) :hide-input-tool (sd-hide-display-table "Material-Dichte-Liste" :ignorePin t)) (TRANS :value-type :length :title (sd-multi-lang-string "Transparency" :german "Transparenz") :check-function #'(lambda (new-value) (if (and (numberp new-value) (<= 0 new-value 1)) :ok (values :error (sd-multi-lang-string "The input value is beyond the range [0 - 1]" :german "Die Eingabe ist nicht im Bereich [0-1]")))) :prompt-text (sd-multi-lang-string "Specify Transparency." :german "Dichte Transparenz.")) (Farbe1 :value-type :string :toggle-type :invisible :after-input (setq FARBE_1 (sd-rgb-to-color (read-from-string Farbe1)))) (FARBE_1 :value-type :rgb-color :title (sd-multi-lang-string "Color 1" :german "Farbe 1")) (Farbe2 :value-type :string :toggle-type :invisible :after-input (setq FARBE_2 (sd-rgb-to-color (read-from-string Farbe2)))) (FARBE_2 :value-type :rgb-color :title (sd-multi-lang-string "Color 2" :german "Farbe 2")) (Farbe3 :value-type :string :toggle-type :invisible :after-input (setq FARBE_3 (sd-rgb-to-color (read-from-string Farbe3)))) (FARBE_3 :value-type :rgb-color :title (sd-multi-lang-string "Color 3" :german "Farbe 3")) (Farbe4 :value-type :string :toggle-type :invisible :after-input (setq FARBE_4 (sd-rgb-to-color (read-from-string Farbe4)))) (FARBE_4 :value-type :rgb-color :title (sd-multi-lang-string "Color 4" :german "Farbe 4")) (Farbe5 :value-type :string :toggle-type :invisible :after-input (setq FARBE_5 (sd-rgb-to-color (read-from-string Farbe5)))) (FARBE_5 :value-type :rgb-color :title (sd-multi-lang-string "Color 5" :german "Farbe 5")) (Farbe6 :value-type :string :toggle-type :invisible :after-input (setq FARBE_6 (sd-rgb-to-color (read-from-string Farbe6)))) (FARBE_6 :value-type :rgb-color :title (sd-multi-lang-string "Color 6" :german "Farbe 6")) (Farbe7 :value-type :string :toggle-type :invisible :after-input (setq FARBE_7 (sd-rgb-to-color (read-from-string Farbe7)))) (FARBE_7 :value-type :rgb-color :title (sd-multi-lang-string "Color 7" :german "Farbe 7")) (Farbe8 :value-type :string :toggle-type :invisible :after-input (setq FARBE_8 (sd-rgb-to-color (read-from-string Farbe8)))) (FARBE_8 :value-type :rgb-color :title (sd-multi-lang-string "Color 8" :german "Farbe 8")) (DUMMY_FARBE :title (sd-multi-lang-string "Use color?" :german "Verwende Farbe?")) (F1 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 1" :german "Farbe 1")) (F2 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 2" :german "Farbe 2")) (F3 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 3" :german "Farbe 3")) (F4 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 4" :german "Farbe 4")) (F5 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 5" :german "Farbe 5")) (F6 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 6" :german "Farbe 6")) (F7 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 7" :german "Farbe 7")) (F8 :value-type :grouped-boolean :size :half :title (sd-multi-lang-string "Color 8" :german "Farbe 8")) (DUMMY_VORGABEN :title (sd-multi-lang-string "Put Settings" :german "Vorgaben setzen")) (BASE_INST_P :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Base & Individual" :german "Basis & Individuell") :initial-value t) (BASE_P :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "only Base" :german "nur Basis")) (INST_P :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "only Individual" :german "nur Individuell")) ("") (EXEMPLAR :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "with shared Parts" :german "mit Exemplare") :initial-value t) ("") (DICHTE_U_FARBE :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Density, Transp. & Color" :german "Dichte, Transp. & Farbe") :initial-value t) (NUR_DICHTE :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Density & Transparency" :german "Dichte & Transparenz") :initial-value nil) ("") (NEXT :push-action (l-dichte-auswahl) :toggle-type :wide-toggle :after-input (setf UI_PART nil) :next-variable 'UI_PART) );;variables :mutual-exclusion '((F1 F2 F3 F4 F5 F6 F7 F8) (NUR_DICHTE DICHTE_U_FARBE) (BASE_INST_P BASE_P INST_P)) :local-functions '( (l-dichte-auswahl () (cond (F1 (setf FARBE FARBE_1)) (F2 (setf FARBE FARBE_2)) (F3 (setf FARBE FARBE_3)) (F4 (setf FARBE FARBE_4)) (F5 (setf FARBE FARBE_5)) (F6 (setf FARBE FARBE_6)) (F7 (setf FARBE FARBE_7)) (F8 (setf FARBE FARBE_8)) );;cond (if EXEMPLAR (progn (let (TEILE_LISTE) (setf TEILE_LISTE (sd-inq-obj-shared-objects (first UI_PART))) (dolist (a_TEIL TEILE_LISTE) (l-dichte-zuordnen a_TEIL) );;dolist );;let );progn (l-dichte-zuordnen UI_PART) );;if );;l-dichte-auswahl (l-dichte-zuordnen (a_TEIL) (progn (when BASE_INST_P ;; Basis Eigenschaften (sd-call-cmds (set_part_base_density :parts a_TEIL :dens DICHTE) :failure (display (sd-multi-lang-string (format nil "The Base-Properties could not be assigned to ~a." a_TEIL) :german (format nil "Die Basis-Eigenschaften konnte dem Teil ~a nicht zugeordnet werden." a_TEIL)))) (sd-call-cmds (set_part_base_transparency :parts a_TEIL :transp TRANS) :failure nil) ;; Instanz Eigenschaften (sd-call-cmds (set_part_inst_density :parts a_TEIL :dens DICHTE) :failure (display (sd-multi-lang-string (format nil "The Individual-Properties could not be assigned to ~a." a_TEIL) :german (format nil "Die Exemplar-Eigenschaften konnte dem Teil ~a nicht zugeordnet werden." a_TEIL)))) (sd-call-cmds (set_part_inst_transparency :parts a_TEIL :transp TRANS) :failure nil) (when DICHTE_U_FARBE (sd-call-cmds (set_part_base_color :parts a_TEIL :color FARBE) :failure nil) (sd-call-cmds (set_part_inst_color :parts a_TEIL :color FARBE) :failure nil) );;when );;when (when BASE_P (sd-call-cmds (set_part_base_density :parts a_TEIL :dens DICHTE) :failure (display (sd-multi-lang-string (format nil "The Base-Properties could not be assigned to ~a." a_TEIL) :german (format nil "Die Basis-Eigenschaften konnte dem Teil ~a nicht zugeordnet werden." a_TEIL)))) (sd-call-cmds (set_part_base_transparency :parts a_TEIL :transp TRANS) :failure nil) (when DICHTE_U_FARBE (sd-call-cmds (set_part_base_color :parts a_TEIL :color FARBE) :failure nil) );;when );;when (when INST_P (sd-call-cmds (set_part_inst_density :parts a_TEIL :dens DICHTE) :failure (display (sd-multi-lang-string (format nil "The Individual-Properties could not be assigned to ~a." a_TEIL) :german (format nil "Die Exemplar-Eigenschaften konnte dem Teil ~a nicht zugeordnet werden." a_TEIL)))) (sd-call-cmds (set_part_inst_transparency :parts a_TEIL :transp TRANS) :failure nil) (when DICHTE_U_FARBE (sd-call-cmds (set_part_inst_color :parts a_TEIL :color FARBE) :failure nil) );;when );;when );progn );;l-dichte-zuordnen );;local-functions :ok-action '(l-dichte-auswahl) ;:help-action '() );;sd-defdialog ;; ====================================================================================================== ;; M3 - Sucht in Baugruppen oder unter Root nach Teilen mit einer bestimmten Dichte (sd-defdialog 'gdm-m1-dichte-suchen-dialog :dialog-title (sd-multi-lang-string "Search for Density" :german "Nach Dichte suchen") :toolbox-button t :variables '( (BACK-STATE :initial-value nil) (BGR :value-type :assembly :title (sd-multi-lang-string "Assembly" :german "Baugruppe") :prompt-text (sd-multi-lang-string "Specify Assembly" :german "Baugruppe angeben") :modifies nil) (DICHTE :value-type :positive-number :title (sd-multi-lang-string "Density" :german "Dichte") :show-input-tool (sd-show-display-table "Dichte-Liste" :position '("TOP-MENU-TOOLBOX-TB" :lefttop 70 50)) :hide-input-tool (sd-hide-display-table "Dichte-Liste" :ignorePin t) :prompt-text (sd-multi-lang-string "Specify Density" :german "Dichte eingeben") :initial-value 1) (BESCHR :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Label" :german "Beschriften") :initial-value t) (KEEP :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "keep Label" :german "Beschriftung behalten") :initial-value nil) ("") (NEXT :title "Next" :toggle-type :wide-toggle :push-action (sd-call-cmds (next-action))) );;variables :local-functions '( (next-action () (when (and BACK-STATE (not KEEP)) (progn (sd-return-to-model-checkpoint BACK-STATE) (setf BACK-STATE nil) );;progn );;when (if (and BGR DICHTE) (progn (setf BACK-STATE (sd-set-model-checkpoint)) (suche-dichte-in-bgr BGR DICHTE BESCHR) );;progn (sd-display-error (sd-multi-lang-string "Not all necessary inputs are specified!" :german "Es wurden nicht alle erforderlichen Eingaben gemacht!")) );;if );;next-action );;local-functions :cleanup-action '(when (and BACK-STATE (not KEEP)) (sd-return-to-model-checkpoint BACK-STATE)) :ok-action '(next-action) );;sd-defdialog ;; durchsucht alle Teile nach der Dichte (dichte) und gibt eine ;; entsprechende Liste mit allen Teilen mit der entsprechende ;; Dichte aus! (defun suche-dichte-in-bgr (TEIL_BGR DICHTE BESCHR) (let (TEILETYP TEILDICHTE KIND KINDER TXT) (setf TEILETYP (sel_item-type TEIL_BGR)) (if (equal TEILETYP *sd-part-seltype*) (progn (when (not (sd-inq-empty-part-p TEIL_BGR)) (progn (setf TEILDICHTE (sd-inq-part-density TEIL_BGR)) (if (= DICHTE TEILDICHTE) (progn (if (sd-inq-obj-contents-read-only-p TEIL_BGR) (display (sd-multi-lang-string (format nil "Density ~,,,,,,'EG: ~a (read only)" TEILDICHTE (sd-inq-obj-pathname TEIL_BGR)) :german (format nil "Dichte ~,,,,,,'EG: ~a (read only)" TEILDICHTE (sd-inq-obj-pathname TEIL_BGR)))) (display (sd-multi-lang-string (format nil "Density ~,,,,,,'EG: ~a" TEILDICHTE (sd-inq-obj-pathname TEIL_BGR)) :german (format nil "Dichte ~,,,,,,'EG: ~a" TEILDICHTE (sd-inq-obj-pathname TEIL_BGR)))) );;if (if BESCHR (progn (setf TXT (format nil "Dichte ~,,,,,,'EG" TEILDICHTE)) (when (not (sd-inq-obj-contents-read-only-p TEIL_BGR)) (cocreate_3d_note :action :create :note TXT :items TEIL_BGR) );;when );;progn nil );;if );;progn nil );;if );;progn );;when );;progn ;; else (when (equal TEILETYP *sd-assembly-seltype*) (progn (setf KINDER (sd-inq-obj-children TEIL_BGR)) (dolist (KIND KINDER) (suche-dichte-in-bgr KIND DICHTE BESCHR) );;dolist );;progn );;when );;if );;let );;defun ;; ====================================================================================================== ;; M4 - Dichte ueber eine vorgegebene Masse berechnen und dem Teil zuordnen (sd-defdialog 'gdm-m1-dichte-masse-setzen-dialog :dialog-title (sd-multi-lang-string "Assign Density o. Mass" :german "Dichte zuord. ueber Masse") :toolbox-button t :variables '( (TEIL :value-type :part :title (sd-multi-lang-string "Part" :german "Teil") :prompt-text (sd-multi-lang-string "Specify Part" :german "Teil angeben")) (MASSE :value-type :number :title (sd-multi-lang-string "Mass / g" :german "Masse / g") :prompt-text (sd-multi-lang-string "Input Mass in g" :german "Masse in g eingeben")) ("") (BASE_P :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Base" :german "Basis Dichte/Farbe") :initial-value t) (INST_P :value-type :boolean :toggle-type :wide-toggle :title (sd-multi-lang-string "Instance" :german "Exemplar Dichte/Farbe")) );variables :mutual-exclusion '(BASE_P INST_P) :local-functions '( (dichte_ueber_masse_zuordnen () (let (VOLUMEN DICHTE) ;; Volumen abfargen (setq VOLUMEN (sd-call-cmds (get_vol_prop :for_part :part_asmb (sd-inq-obj-pathname TEIL) :volume) :failure nil)) ;; Dichte berechnen (setq DICHTE (/ MASSE VOLUMEN)) ;; Dichte zuordnen (sd-call-cmds (set_part_inst_density :parts TEIL :dens DICHTE) :success (display (format nil "Dem Teil wurde eine Exemplar-Dichte von ~A g/mm3 zugeordnet" DICHTE)) :failure (display "Die Exemplar-Dichte konnte nicht zugeordnet werden.")) (if BASE_P (sd-call-cmds (set_part_base_density :parts TEIL :dens DICHTE) :success (display (format nil "Dem Teil wurde eine Basis-Dichte von ~A g/mm3 zugeordnet" DICHTE)) :failure (display "Die Basis-Dichte konnte nicht zugeordnet werden.")) );;if );;let );;dichte_ueber_masse_zuordnen );;local-functions :ok-action '(dichte_ueber_masse_zuordnen) );;sd-defdialog