2024-11-30 06:22 PM
From ArchiCAD 27 the ACAPI_LibPart_GetSection function has been replaced by the ACAPI_LibraryPart_GetSection one. Till ArchiCAD 26 when I try to get data from an empty '2DDR' (
API_Sect2DDraw) section using the ACAPI_LibPart_GetSection function I obtained an APIERR_NOLIBSECT error. From ArchiCAD 27 (and also on ArchiCAD 28) the result of the ACAPI_LibraryPart_GetSection function call is NoError. Is there a way to understand that the section doesn't exist?
Regards
Silvia
a week ago - last edited a week ago
Hi,
I'd suggest you to check the section handle if you cannot get error code. By the way, I've checked AC28 (build 3110), it returns APIERR_NOLIBSECT in case of empty section.
section.sectType = API_Sect2DDraw;
GSHandle sectionHdl;
err = ACAPI_LibraryPart_GetSection(libPart.index, §ion, §ionHdl, §ionStr);
if (sectionHdl == nullptr) {
ACAPI_WriteReport("Section is empty!", false);
}
HTH.