Author Topic: Again - File size is 4 MB  (Read 725 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17210
Re: Again - File size is 4 MB
« Reply #15 on: February 13, 2018, 09:50:39 AM »
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")         
    )
)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

HasanCAD

  • Swamp Rat
  • Posts: 1255
Re: Again - File size is 4 MB
« Reply #16 on: February 13, 2018, 09:58:20 AM »
Subset of one of my fav's (used when turning over dwgs to clients):
...
Many thanks MP for sharing

MP

  • Seagull
  • Posts: 17210
Re: Again - File size is 4 MB
« Reply #17 on: February 13, 2018, 10:12:35 AM »
You’re very welcome.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About