this guy right here is the winner! Worked perfectly, and exactly how I wanted.
now, if I can only get a code to get management OFF
my layer!
Give this a whirl...be warned that it deletes audited items (which in this case seemed to be empty blocks).
(defun c:allzero (/ doc makesmecry rjp-progress n ss)
(vl-load-com)
(setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vla-auditinfo doc :vlax-true)
(vla-purgeall doc)
(vlax-for i (vla-get-Layers doc)
(vla-put-lock i :vlax-false)
)
(vl-catch-all-apply 'setvar (list 'clayer "0"))
(defun makesmecry (obj / p)
(foreach p '(Color Linetype Lineweight)
(if (vl-position (vlax-get-property obj p) '(256 -1 "ByLayer"))
(vl-catch-all-apply
'vlax-put-property
(list obj
p
(vlax-get-property
(vlax-ename->vla-object
(tblobjname "layer" (vla-get-layer obj))
)
p
)
)
)
)
)
(vl-catch-all-apply
'vlax-put-property
(list obj 'Layer "0")
)
(princ)
)
(vlax-for blk (vla-get-blocks doc)
(vlax-for i blk
(makesmecry i)
(if (= (vla-get-ObjectName i) "AcDbBlockReference")
(foreach j (append (vlax-invoke i 'GetAttributes)
(vlax-invoke i 'GetConstantAttributes)
)
(makesmecry j)
)
)
)
)
;;deletes audited crap so be forewarned
(if (setq ss (ssget "x" '((2 . "AUDIT*"))))
(foreach x (mapcar 'cadr (ssnamex ss))
(entdel x)
)
)
(repeat 3 (vla-purgeall doc))
)