Hello .
Here is a routine that I have just finished writing it , but the start undo besides end undo functions are not working with it after
invoking the routine .
Any thoughts please ?
(defun c:TesT (/ *error* acdoc Blocks)
; Tharwat 07. 03. 2011
(vl-load-com)
(defun *error* (msg)
(and (vla-EndUndoMark acdoc))
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **"))
)
(princ)
)
(setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(vla-StartUndoMark acdoc)
(vlax-for Blocks
(vla-get-blocks
(setq
acdoc (vla-get-activedocument (vlax-get-acad-object))
)
)
(if (and (eq (vla-get-isXref Blocks) :vlax-false)
(eq (vla-get-isLayout Blocks) :vlax-false)
)
(vlax-for vl Blocks
(vla-put-color vl 256)
)
)
)
(vla-regen acdoc acActiveViewport)
(vla-EndUndoMark acdoc)
(princ)
)
Thanks.
Tharwat