0 Members and 2 Guests are viewing this topic.
Subset of one of my fav's (used when turning over dwgs to clients):Code: [Select](defun _JennyCraig ( doc ) ;; Remove all layer states, layer filters and groups from the ;; document (which may be an ObjectDBX document) but leave the ;; layer's xdict intact in case it's used to store other data. ;; Return T if any of the undesirables nuked. ( (lambda ( remove layers keys / owner result ) (and (eq :vlax-true (vla-get-hasextensiondictionary layers)) (setq owner (vla-getextensiondictionary layers)) (foreach key keys (remove owner key)) ) result ) (lambda ( owner key / lst offender ) (and (setq lst (list owner key)) (setq offender (vl-catch-all-apply 'vla-item lst)) (eq 'vla-object (type offender)) (vl-catch-all-apply 'vla-remove lst) (vl-catch-all-error-p (vl-catch-all-apply 'vla-item lst)) (setq result t) ;; lexical global ) ) (vla-get-layers doc) '("ACAD_LAYERSTATES" "ACAD_LAYERFILTERS" "ACLYDICTIONARY") ))
(defun _JennyCraig ( doc ) ;; Remove all layer states, layer filters and groups from the ;; document (which may be an ObjectDBX document) but leave the ;; layer's xdict intact in case it's used to store other data. ;; Return T if any of the undesirables nuked. ( (lambda ( remove layers keys / owner result ) (and (eq :vlax-true (vla-get-hasextensiondictionary layers)) (setq owner (vla-getextensiondictionary layers)) (foreach key keys (remove owner key)) ) result ) (lambda ( owner key / lst offender ) (and (setq lst (list owner key)) (setq offender (vl-catch-all-apply 'vla-item lst)) (eq 'vla-object (type offender)) (vl-catch-all-apply 'vla-remove lst) (vl-catch-all-error-p (vl-catch-all-apply 'vla-item lst)) (setq result t) ;; lexical global ) ) (vla-get-layers doc) '("ACAD_LAYERSTATES" "ACAD_LAYERFILTERS" "ACLYDICTIONARY") ))
Quote from: MP on February 12, 2018, 02:55:16 PMSubset of one of my fav's (used when turning over dwgs to clients):...
Subset of one of my fav's (used when turning over dwgs to clients):...