User supplied callback procedure for converting AddOnObjects into previous format.
typedef GSErrCode APIAddonObjectSaveOldFormatHandlerProc ( API_FTypeID planFileType, const GS::Array<API_AddonObject>& currentFormatAddOnObjectArray, GS::Array<API_AddonObject>& oldFormatAddOnObjectArray );
- [in] The old format plan version the project is being saved.
- [in] AddOnObject data in current format.
- [out] Array for the converted AddOnObject data in old format.
- The function has completed with success.
For other common API errors see the API Errors document.
In order to save the add-on’s AddOnObject data in the proper format into a previous version project file, you need to implement this callback function, and pass it to Archicad with ACAPI_Install_AddOnObjectSaveOldFormatHandler during the Initialize phase. It is also necessary to notify Archicad about this capability of the add-on by calling ACAPI_Register_AddOnObjectHandler from the RegisterInterface function.
This handler function is called whenever the user saves the project into an older format, and the add-on has any AddOnObject stored currently into the project. The data should be constructed according to the required version into API_AddonObject structures, and these structures should be pushed into the oldFormatAddOnObjectArray array.
The memory allocated for the converted AddOnObjects by the add-on’s handler function will be released by the caller application.
If you need to delete an AddOnObject (e.g. it cannot be read by a previous version) then simply don’t push it into the array. Order of the converted API_AddonObjects is irrelevant.
You must pay attention to not create more than one API_AddonObjects with the same name if the AddOnObject is Unique.
Because Unique AddOnObjects is an API 21 () feature, please pay special attention to converting AddOnObjects with UniqueAddOnObject API_AddonObjectType by either setting their type to GeneralAddOnObject or leaving them from oldFormatAddOnObjectArray.
- Version: API 19 or later
- Header: APIdefs_Callback.h