Creates a new folder inside a loaded library.
GSErrCode ACAPI_Environment ( APIEnv_CreateFolderInLibraryID, const IO::Location* newFolderLocationInLibrary );
Parameters
- newFolderLocationInLibrary
- [in] The location of the folder to be created in an existing active library.
Return Values
APIERR_BADPARS
- The passed location parameter is invalid or nullptr.
APIERR_NOPLAN
- There is no user project.
APIERR_NOTMINE
- The parent folder is not reserved by the current user in Teamwork.
APIERR_READONLY
- The given location is not writable.
APIERR_NOACCESSRIGHT
- The user does not have Teamwork privilege to create a folder, or the BIM server is not available.
APIERR_REFUSEDPAR
- The given location is not a subfolder of any of the active linked or server libraries, nor the Embedded Library.
NoError
- The function has completed with success.
For other common API errors see the API Errors document.
Remarks
The function creates a new folder in an existing library loaded in the current project. The given location must be writable and, in Teamwork, must be reserved. If the folder already exists, the function returns NoError
.
Example
GS::Array<API_LibraryInfo> libInfo; GSErrCode err = ACAPI_Environment (APIEnv_GetLibrariesID, &libInfo); if (err == NoError) { for (UInt32 ii = libInfo.GetSize (); ii > 0; --ii) { const API_LibraryInfo& libraryInfo = libInfo[ii - 1]; if (libraryInfo.libraryType == API_LocalLibrary || libraryInfo.libraryType == API_EmbeddedLibrary || libraryInfo.libraryType == API_ServerLibrary) { IO::Location targetFolderLocation (libraryInfo.location, IO::Name ("New Folder")); err = ACAPI_Environment (APIEnv_CreateFolderInLibraryID, &targetFolderLocation); break; } } }
Requirements
- Version: API 20 or later
- Header: APIdefs_Environment.h
See Also
APIEnv_CopyFilesIntoLibraryID, APIEnv_GetLibrariesID, APIEnv_AddLibrariesID,
ACAPI_Environment, API Functions