COLNEO Pro 1.0
Loading...
Searching...
No Matches
ProjectAPI

Description

Project API interface.

Register with "cnProjectAPI".

The Project API provides project related functions such as ...

Since
1.0

Functions

PROJECT
ApiJsonResponse getInfo ()
 
ApiJsonResponse setInfo (QVariantMap &projectInfo)
 
ApiJsonResponse create (QVariantMap settings)
 
ApiJsonResponse open (QString filepath)
 
ApiJsonResponse saveAs (QString &filepath)
 
ApiJsonResponse archive (QString &filepath)
 
ApiJsonResponse getEvaluation ()
 
ApiJsonResponse getTemplates ()
 
ApiJsonResponse getRecentProjects ()
 
ApiJsonResponse removeRecentProject (QString &filename)
 
MODELS
ApiJsonResponse getModels (QStringList &domains=QStringList()<< "all")
 
ApiJsonResponse getModelMetaData (QString &modelId)
 
ApiJsonResponse importModel (QString &filepath, QVariantMap &importOptions=QVariantMap())
 
ApiJsonResponse exportModels (QString &filePath, QList< QString > &modelList, QVariantMap &options)
 
ApiJsonResponse createModel (QString &name, QString &domainCode, QVariantMap &settings=QVariantMap())
 
ApiJsonResponse deleteModel (QString &modelId)
 
MACROS
ApiJsonResponse getMacros ()
 
ApiJsonResponse getMacroById (QString &id)
 
ApiJsonResponse createMacro (QVariantMap &macroAsJson)
 
ApiJsonResponse updateMacro (QString &id, QVariantMap &macroAsJson)
 
ApiJsonResponse deleteMacro (QString &id)
 
ApiJsonResponse runMacro (QString &id)
 
STYLES
ApiJsonResponse getStyles ()
 
ApiJsonResponse getStyleData (QString &styleId)
 
ApiJsonResponse createStyle (QVariantMap &styleData)
 
ApiJsonResponse updateStyle (QString &styleId, QVariantMap &styleData)
 
ApiJsonResponse deleteStyles (QStringList &styleIds)
 
ApiJsonResponse setStyle (QStringList &objectIds, QString &styleId)
 
ApiJsonResponse resetStyles (QStringList &objectIds=QStringList(), QVariantMap &filter=QVariantMap())
 
INFOHUB
ApiJsonResponse getInfohubSettings ()
 
ApiJsonResponse setInfohubSettings (QVariantMap &settings)
 

Events

 macroFinished (QString &macroId, bool success)
 

Public Member Functions

Constructors/Destructor
Interface IApiObject
QString & getApiObjectName ()
 

Function Documentation

◆ archive

ApiJsonResponse archive ( QString & filepath)
slot

Creates a project archive (zip).

Parameters
filepath
Returns
{
key: value
}
Since
1.0.0

◆ create

ApiJsonResponse create ( QVariantMap settings)
slot

Create a new, empty project.

Parameters
settings
{
name: "",
code: "",
description: ""
}
Returns
Since
1.0.0

◆ createMacro

ApiJsonResponse createMacro ( QVariantMap & macroAsJson)
slot

Create a new macro.

Parameters
macroAsJson
{
}
Returns
Id of new macro
Since
1.0.0, ...

◆ createModel

ApiJsonResponse createModel ( QString & name,
QString & domainCode,
QVariantMap & settings = QVariantMap() )
slot

Create a model in the specified domain.

Parameters
nameName of model
domainCodeDomain short code, e.g. 'geo'
settings? (to specify)
{
...
}
Returns
ID of the newly created model
data : string
Since
1.0, Apr 2025

◆ createStyle

ApiJsonResponse createStyle ( QVariantMap & styleData)
slot

...

Parameters
styleData
{
}
Returns
Since
1.0.0

◆ deleteMacro

ApiJsonResponse deleteMacro ( QString & id)
slot

