We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2013-10-17 12:15 PM - last edited on 2023-08-01 06:58 PM by Doreena Deng
API_AttributeUserData user_data; user_data.dataVersion = MY_ATTS_VERS; user_data.platformSign = GS::Win_Platform_Sign; user_data.dataHdl = BMAllocateHandle(sizeof(MyUserData), ALLOCATE_CLEAR, 0); GSErr ud_err = BMPtrToHandle(&UserData, &user_data.dataHdl, sizeof(MyUserData)); ACAPI_Attribute_SetUserData(&UDHead, &user_data);UserData is the user data to be saved, and UDHead has the typeID and index.
2013-10-17 02:17 PM
err = ACAPI_Attribute_GetUserData (&attribute.header, &userData); if (err == NoError) { MyUserData** myUserData = reinterpret_cast<MyUserData**> userData.dataHdl; // now you can use the userdata // after working with it, don't forget to free the handle! BMKillHandle (&(userData.dataHdl)); } else { ACAPI_WriteReport ("Error: ACAPI_Attribute_GetUserData", false); }
2013-10-18 03:47 AM