ā2023-07-14
05:55 PM
- last edited on
ā2023-07-18
05:03 AM
by
Laszlo Nagy
I am stuck on getting return data of the above function with below sample code;
Int32 version;
GSSize nBytes;
GSPtr pref;
ACAPI_GetPreferences (&version, &nBytes, nullptr);
if (version == MY_PREFERENCES_VERSION) {
pref = BMAllocatePtr (nBytes, ALLOCATE_CLEAR, 0);
if (pref != nullptr) {
ACAPI_GetPreferences (&version, &nBytes, pref);
// do something with the preferences data
BMKillPtr (&pref); // dispose allocated pointer
}
};
Is there anyone know how to convert "pref" to readable text?
ā2023-07-15 10:30 PM
Short Question: Did you fill in your Data before? That function is for storing your own data, with your own datastructure:
ā2023-07-16 03:51 AM
Hello Joel,
I already set the preference data according to its suggestion doc but still can't retrieve it back since the last parameter of get API is GSPtr which do not know how to convert it readable character. Do you have any idea?
Thanks.
ā2023-07-16 08:26 AM
Here you can find a detailed explanation of preferences handling:
https://archicadapi.graphisoft.com/archicad-maze-generator-add-on-tutorial-part-3