vlax-method-applicable-p and vlax-property-available-p functions to test the objects. These functions return T if the method or property is available for the object, and nil if it is not.
Trying to use a method that does not apply to the specified object will result in an error. Trying to reference a property that does not apply to an object also results in an error. In instances where you are not sure what applies, use thevlax-method-applicable-p is:
The syntax for(vlax-method-applicable-p objectmethod)
WhatsMyLine:
The following command checks to see if the Copy method can be applied to the object referenced by_$ (vlax-method-applicable-p WhatsMyLine "Copy")
T
The following command determines whether or not the AddBox method can be applied to the object:
_$ (vlax-method-applicable-p WhatsMyLine "AddBox")
nil
vlax-property-available-p, the syntax is:
For(vlax-property-available-p objectproperty [T])
WhatsMyLine:
For example, the following commands determine if Color and Center are properties of_$ (vlax-property-available-p WhatsMyLine "Color")
T
_$ (vlax-property-available-p WhatsMyLine "Center")
nil
“T†argument to vlax-property-available-p changes the meaning of the test. If you supply this argument, the function returns T only if the object has the property and the property can be modified. If the object has no such property or the property is read-only, vlax-property-available-p returns nil. For example, an ellipse contains an Area property, but you cannot update it. If you check the property without specifying the optional argument, the result is T:
Supplying the optional_$ (vlax-property-available-p myEllipse "area")
T
nil:
If you supply the optional argument, the result is_$ (vlax-property-available-p myEllipse "area" T)
nil