Calling CopyBaseData()

The ShapeObject class has a method, ShapeObject::CopyBaseData(), which is used by derived classes to make sure that, when they copy themselves, they are also copying the data in the ShapeObject. This is usually used in the assignment operator of derived classes. It is also used in the ShallowCopy method of objects that are passed up the modifier pipeline. In this case, it is vital that you surround all calls to ShapeObject::CopyBaseData() with calls to Hold::Suspend() and Hold::Resume().

theHold.Suspend();
CopyBaseData(*fob);
theHold.Resume();

If this is not done, when certain undo functions are performed, a crash can occur due to the temporary pipeline object being destroyed. Just remember to wrap the call as shown in any code that is used as part of the modifier pipeline evaluation.