#|=================================================================================================== SW-Teile-Schuetzen.lsp 2017-11-09 SW: erstellt von Wolfgang Seel schnelles Schützen der aller Teile in Annotation mit folgenden Materialien : 8.8 10.9 12.9 1.3505 u.s.w. |# (in-package :sw) (use-package :oli) (sd-defdialog 'SW-Teile-Schuetzen :dialog-title "SW-Teile-Schuetzen" :toolbox-button t :variables '( (Baugruppe :value-type :assembly :title "Baugruppe:" :prompt-text "Zielbaugruppe angeben, in welcher die Teile automatisch geschützt werden sollen." :initial-value nil ;(sd-pathname-to-obj "/") :after-input (progn (clear_vp (oli::sd-inq-current-vp)) (add_to_vp_drawlist (oli::sd-inq-current-vp) Baugruppe) (fit_vp (oli::sd-inq-current-vp)) (Auswahl) ) ; progn ) ("Materialauswahl") (MM8.8 :value-type :boolean :toggle-type :grouped-toggle :title "M8.8" :after-input (Auswahl) :initial-value t );MM8.8 (MM10.9 :value-type :boolean :toggle-type :grouped-toggle :title "M10.9" :after-input (Auswahl) :initial-value t );MM10.9 (MM12.9 :value-type :boolean :toggle-type :grouped-toggle :title "M12.9" :after-input (Auswahl) :initial-value t );MM12.9 (MM1.3505 :value-type :boolean :toggle-type :grouped-toggle :title "1.3505" :after-input (Auswahl) :initial-value t );MM1.3505 (MMessing :value-type :boolean :toggle-type :grouped-toggle :title "Messing" :after-input (Auswahl) :initial-value t );MMessing (MMessingNickel :value-type :boolean :toggle-type :grouped-toggle :title "MessingNickel" :after-input (Auswahl) :initial-value t );MessingNickel (MAluminium :value-type :boolean :toggle-type :grouped-toggle :title "Aluminium" :after-input (Auswahl) :initial-value t );MAluminium (MKupfer :value-type :boolean :toggle-type :grouped-toggle :title "Kupfer" :after-input (Auswahl) :initial-value t );Kupfer (MViton :value-type :boolean :toggle-type :grouped-toggle :title "Viton" :after-input (Auswahl) :initial-value t );MViton (MC15E :value-type :boolean :toggle-type :grouped-toggle :title "C15E" :after-input (Auswahl) :initial-value t );C15E (M45H :value-type :boolean :toggle-type :grouped-toggle :title "45H" :after-input (Auswahl) :initial-value t );M45H (MMPC :value-type :boolean :toggle-type :grouped-toggle :title "PC" :after-input (Auswahl) :initial-value t );MPC (Schuetzen :title "Teile Schützen" :toggle-type :wide-toggle ; :push-action (Anwenden) :push-action (Anwenden);(sd-put-buffer "secure_part_from_section :secured_parts :section_feature_in_general :secure") ) ) ; Variables :local-functions'( (Auswahl () (if MM8.8 (setq M8.8 (/ 7.8508 1000)) (setq M8.8 (/ 1000 1000)) ) (if MM10.9 (setq M10.9 (/ 7.8507 1000)) (setq M10.9 (/ 1000 1000)) ) (if MM12.9 (setq M12.9 (/ 7.8506 1000))(setq M12.9 (/ 1000 1000)) ) (if MM1.3505 (setq M1.3505 (/ 7.8005 1000)) (setq M1.3505(/ 1000 1000)) ) (if MMessing (setq Messing (/ 8.5001 1000))(setq Messing(/ 1000 1000)) ) (if MMessingNickel (setq MessingNickel (/ 8.500101 1000))(setq MessingNickel(/ 1000 1000)) ) (if MAluminium (setq Aluminium (/ 2.7801 1000))(setq Aluminium(/ 1000 1000)) ) (if MKupfer (setq Kupfer (/ 8.9201 1000)) (setq Kupfer(/ 1000 1000)) ) (if MViton (setq Viton (/ 1.9601 1000)) (setq Viton(/ 1000 1000)) ) (if MC15E (setq C15E (/ 7.8514 1000)) (setq C15E(/ 1000 1000)) ) (if M45H (setq 45H (/ 7.8513 1000)) (setq 45H(/ 1000 1000)) ) (if MMPC (setq MPC (/ 1.2001 1000)) (setq MPC(/ 1000 1000)) ) (if (equal Baugruppe nil) (progn (display (format nil "Baugruppe angeben!!!"))) (progn (clear_vp (oli::sd-inq-current-vp)) (SW_Dichte_Suchen Baugruppe M8.8 M10.9 M12.9 M1.3505 Messing MessingNickel Aluminium Kupfer Viton C15E 45H MPC) ); progn );if ); Auswahl (Anwenden () (setf Darstellungsliste (sd-inq-vp-drawlist-objects (oli::sd-inq-current-vp))) ;; aktuelle Datellungsliste am Bildschirm erfassen ; (setf teileliste (remove-if-not :test #'sd-inq-part-p darstellungsliste)) ;; Walter Geppert löscht Baugruppen ;; http://www.clausbrod.de/cgi-bin/view.pl/Blog/DefinePrivatePublic20150404FlacheHierarchien ;; auch mal schauen (dolist (Einzelteil Darstellungsliste) ;; Liste einzeln abbarbeiten (DISPLAY (sd-inq-obj-pathname Einzelteil)) ; (secure_part_from_section :secured_parts Einzelteil :section_feature_in_general :secure complete ) );;dolist ;;; Code von Wolfgang testen (setq partsOnly nil) (dolist (a-item Darstellungsliste) (when (SD-INQ-ASSEMBLY-P a-item) (nconc partsOnly (get_selection *sd-part-seltype* :select :in-assembly a-item :recursive))) (when (SD-INQ-PART-P a-item) (push a-item partsOnly)) ;; workplanes and other stuff is ignored! ) ); Anwenden ); local-functions :ok-action '() :cancel-action '() :help-action '(sd-display-message " 2017-11-09 SW: erstellt von Wolfgang Seel schnelles Schützen der aller Teile in Annotation mit folgenden Materialien : 8.8 10.9 12.9 1.3505 u.s.w. Viel Spaß beim Teile schützen !!! " :title "SW-Teile-Schuetzen.lsp" :push "Weiter") );;sd-defdialog #| (sd-call-cmds (OLI::SET_PART_BASE_DENSITY :parts Auswahl :dens (/ Dichte 1000)))) ;;; Dichte setzen |# (defun SW_Dichte_Suchen (Baugruppe M8.8 M10.9 M12.9 M1.3505 Messing MessingNickel Aluminium Kupfer Viton C15E 45H MPC) (let (teiletyp kind kinder teildicht) (setf teiletyp (sel_item-type Baugruppe)) (if (equal teiletyp *sd-part-seltype*) (progn (setf teildicht (sd-inq-part-density Baugruppe)) ; (if (and (<= Dichte1 teildicht) (>= Dichte2 teildicht)) ;; funktioniert im Bereich Range ; (if (and (<= Dichte1 teildicht) (>= Dichte1 teildicht)) (if (or (= M12.9 teildicht) ;; Material 12.9 (= M10.9 teildicht) ; Material 10.9 (= M8.8 teildicht) ; Material 8.8 (= M1.3505 teildicht) ; Material 1.3505 (= Messing teildicht) ; Messing (= MessingNickel teildicht) ; MessingNickel (= Aluminium teildicht) ; MessingNickel (= Kupfer teildicht) ; Kupfer (= Viton teildicht) ; MessingNickel (= C15E teildicht) ; MessingNickel (= 45H teildicht) ; MessingNickel (= MPC teildicht) ; MessingNickel ) ; or (progn ;;; ab hier auszuführender Code, Teil hat die richtige Dichte ; (display (format nil "~a:~a~a" (sd-inq-obj-pathname Baugruppe) (code-char 9) teildicht)) ;;; Ausgabe der Zutreffenden Liste als DISPLAY-Ausgabe (add_to_vp_drawlist (oli::sd-inq-current-vp) (sd-inq-obj-pathname Baugruppe)) ;; Treffer wird eingeblendet );;progn nil );;if );;progn ;; else (when (equal teiletyp *sd-assembly-seltype*) (progn (setf kinder (sd-inq-obj-children Baugruppe)) (dolist (kind kinder) (SW_Dichte_Suchen kind M8.8 M10.9 M12.9 M1.3505 Messing MessingNickel Aluminium Kupfer Viton C15E 45H MPC) ) ;; dolist ) ;; progn ) ;; when ) ;; if ) ;; let )