This is a good time to use a reactor routine. In this case two reactors are required. The first is an acdb reactor and the second is a command ended reactor. The acdb reactor catches the modification event and makes a list of entities changed in the command and the command ended reactor changes the list of entities to be color 1 for example. You may find the actual creation of the entity will cause the entities to change but you can modifiy this routine to allow for not changing them upon creation.
Peter Jamtgaard
Code:
(defun evtObjectModified (objReactor lstObjectModified / objModified)
(setq objModified (vlax-ename->vla-object (cadr lstObjectModified)))
(if (and (wcmatch (vla-get-objectname objModified) "AcDbMText,AcDbText")
(not blnRerun))
(setq lstObjectsModified (cons objModified lstObjectsModified)))
(princ)
)
(defun evtCommandEnded (evtCall lstCallback / objModified)
(if lstObjectsModified
(progn
(setq blnRerun 'T)
(foreach objModified lstObjectsModified
(vla-put-color objModified 1))
(setq blnRerun nil
lstObjectsModified nil)))
(princ)
)
(setq rxnObjectModified (vlr-acdb-reactor nil '((:vlr-objectModified . evtObjectModified )))
rxnCommandEnded (vlr-editor-reactor nil '((:vlr-commandended . evtCommandEnded))))