Returns the list of sections contained by a registered Library Part.
GSErrCode ACAPI_LibPart_GetSectionList ( Int32 libInd, Int32* nSection, API_LibPartSection*** sections );
Parameters
- libInd
- [in] Index of the library part
- nSection
- [out] Number of the sections found
- sections
- [out] section data returned
Return Values
NoError
- The function has completed with success.
APIERR_BADPARS
- Invalid
libInd,
or
any of the parameters arenullptr
, or
the addressed Library Part is a macro, picture file etc.
For other common API errors see the API Errors.
Remarks
This function is used to get the headers of the sections the library part is built from.
The function works only on real Library Parts. In the case the type of the target Library Part is not listed below, the function returns an error code. This is since other type of Library Parts are just simple picture or text files which are enumerated and registered from the active library folders; such a picture or macro.
Applicable type of Library Parts are:
- APILib_WindowID,
- APILib_DoorID,
- APILib_ObjectID,
- APILib_LampID,
- APILib_RoomID,
- APILib_LabelID,
- APILib_MacroObjID,
- APILib_PropertyID
Do not forget to dispose the returned handle if it is not needed any more.
Note, that it cannot be used between ACAPI_LibPart_Create and ACAPI_LibPart_Save functions.
Example
Int32 nSection = 0; API_LibPartSection **sectList; GSHandle sectionHdl; char buffer[128]; GSErrCode err = ACAPI_LibPart_GetSectionList (1, &nSection, §List); if (err == NoError) { for (Int32 i = 0; i < nSection; i++) { API_LibPartSection* sectionPtr = *sectList + i; err = ACAPI_LibPart_GetSection (1, sectionPtr, §ionHdl, nullptr); BMKillHandle (§ionHdl); sprintf (buffer, "sectType: %d, subIndent: %d, version: %d", sectionPtr->sectType, sectionPtr->subIdent, sectionPtr->version); ACAPI_WriteReport (buffer, false); } BMKillHandle ((GSHandle *) §List); }
Requirements
- Version: API 2.1 or later
- Header: ACAPinc.h
See Also
API_LibPartSection,
ACAPI_LibPart_GetSection, ACAPI_LibPart_Create, ACAPI_LibPart_Save,
LibPart Manager, API Functions