below is some code for doing a multiple purge on a drawing this is part of a bigger routine that does multiple things. i have looked at this several times and i just cannot find the problem. also in the code do i need to replace the word "blocks" with "insert" please help.
(defun c:MyPurge (Doc / );;;tried this both ways, as (defun c:MyPurge (Doc / ) and (defun MyPurge (Doc / )
(if (not Doc)
(setq Doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
)
(repeat 2
(foreach i '("Blocks" "DimStyles" "Linetypes" "Layers" "TextStyles")
(vlax-for Obj (vlax-get Doc i)
(vl-catch-all-apply 'vla-Delete (list Obj))
)
)
)
(princ)
)
(defun c:MyPurge (Doc / );;;tried this both ways, as (defun c:MyPurge (Doc / ) and (defun MyPurge (Doc / )
(if (not Doc)
(setq Doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
)
(repeat 2
(foreach i '("Blocks" "DimStyles" "Linetypes" "Layers" "TextStyles")
(vlax-for Obj (vlax-get Doc i)
(vl-catch-all-apply 'vla-Delete (list Obj))
)
)
)
(princ)
)