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

Description

Project API interface. Register with "cnProjectAPI".

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

Since
1.0.0

(c) COLNEO GmbH

Functions

PROJECT
ApiJsonResponse create (QVariantMap settings)
 
ApiJsonResponse open (QString filepath)
 
ApiJsonResponse saveAs (QString &filepath)
 
ApiJsonResponse archive (QString &filepath)
 
ApiJsonResponse setInfo (QVariantMap &projectInfo)
 
ApiJsonResponse getEvaluation ()
 
ApiJsonResponse getTemplates ()
 
ApiJsonResponse getRecentProjects ()
 
ApiJsonResponse removeRecentProject (QString &filename)
 
ApiJsonResponse importModel (QString &filepath, QVariantMap &importOptions=QVariantMap())
 
ApiJsonResponse exportModels (QString &filePath, QList< QString > &modelList, QVariantMap &options)
 
MODELS
ApiJsonResponse createModel (QString &name, QString &domainCode, QVariantMap &settings=QVariantMap())
 
ApiJsonResponse deleteModel (QString &id)
 
ApiJsonResponse getModels (QVariantMap &options=QVariantMap())
 
ApiJsonResponse getModelMetaData (QString &id)
 
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())
 
BOOKMARKS
ApiJsonResponse getPropertyTypeBookmarks (QString &domainCode)
 
ApiJsonResponse applyBookmark (QString &bkmId, QString &domainCode)
 
ApiJsonResponse createBookmark (QString &domainCode, QVariantMap &bookmarkAsJson)
 
ApiJsonResponse deleteBookmark (QString &id)
 
PROJECT
ApiJsonResponse getInfo ()
 

Function Documentation

◆ applyBookmark

ApiJsonResponse applyBookmark ( QString & bkmId,
QString & domainCode )
slot

Set visible columns from bookmark.

Parameters
bkmId
domainCode
Since
1.0.0, ..., sl

◆ 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

◆ createBookmark

ApiJsonResponse createBookmark ( QString & domainCode,
QVariantMap & bookmarkAsJson )
slot

Create a bookmark in the given tree structure.

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

◆ 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 given domain.

Parameters
name
domainCode
settings
Returns
ID of the newly created model
Since
1.0.0, ...

◆ createStyle

ApiJsonResponse createStyle ( QVariantMap & styleData)
slot

...

Parameters
styleData
{
}
Returns
Since
1.0.0

◆ deleteBookmark

ApiJsonResponse deleteBookmark ( QString & id)
slot

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

◆ deleteMacro

ApiJsonResponse deleteMacro ( QString & id)
slot

...

Parameters
id
Since
1.0.0, ...

◆ deleteModel

ApiJsonResponse deleteModel ( QString & id)
slot

...

Parameters
id
Returns
True, if model could be deleted, else false.
Since
1.0.0, ...

◆ 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

...

Parameters
filePath
modelList
options
Since
1.0.0, ...

◆ getEvaluation

ApiJsonResponse getEvaluation ( )
slot

...

Returns
{
key: value
}
Since
1.0.0

◆ getInfo

ApiJsonResponse getInfo ( )
slotinherited

Get project information.

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

◆ 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 & id)
slot

...

Parameters
idID of model
Returns
Meta data object
{
"createdOn" : "",
"createdBy" : "",
"importedOn" : "2022-05-24T12:00:00.000z",
"importedBy" : "User",
"sourceFileName : "C:/User/test.cpixml";
"sourceApplication" : "MyApp";
"sourceFormat" : "cpixml"
"sourceFormatVersion" : "1.7"
}
Since
1.0.0, ...

◆ getModels

ApiJsonResponse getModels ( QVariantMap & options = QVariantMap())
slot
Parameters
options
Returns
Array with IDs of all models that matches the given options
Since
1.0.0, ...

◆ getPropertyTypeBookmarks

ApiJsonResponse getPropertyTypeBookmarks ( QString & domainCode)
slot

Get list of property type bookmarks.

Parameters
domainCode
Returns
[
{
id: "4c90a55a-0dc5-4e7a-b0a8-36789fa4c2a2",
name : "Objekt Information",
propertytypes: ["cnGuid##xs:ID", "cnObjectType##xs:string"]
},
...
]
Since
1.0.0, ..., sl

◆ 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
Error Object. On success (code = 1), data section contains the ID of the imported model.
{
code: 1,
message: "",
data: "f203d033-3084-4d7c-8d36-c4ada6cb6c45"
}
Since
1.0.0, ...

◆ 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

...

Returns
{
key: value
}
Since
1.0.0

◆ 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