(in-package :custom) (use-package :OLI) ;;--------------------------------------------------------------------------* (sd-defdialog 'v_sheetthickness :dialog-title "Sheet Dicke" :toolbox-button t :variables '( (multiple_parts :selection (*sd-part-seltype*) :multiple-items t :show-select-menu t :prompt-text "Teile angeben" :title "Teil" :initial-value nil ) (bool_benennen :value-type :boolean :toggle-type :wide-toggle :title "Benennung eintragen" :initial-value t ) ) :local-functions '( (next-action () (let () (dolist (kind multiple_parts)(v_sheetthickness kind bool_benennen)) ) (sd-call-cmds(g-browser::rebuild-browser-tree "parcel-gbrowser")) ) );local-functions :ok-action '(sd-call-cmds (next-action)) :cancel-action '() :help-action '() ) (defun v_sheetthickness (source benennen) ;Flächen (let (i j k flaechen flaecheninhalt maximum sum maxflaeche mindistance distance ben_de ben_en) ;Flächen einlesen (setf flaechen (sd-call-cmds (get_selection :focus_type *sd-face-seltype* :select :in_part source))) ;Flächeninhalt berechnen (dolist (i flaechen) (setf flaecheninhalt (append flaecheninhalt (list (list (sd-call-cmds (get_vol_prop :for_face i :area)) i ) ) ) ) ) ;größte Fläche ermitteln -> Unit maxflaeche (setf maximum 0) (dolist (i flaecheninhalt) (if (> (first i) maximum) (progn (setf maximum (first i)) (setf maxflaeche (second i)) ) ) ) ;(display maximum) (setf mindistance 100000) (dolist (i flaechen) (if (not (equal maxflaeche i)) (progn (setf distance(float(/(round(sd-call-cmds (measure_dist :sf_sf maxflaeche i))0.01)100))) (if (not (equalp distance 0.0)) (if (< distance mindistance) (setf mindistance distance) ) ) ) ) ) ;Benennungen eintragen abhängig von mindistance (if benennen (progn (if (> mindistance 6.0) (progn (setf ben_de (format nil "Platte ~amm" mindistance)) (setf ben_en (format nil "plate ~amm" mindistance)) ) (progn (setf ben_de (format nil "Blech ~amm" mindistance)) (setf ben_en (format nil "sheet ~amm" mindistance)) ) ) ;Prüfungen (if (not (equal mindistance (first(last(sd-inq-part-sheet-metal-material source))))) (progn (display (format nil "Teil ~a :" (sd-inq-obj-pathname source))) (display "zugewiesene (sheetmetal oder basic) Materialstaerke weicht von der berechneten Staerke ab, bitte Pruefen!") (display (format nil "Materialstaerke berechnet: ~a mm" mindistance)) (display (format nil "Materialstaerke zugeordnet: ~a mm" (first(last(sd-inq-part-sheet-metal-material source))))) ) ) ;Attribute löschen (ts-info-teil-del :teil source :titel "BENENNUNG") (ts-info-teil-del :teil source :titel "BENENNUNG2") (ts-info-teil-del :teil source :titel "SolidPower_bom_part_attributes_DESCRIPTION") (ts-info-teil-del :teil source :titel "SolidPower_bom_part_attributes_DESCRIPTION2") ;Attribute eintragen (ts-info-teil :teil source :ti "BENENNUNG" :n ben_de :to_cont) (ts-info-teil :teil source :ti "BENENNUNG2" :n ben_en :to_cont) (ts-info-teil :teil source :ti "SolidPower_bom_part_attributes_DESCRIPTION" :n ben_de :to_cont) (ts-info-teil :teil source :ti "SolidPower_bom_part_attributes_DESCRIPTION2" :n ben_en :to_cont) ) );if benennen );let );function