In most cases, the default implementation of deep cloning does not require customization. It works
via dwgInFields()
and dwgOutFields()
as described in the
Deep Cloning Process topic.
Customization may be required, for example, if some data structures that are not
pointed to with hard references also need to be cloned. Customization can be
implemented in two ways:
subDeepClone()
and subWblockClone()
methods of an object.This section contains samples of overriding the deepClone()
and
wblockClone()
functions in custom objects.
Note: The deepClone()
and wblockClone()
methods of any object should never be called directly in application code.
They should be called only as part of a chain of a properly
initiated deep
clone operation.
The deep clone behavior of an object can be customized in the copying stage only. The translation stage of the deep clone process
cannot be customized. Overriding an object's dwgInFields()
and dwgOutFields()
methods also influences the cloning behavior of the object since they are
used at the copying stage.
Note: If default cloning is overridden, it usually makes sense to prohibit cloning if a custom object is loaded as a proxy when its application module is missing.
To override the deepClone()
and
wblockClone()
functions in custom objects, see the following topics:
Overriding the deepClone() Function
Overriding the wblockClone() Function
Note: You don't need to override any methods of a custom
object to handle the insert operation. The insert operation, being just a
special case of a deep clone operation, utilizes the wblockClone()
function of an object.
Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.
|