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



[in] Index of the library part
[in/out] Definition of the section. The section is defined by the sectType an the subIdent fields of the API_LibPartSection structure.
[out] Section data.
sectionStr Featuring API 11
[out] The content of textual sections as a Unicode string. Pass the address of an existing Unicode string if you need this data.
password Featuring API 16
[in] The (optional) password that encrypted the section.


Return Values

The function has completed with success.
Invalid libInd, or
any of the parameters are nullptr, or
the addressed Library Part is a macro, picture file etc.
no such a section in the Library Part

For other common API errors see the API Errors.



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:

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.



See the example of the ACAPI_LibPart_GetSectionList function.  



Version: API 1.3 or later
Header: ACAPinc.h


See Also

API_LibPartSection, ACAPI_LibPart_GetSectionList,
LibPart Manager, API Functions