...

Parameters
id
Since
1.0.0, ...

◆ deleteModel

ApiJsonResponse deleteModel ( QString & modelId)
slot

Delete a model. All objects and properties coming with this model are also deleted. Handle with care!

Parameters
modelIdID of the model
Returns
True, if model could be deleted, else false.
data : boolean
Since
1.0, Apr 2025

◆ deleteStyles

ApiJsonResponse deleteStyles ( QStringList & styleIds)
slot

...

Parameters
styleIdsStyle object ID or list of style object IDs.
Returns
Since
1.0.0

◆ exportModels

ApiJsonResponse exportModels ( QString & filePath,
QList< QString > & modelList,
QVariantMap & options )
slot

Write models to specified file.

Parameters
filePathFull file path
modelListList of model IDs
options? (to specify)
Returns
ID of the newly created model
data : string
Since
1.0, May 2025

◆ getApiObjectName()

QString & getApiObjectName ( )
Returns
'cnProjectAPI'

◆ getEvaluation

ApiJsonResponse getEvaluation ( )
slot

...

Returns
{
key: value
}
Since
1.0.0

◆ getInfo

ApiJsonResponse getInfo ( )
slot
Note
Usable with script properties

Get project information.

Returns
{
"filePath": "C:/Documents/COLNEO Projects/Test/test.cnp",
"id": "",
"name" : "Test",
"shortDescription" : "",
"createdBy": "max@colneo.email",
"createdOn": "2025-04-09T08:41:17.054Z",
"budget": "",
"client": "",
"description": "Test Project",
"executionPeriod": "",
"projectNumber": "",
"projectPhase": "",
"savedBy": "max@colneo.email",
"savedOn": "2025-04-09T08:41:17.055Z",
"savedWithVersion": "1.0.0",
"scope" : "",
"shortId" : ""
}
Since
1.0, 04.2025

◆ getInfohubSettings

ApiJsonResponse getInfohubSettings ( )
slot
Note
Usable with script properties

Get infohub settings such as scope and project shortid,

Returns
data : {
'scope' : ' ... ',
'project_shortid' : ' ... '
}
Since
1.0, Apr 2025, jh

◆ getMacroById

ApiJsonResponse getMacroById ( QString & id)
slot

Get macro.

Parameters
id
Returns
{
id: "",
name: "",
desc: "",
code: "",
actionName: ""
}
Since
1.0.0, ...

◆ getMacros

ApiJsonResponse getMacros ( )
slot

Get list of available macros in project.

Since
1.0.0, ...

◆ getModelMetaData

ApiJsonResponse getModelMetaData ( QString & modelId)
slot

Get the metadata of a model.

Parameters
modelIdID of model
Returns
Meta data as JSON
data : {
createdOn : "",
createdBy : "",
importedOn : "2022-05-24T12:00:00.000z",
importedBy : "User",
sourceFileName : "C:/User/test.cpixml";
sourceApplication : "ExternalApp";
sourceFormat : "cpixml"
sourceFormatVersion : "1.7",
sourceId : ""
}
Since
1.0, Apr 2025

◆ getModels

ApiJsonResponse getModels ( QStringList & domains = QStringList()<< "all")
slot

Get list of models, filtered by domains.

Parameters
domainsDomain short code or combination as array, e.g. 'all' or [ 'geo', 'act' ]
Returns
Array with IDs of all models that matches the given options
data : Array<string>
Since
1.0, Apr 2025

◆ getRecentProjects

ApiJsonResponse getRecentProjects ( )
slot

Get recent project as list.

Returns
Array with recent project records.
[
{
code: "12345",
name: "MyProject",
lastOpenedOn: "2024-01-01T12:21:04",
lastOpenedBy: "User",
fileName: "C:/Tmp/test.cpn"
},
{
code: null
name: "ABC",
lastOpenedOn: "2024-05-22T08:15:00",
lastOpenedBy: "User",
fileName: "C:/Tmp/abc.cpn"
}
]
Since
1.0.0, ...

