ACAPI_​Attribute_​CreateFolder

Creates attribute folders. To create a folder, its full path has to be provided. The command will create all folders along the path, if they do not exist.

    GSErrCode  ACAPI_Attribute_CreateFolder (
        API_AttributeFolder&        folder
    );

 

Parameters

folder
[in out] Type and path of the attribute folder to create.

 

Return Values

NoError
The function has completed with success.
APIERR_BADID
Incorrect folder.typeID was specified, or folder.path is illegal, see remarks.
APIERR_NOPLAN
There is no open project.
APIERR_NOACCESSRIGHT
User has no permission to create folders under typeID.
APIERR_BADPARS
Folder creation is not available for folder.typeID.

For other common API errors see the API Errors document.

 

Remarks

folder.path has to be legal, i.e. all names in the array must not be empty, and must not begin or end with whitespace.

If a folder in folder.path already exists, it is not renamed or recreated. Name collision of folders is case insensitive. Examples:

  • If the folders A/B exist, and folder.path = a/b/c/d, two new folders, c/d under A/B are created. A and B are not renamed to a and b.
  • If the folders A/B/C exist, and folder.path = a/b/c, this has no effect. NoError will be returned.

If a folder at folder.path was successfully created, it’s unique identifier is set to folder.guid. It can be used later, even if the folder was moved or renamed since it’s creation.

 

Example


API_AttributeFolder folder {};
folder.typeID = API_CompWallID;
folder.path = { "A", "B", "C1" };
DBVERIFY (ACAPI_Attribute_CreateFolder (folder) == NoError);
        

 

Requirements

Version: API 26 or later
Header: ACAPinc.h

 

See Also

ACAPI_Attribute_GetFolder,
ACAPI_Attribute_DeleteFolder,
ACAPI_Attribute_RenameFolder,
ACAPI_Attribute_GetFolderContent,
ACAPI_Attribute_Move,
API Functions