;********************************************************************************************* ; Dateiname : SD_Teile_nach_Benennung_loeschen.lsp ; Autor : Stephan Wörz nach Vorlage von Claus Brod ; Erstellt : 2005 ; geändert : ;********************************************************************************************* ; Beschreibung: - Teile anhand der Browserbenennung selektieren und löschen ; - ;********************************************************************************************* ; Änderungen ; ;********************************************************************************************* (use-package :oli) (sd-defdialog 'SD_Teile_nach_Benennung_loeschen :dialog-title "LOESCHE AUSWAHL" :toolbox-button t ;; ================================================================================================================================================= :variables '( ;; ------------------------------------------------------------------------------------------------------------------------------------------------- (Baugruppe :value-type :assembly :modifies :contents :prompt-text "Baugruppe angeben" :title "Baugruppe" :initial-value nil :after-input (progn (after-bgr-action) (CountItems) (ButtonAktiv) :modifies nil );end progn );end Baugruppe ;; ================================================================================================================================================= ("NUR AUF TEILEEBENE") ;; Kategorie im UI ;; ------------------------------------------------------------------------------------------------------------------------------------------------- (SuchString :value-type :string :title "SCHLUESSEL" :initial-value "N_*" :proposals ("N_*" "A_Handlag*" "Z_Zusa*") :prompt-text "Suchschluessel eingeben" ); end Suchstring (DelPattern :title "SCHLUESSEL LOESCHEN" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (mapcar #'DELETEFN Teile) (CountItems) ;;aktualisieren der Statistik );end progn );end DelPattern (DispPattern :title "SCHLUESSEL ANZEIGEN" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (sd-call-cmds (clear_vp (sd-inq-current-vp))) (mapcar #'DisplayFN Teile) );end progn );end DispPattern ;;;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; ================================================================================================================================================= ("TEILEUMFANG") ;; Kategorie im UI (AnzTeile :value-type :display-only :title "Teile gesamt" ); end AnzTeile ;; --------------------------------------------------------- ;; (STATISTIK :expand-shrink (AnzUnterbaugruppe AnzVolumenteile AnzFaceparts AnzWireparts AnzBehaelter AnzA-Saetze)) (AnzUnterbaugruppe :value-type :display-only :title "Unterbaugr." ); end AnzUnterbaugruppe ;; --------------------------------------------------------- (AnzVolumenteile :value-type :display-only :title "Volumenteile" ); end AnzVolumenteile ;; --------------------------------------------------------- (AnzFaceparts :value-type :display-only :title "Flaechenteile" ); end AnzFaceparts ;; --------------------------------------------------------- (AnzWireparts :value-type :display-only :title "Drahtteile" ); end AnzWireparts ;; --------------------------------------------------------- (AnzBehaelter :value-type :display-only :title "Behaelter" ); end AnzBehaelter ;; --------------------------------------------------------- (AnzA-Saetze :value-type :display-only :title "AnsSaetze" ); end AnzA-Saetze ;; ================================================================================================================================================= ("ANZEIGEN") ;; Kategorie im UI ;; ------------------------------------------------------------------------------------------------------------------------------------------------- (DispHandlager :title "HANDLAGER BGR." :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "A_Handlager*") (setf Teile (sd-call-cmds (get_selection :focus_type *SD-ASSEMBLY-SELTYPE* :select :recursive :in_assembly Baugruppe))) (sd-call-cmds (clear_vp (sd-inq-current-vp))) (mapcar #'DisplayFN Teile) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) (CountItems) ;;aktualisieren der Statistik );end progn );end DispHandlager ;;;; ------------------------------------------------------------------------------------------------------------------------------------------------- (DispFaceParts :title "FLAECHENTEILE" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "*") (setf FaceParts (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_face_part :check_function #'(lambda (pa) (if (sd-inq-face-part-p pa) :ok :filter)) :select :recursive :in_assembly Baugruppe))) (sd-call-cmds (clear_vp (sd-inq-current-vp))) (mapcar #'DisplayFN FaceParts) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) (CountItems) ;;aktualisieren der Statistik );end progn );end DispFaceParts ;;;; ------------------------------------------------------------------------------------------------------------------------------------------------- (DispWireParts :title "DRAHTTEILE" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "*") (setf WireParts (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_wire_part :check_function #'(lambda (pa) (if (sd-inq-wire-part-p pa) :ok :filter)) :select :recursive :in_assembly Baugruppe))) (sd-call-cmds (clear_vp (sd-inq-current-vp))) (mapcar #'DisplayFN WireParts) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) );end progn );end DispFaceParts ;;;; ------------------------------------------------------------------------------------------------------------------------------------------------- ("LOESCHEN") ;; Kategorie im UI ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Löschen aller Baugruppen (*SD-ASSEMBLY-SELTYPE*) deren Browserbenennung mit "A_Handlager*" beginnt (DelHandlager :title "HANDLAGER BGR." :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "A_Handlager*") (setf Teile (sd-call-cmds (get_selection :focus_type *SD-ASSEMBLY-SELTYPE* :select :recursive :in_assembly Baugruppe))) (mapcar #'DELETEFN Teile) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) (CountItems) ;;aktualisieren der Statistik );end progn );end DelHandlager ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Löschen aller Ansichtensätze (*sd-layout-seltype*) (DelA-Satz :title "ANSICHTENSAETZE" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "*") (setf Teile (sd-call-cmds (get_selection :focus_type *sd-layout-seltype* :select :recursive :in_assembly Baugruppe))) (mapcar #'DELETEFN Teile) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) (CountItems) ;;aktualisieren der Statistik );end progn );end DelA-Satz ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Löschen aller Flächenteile (*sd-part-seltype* :allow_face_part) (DelFaceParts :title "FLAECHENTEILE" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "*") (setf FaceParts (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_face_part :check_function #'(lambda (pa) (if (sd-inq-face-part-p pa) :ok :filter)) :select :recursive :in_assembly Baugruppe))) (mapcar #'DELETEFN FaceParts) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) (CountItems) ;;aktualisieren der Statistik );end progn );end DelFaceParts ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Löschen aller Drahtteile (*sd-part-seltype* :allow_wire_part) (DelWireParts :title "DRAHTTEILE" :toggle-type :wide-toggle :initial-enable nil :push-action (progn (setf Suchstring "*") (setf WireParts (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_wire_part :check_function #'(lambda (pa) (if (sd-inq-wire-part-p pa) :ok :filter)) :select :recursive :in_assembly Baugruppe))) (mapcar #'DELETEFN WireParts) (setf Suchstring "") ;;Vorgabe für Variable Suchstring setzen (after-bgr-action) ;;zurücksetzen auf Teile (*sd-part-seltype*) (CountItems) ;;aktualisieren der Statistik );end progn );end DelWireParts ;; ------------------------------------------------------------------------------------------------------------------------------------------------- );end variables ;; ================================================================================================================================================= :local-functions '( ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Function zum löschen der selektierten Teile (DELETEFN (item) (when (sd-string-match-pattern-p SuchString (sd-inq-obj-basename item)) (sd-call-cmds (delete_3d (sd-inq-obj-pathname item)))) );end DELETEFN ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Funktion zum wählen aller Teile rekursiv in Baugruppe (after-bgr-action () (setf Teile (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_face_part :allow_wire_part :select :recursive :in_assembly Baugruppe))) );end after-bgr-action ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Function zum anzeigen der selektierten Teile (DisplayFN (item) (when (sd-string-match-pattern-p SuchString (sd-inq-obj-basename item)) (sd-call-cmds (add_to_vp_drawlist (sd-inq-current-vp)(sd-inq-obj-pathname item)))) (fit_vp (sd-inq-current-vp)) ); end DisplayFN ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Funktion zum aktivieren der Buttons nach Auswahl einer Baugruppe (ButtonAktiv () (sd-set-variable-status 'DelHandlager :enable t ) (sd-set-variable-status 'DelFaceParts :enable t ) (sd-set-variable-status 'DelWireParts :enable t ) (sd-set-variable-status 'DelA-Satz :enable t ) (sd-set-variable-status 'DelPattern :enable t ) (sd-set-variable-status 'DispHandlager :enable t ) (sd-set-variable-status 'DispFaceParts :enable t ) (sd-set-variable-status 'DispWireParts :enable t ) (sd-set-variable-status 'DispPattern :enable t ) ); end ButtonAktiv ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ;; Zählen der Baugruppen und Teile (CountItems () (let (vdteil vfteil) (setf AnzUnterbaugruppe (length (sd-call-cmds (get_selection :focus_type *sd-assembly-seltype* :select :recursive :in_assembly Baugruppe)))) (setf AnzTeile (length (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_wire_part :allow_face_part :select :recursive :in_assembly Baugruppe)))) (setf AnzVolumenteile (length (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_wire_part :allow_face_part :check_function #'(lambda (si) (let () (if (or (sd-inq-face-part-p si) (sd-inq-wire-part-p si)) :filter :ok );;if );;let );;lambda :select :recursive :in_assembly Baugruppe)))) (setf vdteil (length (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_wire_part :allow_face_part :check_function #'(lambda (si) (let () (if (sd-inq-face-part-p si) :filter :ok );;if );;let );;lambda :select :recursive :in_assembly Baugruppe)))) (setf vfteil (length (sd-call-cmds (get_selection :focus_type *sd-part-seltype* :allow_wire_part :allow_face_part :check_function #'(lambda (si) (let () (if (sd-inq-wire-part-p si) :filter :ok );;if );;let );;lambda :select :recursive :in_assembly Baugruppe)))) (setf vcntteil (length (sd-call-cmds (get_selection :focus_type *sd-assembly-seltype* :allow_wire_part :allow_face_part :check_function #'(lambda (si) (let () (if (sd-inq-container-p si) :filter :ok );;if );;let );;lambda :select :recursive :in_assembly Baugruppe)))) (setf AnzA-Saetze (length (sd-call-cmds (get_selection :focus_type *sd-layout-seltype* :select :recursive :in_assembly Baugruppe)))) (setf AnzWireparts (- vdteil AnzVolumenteile )) (setf AnzFaceparts (- vfteil AnzVolumenteile )) (setf AnzBehaelter (- AnzUnterbaugruppe vcntteil)) );;let ); end CountItems ); end local functions ;; ------------------------------------------------------------------------------------------------------------------------------------------------- ; :ok-action ' (mapcar #'DELETEFN Teile) :help-action ' (progn (sd-display-url ( Format NIL "~A/SD_Teile_nach_Benennung_loeschen.htm" (oli::sd-convert-filename-from-platform (oli::sd-sys-getenv "SCHILLERHELPDIR")))) ); end progn )