![]() |
COLNEO Pro 1.0
|
Project API interface.
Register Javascript object with cnProjectAPI.
The Project API provides project related information and functions such as getting/setting project informations, settings, connection to COLNEO infohub project, opening and saving project etc.
Functions | |
PROJECT INFO | |
| ApiJsonResponse | getInfo (QStringList keys=QStringList()) |
| ApiJsonResponse | getDirectory () |
| ApiJsonResponse | setInfo (QVariantMap &projectInfo) |
| ApiJsonResponse | getInfohubSettings () |
| ApiJsonResponse | setInfohubSettings (QVariantMap &settings) |
| ApiJsonResponse | getStatistics () |
PROJECT | |
| ApiJsonResponse | create (QVariantMap settings) |
| ApiJsonResponse | open (QString filepath) |
| ApiJsonResponse | saveAs (QString &filepath) |
| ApiJsonResponse | archive (QString &filepath) |
| ApiJsonResponse | close () |
MODELS | |
| ApiJsonResponse | importModel (QString &filepath, QVariantMap &importOptions=QVariantMap()) |
| ApiJsonResponse | exportModels (QString &filePath, QStringList &modelIds, QVariantMap &options) |
MACROS | |
| ApiJsonResponse | getMacroIds () |
| ApiJsonResponse | getMacro (QString &id) |
| ApiJsonResponse | createMacro (QVariantMap ¯oAsJson) |
| ApiJsonResponse | updateMacro (QString &id, QVariantMap ¯oAsJson) |
| ApiJsonResponse | deleteMacro (QString &id) |
| ApiJsonResponse | runMacro (QString &id) |
|
slot |
Creates a project archive (zip).
| filepath |
|
slot |
Closes the current project without confirmation. Handle with care!
|
slot |
Create a new, empty project.
| settings | {
name: "",
code: "",
description: ""
}
|
|
slot |
Create a new macro. If no ID is specified, it is generated automatically.
| macroAsJson | Object holding the data {
name: "MyMacro",
desc: "Set all object visible in domain design",
code: "cnCoreAPI.setVisibleAll(true, \"geo\")",
actionName: ""
}
|
|
slot |
...
| id |
|
slot |
Exports one or more models to a file in either JSON (.cnjson) or binary (.cnbin) format.
| filePath | Absolute path to the target file, e.g. "C:/MyModels/Test.cnjson". |
| modelIds | List of model IDs to export. Only valid model IDs are processed, invalid or non-model IDs are ignored. |
| options | Export configuration. If a section key (e.g. "geometry", "properties", "nodes") is missing or explicitly set to null, that category will not be exported. |
|
slot |
Gets the directory of the current project.
Usable in scripted properties
|
slot |
Usable in scripted properties
Get project information such as name, ID, created by etc. Also get information about connection to COLNEO infohub.
| keys | If specified, only the corresponding keys/attributes are returned, otherwise the entire project data. |
|
slot |
Usable in scripted properties
Get infohub settings such as scope and project short id which stores the connection between the local COLNEO pro project and a project on infohub.
|
slot |
Get macro data with specified ID.
| id | ID of macro. |
|
slot |
Get IDs of available macros in project.
|
slot |
...
|
slot |
Import a model from file. Currenty supported file formats are .ifc, ifcxml, .ifczip, .cpixml, .cnjson or .cnbin.
| filepath | The file path of the model file, e.g "C:/MyModels/Test.ifc" |
| importOptions | Import options {
"base": {
"updateStyles": true,
},
"design":{
"translation": [400.0, -20.0, 0],
"rotation_point": [0.0, 0.0],
"rotation_angle": 30.0,
"scaling": [1.0, 1.0, 1.0]
}
...
}
|
|
slot |
Open the project from a given file path.
| filepath |
|
slot |
Run (evaluates) a macro
| id | ID of macro. |
|
slot |
Saves the project under the current file path.
|
slot |
Set Project Information.
|
slot |
Set infohub settings such as scope and project shortid.
Keys are set partially, only the given keys are changed.
| settings | {
"scope_id" : "...",
"project_shortid" : "...",
"connected_by" : "..."
}
|
|
slot |
Update a macro. The ID cannot be changed!
| id | |
| macroAsJson |