User supplied callback procedure for converting AddOnObjects into current format.
typedef GSErrCode APIAddonObjectConvertNewFormatHandlerProc ( API_FTypeID planFileType, const GS::Array<API_AddonObject>& oldFormatAddOnObjectArray, GS::Array<API_AddonObject>& currentFormatAddOnObjectArray );
- [in] The original version of the plan of the project is being opened.
- [in] AddOnObject data in original format.
- [out] Array for the converted AddOnObject data in current format.
- The function has completed with success.
For other common API errors see the API Errors document.
In order to convert the add-on’s AddOnObject data into current format, you need to implement this callback function, and pass it to Archicad with ACAPI_Install_AddOnObjectConvertNewFormatHandler 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 opens an old version project, and the add-on has any AddOnObject stored in the original project. The data should be constructed according to the current version into API_AddonObject structures, and these structures should be pushed into the currentFormatAddOnObjectArray array.
The memory allocated for the converted AddOnObject by the add-on’s handler function will be released by the caller application.
You must pay attention to not create more than one API_AddonObjects with the same name if the AddOnObject is Unique.
- Version: API 19 or later
- Header: APIdefs_Callback.h