API Reference > OdDb Classes > OdDbBody Class > OdDbBody Methods > OdDbBody::decomposeForSave Method
OdDbBody::decomposeForSave Method
Syntax
C++
virtual OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId& replaceId, bool& exchangeXData);
Parameters 
Description 
OdDb::DwgVersion ver 
[in] Drawing version to save as.  
OdDbObjectId& replaceId 
[out] Object ID of the object replacing this object.  
bool& exchangeXData 
[out] Set to true if and only if this function did not add XData to the replacement object.
 

OdDbObjectPtr for a non-database-resident replacement object or NULL. See remarks for details.

Determines the behavior for custom objects when saving to a .dwg or .dxf file. 

 

This function either:

  • Returns an OdDbObjectPtr for a non-database-resident (NDBRO) replacement object, setting replaceId to OdDbObjectId::kNull.
  • Returns NULL, setting replaceId for a database-resident (DBRO) replacement object.

 

Custom objects can decompose themselves into other objects, adding additional XData as required. The Drawings transfers XData from this object to the replacement object if and only if exchangeXData is true. 

The default implementation returns NULL and sets replaceId to OdDbObjectId::kNull. This function can be overridden in custom classes. 

The method is not intended to be called by client code. For processing, owned objects use the convertForSave() method.

Copyright © 2002–2021. Open Design Alliance. All rights reserved.