;;----------------------------------------------------------------------------- ;; for PTC Creo Elements/Direct Modeling ;; better known as CoCreate SolidDesigner ;; Description: ;; uility function to sort out instances and ;; reduce to one item per shared objects ;; input: list of object sel-items (shared and non-shared) ;; output: list of object sel-items - with uniq contents sys ids ;; ;;----------------------------------------------------------------------------- ;; ;; Filename : getOneItemPerContents.lsp ;; Version : 1.0 ;; Datum : 08dec2017 ;; Author : der_Wolfgang@forum@cad.de ;; Download : http://ww3.cad.de/foren/ubb/uploads/der_Wolfgang/getOneItemPerContents.lsp ;; SD-Version : developed with 19.00 - might be compatible with 13.x, too ;; Reference : http://ww3.cad.de/foren/ubb/Forum92/HTML/000888.shtml ;; ;;----------------------------------------------------------------------------- (in-package :cad-de-der-Wolfgang) (use-package :oli) (export 'getOneItemPerContents) (defun getOneItemPerContents (objects) (let (ids uniq-objs c-sys-id) (dolist (a-item objects) (setq c-sys-id (sd-inq-obj-contents-sysid a-item)) (unless (find c-sys-id ids :test #'sd-string=) (push c-sys-id ids) (push a-item uniq-objs) ) ) ;; end dolist ;; return uniq-objs ) ;; end let ) ;; end getOneItemPerContents