ACAPI_​SetPreferences_​OldVersion

Defines custom preferences data to be saved into older project file versions.

    GSErrCode  ACAPI_SetPreferences_OldVersion (
        Int32              version,
        GSSize             nByte,
        const void*        data,
        unsigned short     platformSign,
        API_FTypeID        oldPlanFileID
    );

 

Parameters

version
[in] The version of the data to be stored.
nByte
[in] The size of the data to be stored.
data
[in] The preferences data you would like to store for the specified plan version.
platformSign
[in] The platform identifier of the data (GS::Win_Platform_Sign, GS::Mac_Platform_Sign, GS::Mactel_Platform_Sign10  or GS::Act_Platform_Sign).
oldPlanFileID
[in] The plan file format associated with the preferences data when saving the project into this plan version. The value of this parameter can be:
APIFType_PlanFile, APIFType_PlanFile810, APIFType_PlanFile800, APIFType_PlanFile700, APIFType_PlanFile650, APIFType_PlanFile600.

 

Return Values

For common API errors see the API Errors document.

 

Remarks

This function is used to save your own options or preferences into the preferences file of the server application or into the project file to be saved. This information can be later retrieved with ACAPI_GetPreferences and ACAPI_GetPreferences_Platform.

You can define different preferences to be saved into different plan file formats. Use this function if your add-on had incompatible preferences format in the previous versions of Archicad. Store the data in that format too indicating which plan version should use it. When the user chooses to save the plan into an older plan format, the appropriate preferences data will be stored.

For more details see the Saving Add-On data into the Preferences and the Project File section.

 

Example


const Int32 ActVersion = 3;
const Int32 Version_in_AC8 = 2;
const Int32 Version_in_AC7 = 1;

struct MyPrefs          prefsData;
struct MyPrefs_in_AC8   dataForAC8;
struct MyPrefs_in_AC7   dataForAC7;
// construct the preferences data...

// store the actual preferences
ACAPI_SetPreferences (ActVersion, sizeof (MyPrefs), &prefsData);

// specify preferences to be saved into older plan file versions
ACAPI_SetPreferences_OldVersion (Version_in_AC8, sizeof (MyPrefs_in_AC8), &dataForAC8, GS::Act_Platform_Sign, APIFType_PlanFile800);
ACAPI_SetPreferences_OldVersion (Version_in_AC7, sizeof (MyPrefs_in_AC7), &dataForAC7, GS::Act_Platform_Sign, APIFType_PlanFile700);

 

Requirements

Version: API 6.1 or later
Header: ACAPinc.h

 

See Also

Saving Add-On data into the Preferences and the Project File
ACAPI_SetPreferences
ACAPI_GetPreferences
ACAPI_GetPreferences_Platform
API Functions