◆ getStyleData

ApiJsonResponse getStyleData ( QString & styleId)
slot

...

Parameters
styleId
Returns
{
name: ""
color: "#AARRGGBB"
}
Since
1.0.0

◆ getStyles

ApiJsonResponse getStyles ( )
slot

...

Returns
List of IDs
Since
1.0.0

◆ getTemplates

ApiJsonResponse getTemplates ( )
slot

...

Returns
{
key: value
}
Since
1.0.0

◆ importModel

ApiJsonResponse importModel ( QString & filepath,
QVariantMap & importOptions = QVariantMap() )
slot

...

Parameters
filepathThe file path of the model file, e.g "C:/MyModels/Test.ifc"
importOptionsImport options
{
format: "ifc",
transformation: {
dx: 0.0,
dy: 0.0,
dz: 0.0,
}
}
Returns
ID of imported model, else empty string if an error occured.
{
data : ' ... modelID ...' // string
}
Since
1.0, May 2025

◆ macroFinished

macroFinished ( QString & macroId,
bool success )
signal

Set visible columns from bookmark.

Parameters
bkmId
domainCode
Since
1.0.0, ..., sl

Create a bookmark in the given tree structure.

Parameters
domainCode
bookmarkAsJson
Returns
ID of the newly created bookmark
Since
1.0.0, ..., sl

Delete the bookmark with the given ID. The bookmarks for each tree structure are searched for the ID.

Parameters
id
Returns
Since
1.0.0, ..., sl

◆ open

ApiJsonResponse open ( QString filepath)
slot

Open the project from a given file path.

Parameters
filepath
Returns
true, if project was opened successful, otherwise false
{
key: value
}
Since
1.0.0

◆ removeRecentProject

ApiJsonResponse removeRecentProject ( QString & filename)
slot

Removes a recent project with the given filename from the recent project list

Returns
success message or error code
{
}
Since
1.0.0, ...

◆ resetStyles

ApiJsonResponse resetStyles ( QStringList & objectIds = QStringList(),
QVariantMap & filter = QVariantMap() )
slot

...

Parameters
objectIdsObject ID or list of object IDs. If empty, all objects will be considered.
filter
{
???
}
Returns
Since
1.0.0

◆ runMacro

ApiJsonResponse runMacro ( QString & id)
slot

Run (evaluates) a macro

Parameters
idID of macro.
Returns
Result of evaluation
Since
1.0.0, 2025-02-05

◆ saveAs

ApiJsonResponse saveAs ( QString & filepath)
slot

Saves the project under the current file path

Returns
{
key: value
}
\since 1.0.0
/
/*!
Saves the project under a new file path.
\param filepath
\returns
\code
{
key: value
}
Since
1.0.0

◆ setInfo

ApiJsonResponse setInfo ( QVariantMap & projectInfo)
slot

Set Project Information.

Returns
{
data:
}
Since
1.0.0

◆ setInfohubSettings

ApiJsonResponse setInfohubSettings ( QVariantMap & settings)
slot

Set infohub settings such as scope and project shortid

Parameters
settings
{
'scope' : ' ... ',
'project_shortid' : ' ... '
}
Since
1.0, Apr 2025, jh

◆ setStyle

ApiJsonResponse setStyle ( QStringList & objectIds,
QString & styleId )
slot

...

Parameters
objectIds
styleId
Returns
Since
1.0.0

◆ updateMacro

ApiJsonResponse updateMacro ( QString & id,
QVariantMap & macroAsJson )
slot

...

Parameters
id
macroAsJson
See also
Since
1.0.0, ...

◆ updateStyle

ApiJsonResponse updateStyle ( QString & styleId,
QVariantMap & styleData )
slot

...

Parameters
styleId
styleData
See also
createStyle()
Returns
Since
1.0.0