;;--------------------------------------------------------------------------* ;; Modulbeschreibung: ;; Zeigt Teile in neuen Darstellungsfenster an ;;--------------------------------------------------------------------------* ;; Dateiname: Anzeige_im_neuen_Fenster.lsp ;; Version : 1.0 ;; Datum : 14.11.2017 ;; Author : MiBr ;;--------------------------------------------------------------------------* ;;Erstellt aus Lisp: ;; SW-Teile-Suchen.lsp 07.03.2016 von Wolfgang Seel ;; Anzeige-im_neuen_Fenster.lsp -> osd.cad.de ;;--------------------------------------------------------------------------* (in-package :custom) (use-package :oli) (sd-defdialog 'Objekte_im_neuen_Fenster_anzeigen :dialog-title "Teile im neuem Fenster einblenden" ;:dialog-type :interrupt :toolbox-button nil :after-initialization '(Activ_Fenster) :variables '( ("Auswahl nach") (Teil_kli :prompt-text "Teile anklicken, die im neuem Fenster angezeigt werden sollen" :title "Fenster" :toggle-type :grouped-toggle :value-type :boolean :indicator-type :diamond :initial-value t :after-input (Activ_Fenster) ) (Teil_txt :prompt-text "Teile nach Exemplarname suchen, die im neuen Fenster angezeigt werden sollen" :title "Name" :toggle-type :grouped-toggle :value-type :boolean :indicator-type :diamond :initial-value nil :after-input (Activ_Benennung) ) ("Optionen") (Stl_hinzu :prompt-text "Gefundene Teile/Baugeruppen zum Darstellungsfenster hinzufügen" :title "hinzu" :toggle-type :grouped-toggle :value-type :boolean :initial-value t :initial-enable nil :after-input (setf Stl_entf nil) ) (Stl_entf :prompt-text "Gefundene Teile/Baugruppen aus Darstellungsfenster entfernen" :title "entfernen" :toggle-type :grouped-toggle :value-type :boolean :initial-value nil :initial-enable nil :after-input (setf Stl_hinzu nil) ) (Fenst_neu :prompt-text "Gefundene Teile im neuem Darstellungsfenster anzeigen" :title "neues Fenst." :toggle-type :grouped-toggle :value-type :boolean :initial-value t :after-input (if Fenst_neu (progn (sd-set-variable-status 'Stl_hinzu :enable nil) (sd-set-variable-status 'Stl_entf :enable nil) (setf Stl_entf nil)) (progn (sd-set-variable-status 'Stl_hinzu :enable t) (sd-set-variable-status 'Stl_entf :enable t)) ) ;end if ) (Fenst_sch :title "Fenster schließen" :toggle-type :grouped-toggle :push-action (schlies_vp) ) (Fen_sch_W :title "Fenster schließen" :toggle-type :wide-toggle :push-action (schlies_vp) ) (Struktur :prompt-text "Sollen gefundene Teile in der Strukturliste markiert werden?" :title "In Struckturliste markieren" :toggle-type :wide-toggle :value-type :boolean :initial-value nil ) (Ueber :title "Auswahl nach Exemplarname") (Such_teile :prompt-text "Teile in Suche einbeziehen" :title "Teile" :toggle-type :grouped-toggle :value-type :boolean :indicator-type :diamond :initial-value t :after-input (if Such_bgr nil (setf Such_bgr t)) ) (Such_bgr :prompt-text "Baugruppen in Suche einbeziehen" :title "Baugruppen" :toggle-type :grouped-toggle :value-type :boolean :indicator-type :diamond :initial-value t :after-input (if Such_teile nil (setf Such_teile t)) ) (Baugruppe :value-type :assembly :modifies nil :modifies :contents :prompt-text "Baugruppe angeben" :title "in Baugruppe" :initial-value "/" );end Baugruppe (SuchString :value-type :string :title "Suche nach" :proposals ("") :auto-add-proposal t :persistent-data-storage t :max-proposals 10 :prompt-text "Suche eingeben" );;SuchString (Suche_go :title "Suche starten" :toggle-type :wide-toggle :push-action (Suche_ben) ) (Ueber2 :title "Auswahl im Darstellungsfenster") (SuchPart :selection (*sd-object-seltype*) :prompt-text "Auswahl im Darstellungsfenster" :title "Teil/e" :initial-value nil :face-part-allowed t :show-select-menu nil :multiple-items t :after-input (Suche_fen) );end Baugruppe ) :ok-action ' (sd-delete-browser-search "parcel-gbrowser" "DUMMY") :cancel-action ' (sd-delete-browser-search "parcel-gbrowser" "DUMMY") :local-functions '( ;------------------------------------- ;Suche starten nach Auswahl im Fenster ;------------------------------------- (Suche_fen () (sd-call-cmds (create_vp :default_appearance)) (sd-call-cmds (oli:sd-call-win-command-by-sysid #xE134)) (sd-call-cmds (add_to_vp_drawlist (sd-inq-current-vp) SuchPart)) (fit_vp (sd-inq-current-vp)) (setf Fenst_neu nil) (sd-set-variable-status 'Stl_hinzu :enable t) (sd-set-variable-status 'Stl_entf :enable t) ) ;end Suche_fen ;---------------------------- ;Suche starten nach Benennung ;---------------------------- (Suche_ben () ;Automatische *x* ? (setq string (format nil "~a" (sd-string-downcase SuchString))) ;Falls such mal mit Sternchen sein soll "*~a*" (setq SuchString string) ;Neues Fenster erstellen (if Fenst_neu (progn (sd-call-cmds (create_vp :default_appearance)) (sd-call-cmds (oli:sd-call-win-command-by-sysid #xE134)) (setf Fenst_neu nil) (sd-set-variable-status 'Stl_hinzu :enable t) (sd-set-variable-status 'Stl_entf :enable t)) ) ; (if (or Stl_hinzu Stl_entf) () ; (sd-call-cmds (clear_vp (sd-inq-current-vp))) ; ) ;endif ;Bauteile Ausblenden oder Einblenden (if Stl_entf (progn (if Such_bgr (progn (after-bgr-action) (mapcar #'HideFN bgr))) (if Such_teile (progn (after-teil-action) (mapcar #'HideFN teile))) )) (if Stl_hinzu (progn (if Such_bgr (progn (after-bgr-action) (mapcar #'DisplayFN bgr))) (if Such_teile (progn (after-teil-action) (mapcar #'DisplayFN teile))) )) ;in Strukturliste markieren (if Struktur (progn (CreateSearch) (ActivateSearch)) );endif (if Fenst_neu (fit_vp (sd-inq-current-vp))) ) ;end Suche_ben ;----------------- ;Fenster schließen ;----------------- (schlies_vp () (when (oli::sd-inq-current-vp) (progn (if (oli::sd-string/= (oli::sd-inq-current-vp) "1") (progn (sd-call-cmds (delete_vp (oli::sd-inq-current-vp))) (setf Fenst_neu t) (setf Stl_entf nil) (setf Stl_hinzu t) (sd-set-variable-status 'Stl_hinzu :enable nil) (sd-set-variable-status 'Stl_entf :enable nil) )) (if (oli::sd-string/= (oli::sd-inq-current-vp) "1") () (progn (sd-call-cmds (sd-maximize-vp (oli::sd-inq-current-vp))))) )) ) ;------------------------------------------- ;; Filter zur Such im Strukturbau hinzufügen ;------------------------------------------- (CreateSearch () (sd-create-browser-search "parcel-gbrowser" :name "DUMMY" :title "DUMMY" :criteria `( (:column :instance-name :Operation :equals :value ,SuchString)) :match :all :case-sensitive nil :enable t );;sd-create-browser-search );;CreateSearch ;------------------------ ; Strukturbaum aktivieren ;------------------------ (ActivateSearch () (sd-set-current-browser-search "parcel-gbrowser" "DUMMY" :activate t :persistent nil );;sd-set-current-browser-search );;ActivateSearch ;------------------------ ; Felder EIN und AUS ;------------------------ (Activ_Fenster () (progn (sd-set-variable-status 'Stl_hinzu :visible nil) (sd-set-variable-status 'Stl_entf :visible nil) (sd-set-variable-status 'Fenst_neu :visible nil) (sd-set-variable-status 'Fenst_sch :visible nil) (sd-set-variable-status 'Fen_sch_W :visible t) (sd-set-variable-status 'Struktur :visible nil) (sd-set-variable-status 'Ueber :visible nil) (sd-set-variable-status 'Such_teile :visible nil) (sd-set-variable-status 'Such_bgr :visible nil) (sd-set-variable-status 'Baugruppe :visible nil) (sd-set-variable-status 'SuchString :visible nil) (sd-set-variable-status 'Suche_go :visible nil) (sd-set-variable-status 'Ueber2 :visible t) (sd-set-variable-status 'SuchPart :visible t) (setf Teil_txt nil)) ) (Activ_Benennung () (progn (sd-set-variable-status 'Stl_hinzu :visible t) (sd-set-variable-status 'Stl_entf :visible t) (sd-set-variable-status 'Fenst_neu :visible t) (sd-set-variable-status 'Fenst_sch :visible t) (sd-set-variable-status 'Fen_sch_W :visible nil) (sd-set-variable-status 'Struktur :visible t) (sd-set-variable-status 'Ueber :visible t) (sd-set-variable-status 'Such_teile :visible t) (sd-set-variable-status 'Such_bgr :visible t) (sd-set-variable-status 'Baugruppe :visible t) (sd-set-variable-status 'SuchString :visible t) (sd-set-variable-status 'Suche_go :visible t) (sd-set-variable-status 'Ueber2 :visible nil) (sd-set-variable-status 'SuchPart :visible nil) (setf Teil_kli nil)) ) ;-------------------------------------------------------------- ;; Funktion zum wählen aller Baugruppen rekursiv in Baugruppe ;-------------------------------------------------------------- (after-bgr-action () (setf bgr (sd-call-cmds (get_selection :focus_type *sd-assembly-seltype* :with_stock_container :allow_face_part :allow_wire_part :select :recursive :in_assembly Baugruppe)) ) );end after-bgr-action ;--------------------------------------------------------- ;; Funktion zum wählen aller Teile rekursiv in Baugruppe ;---------------------------------------------------------- (after-teil-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 ;---------------------------------------------- ;; Funktion zum anzeigen der selektierten Teile ;---------------------------------------------- (DisplayFN (item) (when (match-p SuchString item) (progn (sd-call-cmds (add_to_vp_drawlist (sd-inq-current-vp)(sd-inq-obj-pathname item)))) ) ); end DisplayFN ;------------------------------------------------ ;; Funktion zum ausblenden der selektierten Teile ;------------------------------------------------ (HideFN (item) (when (match-p SuchString item) (sd-call-cmds (remove_from_vp_drawlist (sd-inq-current-vp)(sd-inq-obj-pathname item))) ) ); end DisplayFN ;----------------------------------------------------- ;; Funktion zum checken des Teilenames CaseINsensitive ;----------------------------------------------------- (match-p (searchStr item) (sd-string-match-pattern-p searchStr (sd-string-downcase (sd-inq-obj-basename item))) ) ); end local functions );;sd-defdialog