APIEnv_​GetLibrariesID

Returns the list of loaded libraries.

    GSErrCode ACAPI_Environment (
        APIEnv_GetLibrariesID,
        GS::Array<API_LibraryInfo>*     activeLibs,
        Int32*                          embeddedLibraryIndex
    );

 

Parameters

activeLibs
the active library list
embeddedLibraryIndex Featuring API 18
[out] optional; the 0-based index of the embedded library in this list

 

Return Values

NoError
The function completed with success.
APIERR_BADPARS
activeLibs is nullptr.
APIERR_MEMFULL
Low memory condition.

For other common API errors see the API Errors document.

 

Remarks

This function is used to get the list of active libraries of Archicad. Refer to the API_LibraryInfo for further details.

For linked BIMcloud or BIM Server Libraries the location of local library cache will be returned.

To change the active libraries use the APIEnv_SetLibrariesID function.

 

Example


GS::Array<API_LibraryInfo>    activeLibs;
UInt32               i;
char                 buffer[1024];
GS::UniString        path;
GSErrCode            err;

err = ACAPI_Environment (APIEnv_GetLibrariesID, &activeLibs);
if (err != NoError) {
    GiveMessage_Err ("Error in APIEnv_GetLibrariesID", err);
    return;
}

GiveMessage ("Active library folders", false);

for (i = 0; i < activeLibs.GetSize (); i++) {
    activeLibs[i].location.ToPath (&path);
    sprintf (buffer, "[%u]  %s", i+1, path.ToCStr (0, MaxUSize, CC_UTF8).Get ());
    GiveMessage (buffer, false);
}

Requirements

Version: API 2.1 or later
Header: APIdefs_Environment.h

 

See Also

API_LibraryInfo,
APIEnv_AddLibrariesID, APIEnv_SetLibrariesID, APIEnv_ResetLibrariesID,
ACAPI_Environment, API Functions