; -*-Lisp-*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; PTC GmbH Confidential ; ; Description: Deletes DB and SolidPower attributes on parts. Not supported. ; Use at your own risk. ; Author: Sasa Plesko ; Created: Jul-8-2008 ; Modified: ; Language: Lisp ; Package: support ; ; (C) Copyright 2008 PTC GmbH, all rights reserved. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :support) (use-package :oli) (sd-defdialog 'Inq_attrib_all :dialog-name "Inq Attrib All" :variables '( (MY-PART :value-type :part ) ) :ok-action '(progn (display "instance") (display (sd-inq-item-attributes MY-PART :attachment :instance)) (display "contents") (display (sd-inq-item-attributes MY-PART :attachment :contents)) )) (sd-defdialog 'Del_attrib :dialog-title "Del all Attribs" :toolbox-button t ; mit nil erscheint das Makro nicht in der toolbox (sonst "t") :variables '( (MY_PART :value-type :part :title "Teil(e)" :multiple-items t :prompt-text "Teil(e) auswählen" ) (TS-ATTRIBS-INSTANCE :initial-value nil) (TS-ATTRIBS-CONTENTS :initial-value nil) ) :local-functions '( (delete-attributes (part) (setq TS-ATTRIBS-INSTANCE (sd-inq-item-attributes part :attachment :instance)) (setq TS-ATTRIBS-CONTENTS (sd-inq-item-attributes part :attachment :contents)) (when TS-ATTRIBS-INSTANCE (dolist (name TS-ATTRIBS-INSTANCE) (sd-detach-item-attribute part name :attachment :instance :set-modified t :check-read-only nil) )) (when TS-ATTRIBS-CONTENTS (dolist (name TS-ATTRIBS-CONTENTS) (sd-detach-item-attribute part name :attachment :contents :set-modified t :check-read-only nil) )) ) ) :ok-action '(let (input) (setf input (sd-display-question "Alle Attribute der ausgewählten Teile werden gelöscht. Wollen Sie wirklich fortfahren?")) (if (eql input :yes) (if (listp MY_PART) (dolist (item MY_PART) (delete-attributes item) ) (delete-attributes MY_PART) ) ) ) ) (sd-defdialog 'Check_ts_part :dialog-title "Check for copied Lib part" :variables '( (MY_PART :value-type :part :title "Teil(e)" :multiple-items t :prompt-text "Teil(e) auswählen" :modifies nil ) ) :ok-action '(let (result-list) (dolist (item MY_PART) (if (and (not (sd-inq-obj-contents-read-only-p item)) (member "TS-CATALOG-GRUPPE" (sd-inq-item-attributes item :attachment :contents) :test #'string=)) (push item result-list) ) ) (if (> (list-length result-list) 0) (progn (display "The following part(s) might be copied library parts:") (dolist (copied-part result-list) (display (format nil "~%~a" (sd-inq-obj-pathname copied-part))) ) ) (display "No possible copied library part(s) found") ) ) );;end of sd-defdialog