FormIt C++ API  v23.0.0 (2023.0.0)
FormIt::Forge API

Description

Namespaces

 FormIt::Forge::UI
 

Functions

FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::SetForgeMode (Forge::ForgeMode mode, 1::string path)
 instantiate forge mode for testing More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::CheckEntitlements (const 1::string &token)
 CheckEntitlements() function. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::InitHttpClient (const FormIt::StringType &uri)
 Initializes an http client to be used on Forge calls. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetHubsWithProjects (const 1::string &token, 1::vector< HubInfo > &hubs)
 Obtains the hubs for the logged in account in BIM360. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetContentPermissions (const 1::string &token, const Forge::ProjectInfo &project, FolderContents &content)
 Obtains BIM 360 permissions of files and folders inside a folder content from a BIM 360 project. More...
 
FORMIT_CORE_EXPORT Forge::ErrorCode FormIt::Forge::GetTopFolders (const 1::string &token, const Forge::HubInfo &hub, const Forge::ProjectInfo &project, Forge::FolderContents &topContent)
 Obtains the top folders of a BIM 360 project (top folders refers to the content of project root folder) More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::ListContents (const 1::string &token, const ProjectInfo &project, const 1::string &folderId, FolderContents &contents)
 List the contents of a given folder in BIM360. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::DownloadFile (const 1::string &token, const FileInfo &fileInfo, 1::vector< unsigned char > &data)
 Downloads a file from BIM360. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::UpdateRemoteFile (const 1::string &token, const FileData &fileData, const 1::string &projectId, FileInfo &fileInfo)
 Updates an existing file in BIM360. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::CreateRemoteFile (const 1::string &token, const 1::string fileName, const 1::vector< unsigned char > &data, const 1::string &destinationFolder, const 1::string &projectId, FormIt::Forge::FileInfo &fileInfo)
 Creates a new file in BIM360 within a specified folder. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetThumbNail (const 1::string &token, const FormIt::Forge::FileInfo &file, 1::vector< unsigned char > &data)
 Returns the thumbnail image for the given file. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::CreateThumbNailDerivative (const 1::string &token, const FormIt::Forge::FileInfo &file)
 Create the thumbnail via the derivate service. More...
 
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetRevitFamilyInfo (const 1::string &token, FormIt::Forge::FileInfo &file)
 Get Revit information via the derivative service First ensures that file exist in Derivative Service calling CreateThumbNailDerivative in order to request Revit Family info of file. More...
 
FORMIT_CORE_EXPORT::string FormIt::Forge::GetSerialNumber (1::string &token)
 Get the Pelican Entitlement serial number. More...
 

Function Documentation

FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::CheckEntitlements ( const 1::string &  token)

CheckEntitlements() function.

Parameters
[in]tokenThe Bearer Token obtained from Forge.
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::CreateRemoteFile ( const 1::string &  token,
const 1::string  fileName,
const 1::vector< unsigned char > &  data,
const 1::string &  destinationFolder,
const 1::string &  projectId,
FormIt::Forge::FileInfo fileInfo 
)

Creates a new file in BIM360 within a specified folder.

This function creates the first version of a file.

Parameters
tokenThe Bearer Token obtained from Forge.
fileNameA string representing the name of the file.
dataAn array representing the file contents to upload.
destinationFolderIDThe folderID for the project that owns the file.
projectIdThe project Id that owns the file.
fileInfoA reference to the FileInfo struct representing the newly created file, obtained as ouptput.
[in]destinationFolder
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::CreateThumbNailDerivative ( const 1::string &  token,
const FormIt::Forge::FileInfo file 
)

Create the thumbnail via the derivate service.

A returned Forge::ErrorCode::Success ensures that the thumbnail creation process has started.

Parameters
tokenThe Bearer Token obtained from Forge.
fileInfoA reference to the FileInfo struct representing the BIM 360 file
[in]file
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::DownloadFile ( const 1::string &  token,
const FileInfo fileInfo,
1::vector< unsigned char > &  data 
)

Downloads a file from BIM360.

It takes a FileInfo structure, ussually obtained from ListContents

