Attaching Reactors to AutoCAD Drawings). Even a simple thing such as a locked layer can prevent you from changing an object's properties.
If other applications are working with any AutoCAD objects at the same time as your program, those objects may not be accessible. This is especially important to look out for if your application includes reactors, because reactors execute code segments in response to external events that cannot be predicted in advance (seeVLISP provides the following functions to test the accessibility of an object before trying to use the object:
T if true, nil if false. The following examples test a line object:
These test functions returnDetermine whether the line is readable:
$ (vlax-read-enabled-p WhatsMyLine)
T
Determine whether the line is modifiable:
$ (vlax-write-enabled-p WhatsMyLine)
T
See if the line has been erased:
$ (vlax-erased-p WhatsMyLine)
nil
WhatsMyLine:
Erase_$ (vla-delete WhatsMyLine)
nil
WhatsMyLine is still readable:
Issue vlax-read-enabled-p to see if$ (vlax-read-enabled-p WhatsMyLine)
nil
vlax-erased-p again to confirm the object was deleted:
Issue$ (vlax-erased-p WhatsMyLine)
T