Hi,
I am trying to change the subtype of a library part using the ACAPI_LibPart_UpdateSection function as the following code segment:
// ----------------------------------------------------------------
char buffer[1000];
API_LibPartSection section;
GSHandle sectionHdl;
BNZeroMemory (§ion, sizeof (API_LibPartSection));
section.sectType = API_SectAncestors;
sectionHdl = NULL;
// ModelElemID definded as:
// #define ModelElemID "{103E8D2C-8230-42E1-9597-46F84CCE28C0}-{00000000-0000-0000-0000-000000000000}"
strcpy_s (buffer, sizeof (buffer), ModelElemID);
sectionHdl = BMAllocateHandle (strlen(buffer), ALLOCATE_CLEAR, 0);
if (sectionHdl != NULL) {
memcpy (*sectionHdl, buffer, strlen(buffer));
err = ACAPI_LibPart_UpdateSection (libPart.index, §ion, sectionHdl, NULL);
if (err) {
WriteReport_Err (err, "[Do_UpdateLibraryPart]Error in ACAPI_LibPart_UpdateSection, API_SectAncestors, libPart.index = %d", libPart.index);
}
BMKillHandle ((GSHandle*) §ionHdl);
}
// ----------------------------------------------------------------
It does not seem to work. The updated object has the subtype shown as unknown subtype. I have updated other sections of the libpart such as API_Sect1DScript, API_Sect2DScript... ok.
Please help. Thanks in advance.
Regards,
Hoa TU
PS. This is developed for ArchiCAD 12