Share

AcDbObject::subHandOverTo

C++

virtual ACDBCORE2D_PORT Acad::ErrorStatus subHandOverTo(
    AcDbObject* newObject
);

Description

Called from within handOverTo() before anything else is done. The default implementation is to return Acad::eOk. However, when overridden in custom classes, it provides a hook into the handOverTo operation. If it returns anything other than Acad::eOk, then the handOverTo operation is immediately terminated.

When overriding this function, a sequence of steps is required:

  1. Check to be sure everything is correct with the AcDbObject's state. If not, then immediately return a value other than Acad::eOk, which terminates the handOverTo operation.
  2. Call the parent class's subHandOverTo(). If this returns Acad::eOk, then continue; otherwise immediately return whatever the parent class's subHandOverTo() returned.
  3. Do any operations desired before the handOverTo operation continues.
  4. Return Acad::eOk to allow the handOverTo operation to continue normally.
Note

When implementing your own subHandOverTo(), it is best not to change any of the object's state at all. But, if you must, then it is best to make such changes after invoking the parent class's subHandOverTo(), just in case it returns an error code other than Acad::eOk. If you must change state before invoking the parent class's subHandOverTo(), then be prepared to reverse the changes if the parent class returns a status other than Acad::eOk.

Parameters

Parameters Description
newObject Passed in pointer to the object that is going to replace the object this subHandOverTo() is a part of

Links

AcDbObject

Was this information helpful?