Implementing Member Functions

When you define a new member function or override an existing function, the first call you usually make is assertReadEnabled(), assertWriteEnabled(), or assertNotifyEnabled() to verify that the object is open in the correct state. Of these three functions, assertWriteEnabled() is the most important. You can use this function to control undo recording of the modification that is occurring in the member function. (See Undo and Redo.) Even if you don't desire undo recording, it is essential to call

assertWriteEnabled(kFalse, kFalse);

This call marks the object for incremental save. Failure to follow this instruction can result in corrupted drawings.

The following table shows the three possible states for opening an object (read, write, notify) and indicates which assert calls succeed for each state. If the object is not open in one of the allowed states for the assert function call, the function does not return. AutoCAD ® exits, and the user is prompted to save the drawing.