Returns an existing section of a registered Library Part.
GSErrCode ACAPI_LibPart_GetSection ( Int32 libInd, API_LibPartSection* section, GSHandle* sectionHdl, GS::UniString* sectionStr, GS::UniString* password = nullptr );
Parameters
- libInd
- [in] Index of the library part
- section
- [in/out] Definition of the section. The section is defined by the
sectType
an thesubIdent
fields of the API_LibPartSection structure. - sectionHdl
- [out] Section data.
- sectionStr
- [out] The content of textual sections as a Unicode string. Pass the address of an existing Unicode string if you need this data.
- password
- [in] The (optional) password that encrypted the section.
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. APIERR_NOLIBSECT
- no such a section in the Library Part
For other common API errors see the API Errors.
Remarks
This function is used to get the data of the requested section from the Library Part.
It returns the requested section of the Library Part defined by libInd in the sectionHdl. The section is defined by the sectType field of the API_LibPartSection structure. If it (a four-character case-sensitive identifier) is not any of the standard types, it is interpreted as a custom type. In this case you are responsible for the content and the management of this section. The description of the standard sections can be found in the Archicad Reference Manual.
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 data if it is not needed any more.
From API 11, the textual section data is now stored as a GS::UniString
in the library parts. You can also obtain the text in this format in the sectionStr
parameter.
Example
See the example of the ACAPI_LibPart_GetSectionList function.
Requirements
- Version: API 1.3 or later
- Header: ACAPinc.h
See Also
API_LibPartSection, ACAPI_LibPart_GetSectionList,
LibPart Manager, API Functions