Parameters
tokenThe Bearer Token obtained from Forge.
fileInfoA FileInfo structure represented the selected file to download.
dataAn array of unsigned chars representing the file downloaded.
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetContentPermissions ( const 1::string &  token,
const Forge::ProjectInfo project,
FolderContents content 
)

Obtains BIM 360 permissions of files and folders inside a folder content from a BIM 360 project.

The folder content must belong to the project. PermissionsInfo (BIM 360 Permissions struct) attribute is updated on each FileInfo and FolderInfo inside the FolderContents passed as input parameter.

Parameters
tokenThe Bearer Token obtained from Forge.
projectThe selected project to work with.
contentsA reference to the FolderContents containing a collection of FolderInfos and FileInfos where their PermissionsInfo are updated.
[out]content
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetHubsWithProjects ( const 1::string &  token,
1::vector< HubInfo > &  hubs 
)

Obtains the hubs for the logged in account in BIM360.

The list of HubInfo structures also contain information of the projects on those hubs.

Parameters
tokenThe Bearer Token obtained from Forge.
hubsA reference to a vector of HubInfo structs that will be populated as output.
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetRevitFamilyInfo ( const 1::string &  token,
FormIt::Forge::FileInfo file 
)

Get Revit information via the derivative service First ensures that file exist in Derivative Service calling CreateThumbNailDerivative in order to request Revit Family info of file.

A returned Forge::ErrorCode::Success ensures that Revit Family info was obtained and placed in Forge::FileInfo param.

Parameters
tokenThe Bearer Token obtained from Forge.
fileInfoA reference to the FileInfo struct representing the BIM 360 file where the Revit Family info will be added in file.extensionInfo.
[out]file
FORMIT_CORE_EXPORT ::string FormIt::Forge::GetSerialNumber ( 1::string &  token)

Get the Pelican Entitlement serial number.

A std::string is returned with the value.

Parameters
tokenThe Bearer Token obtained from Forge.
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::GetThumbNail ( const 1::string &  token,
const FormIt::Forge::FileInfo file,
1::vector< unsigned char > &  data 
)

Returns the thumbnail image for the given file.

Image is in png format

Parameters
tokenThe Bearer Token obtained from Forge.
fileInfoA reference to the FileInfo for which to get the thumbnail.
dataThe thumbnail image in png format.
[in]file
FORMIT_CORE_EXPORT Forge::ErrorCode FormIt::Forge::GetTopFolders ( const 1::string &  token,
const Forge::HubInfo hub,
const Forge::ProjectInfo project,
Forge::FolderContents topContent 
)

Obtains the top folders of a BIM 360 project (top folders refers to the content of project root folder)

Parameters
tokenThe Bearer Token obtained from Forge.
hubThe hub that contains the project
projectThe selected project to look up for its top folders.
topContentA reference to the project's base folder content (top folders) that will be populated as output
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::InitHttpClient ( const FormIt::StringType uri)

Initializes an http client to be used on Forge calls.

Parameters
uriThe URI for Forge eg. https://developer-stg.api.autodesk.com".
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::ListContents ( const 1::string &  token,
const ProjectInfo project,
const 1::string &  folderId,
FolderContents contents 
)

List the contents of a given folder in BIM360.

The folder belongs to a project and the ouput can contain folders and/or files.

Parameters
tokenThe Bearer Token obtained from Forge.
projectThe selected project to work with.
folderIdThe id of the selected folder.
contentsA structure containing a collection of FolderInfo and FileInfo for the folder selected
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::SetForgeMode ( Forge::ForgeMode  mode,
1::string  path 
)

instantiate forge mode for testing

Parameters
[in]mode
[in]path
FORMIT_CORE_EXPORT FormIt::Forge::ErrorCode FormIt::Forge::UpdateRemoteFile ( const 1::string &  token,
const FileData fileData,
const 1::string &  projectId,
FileInfo fileInfo 
)

Updates an existing file in BIM360.

It bumps up the version of the modified file

Parameters
tokenThe Bearer Token obtained from Forge.
fileDataA FileData structure containing the FileInfo of the current version of the file and a vector of unsigned chars of new data.
projectIdThe project Id that owns the file.
fileInfoA reference to the FileInfo struct representing the new version of the file, obtained as ouptput.