![]() |
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) |
MODELS | |
| ApiJsonResponse | importModel (QString filepath, QVariantMap importOptions=QVariantMap()) |
| ApiJsonResponse | exportModels (QString filePath, QStringList modelIds, QVariantMap options) |
INFOHUB | |
| ApiJsonResponse | importModelFromInfohub (QString sid, QVariantMap importOptions=QVariantMap()) |
| ApiJsonResponse | downloadNode (QString sid, QVariantMap &options) |
| ApiJsonResponse | checkSyncStatus (QString id, QVariantMap &options) |
MACROS | |
| ApiJsonResponse | getMacroIds () |
| ApiJsonResponse | getMacro (QString id) |
| ApiJsonResponse | createMacro (QVariantMap macroAsJson) |
| ApiJsonResponse | updateMacro (QString id, QVariantMap macroAsJson) |
| ApiJsonResponse | deleteMacro (QString id) |
| ApiJsonResponse | runMacro (QString id) |
PROGRESS | |
| ApiJsonResponse | getProgressId () |
| ApiJsonResponse | createProgress (QString parentid, QString name=QString()) |
| ApiJsonResponse | clearProgress (QString id) |
| ApiJsonResponse | resetProgress (QString id) |
| ApiJsonResponse | setProgress (QString id, QVariantMap p) |
| ApiJsonResponse | getProgress (QString id) |
| ApiJsonResponse | countProgressChildren (QString id, int depth) |
| ApiJsonResponse | getProgressChildrenIds (QString id, int depth) |
| ApiJsonResponse | getProgressSubscriberNames (QString id, int depth) |
|
slot |
Creates a project archive (zip).
| filepath |
|
slot |
Check sync status of object.
Check if object is linked to an object on infohub. Return the sync status.
|
slot |
Remove all child progress objects. Set progress value to 0, clear progress message,
|
slot |
Collect children to the depth of 'depth' and return number of progress objects.
|
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 |
Create a new progress object as child of 'parentid'
|
slot |
...
| id |
|
slot |
Download node data (object versi9on) from infohub
| options | opt = {
"members" : [],
}
|
|
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 |
Usable in scripted properties
Gets the directory of the current project.
|
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 |
Get progress values of progress object 'id'
|
slot |
Collect children to the depth of 'depth' and return list of progress ids.
|
slot |
Get ID of root progress object.
|
slot |
Get list of names of object which have to subscribed to this project object or one of its children.
|
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 | Options for file import base : {
"updateStyles" : bool,
"createNewIds" : bool
},
design: {
"translation" : [ dx , dy , dz ]
"rotation_point" : [ x , y , z ]
"rotation_angle" : number
"scale" : [ sx , sy , sz ]
},
"citygml" : {
"merge_surfaces" : bool
"import_terrain_intersection" : bool
}
|
|
slot |
Download and import model from infohub
The method returns a request id which is sent by the global project progress once the download finishes.
| sid | ShortId of document on infohub. Document must be in the current choosen scope. |
| importOptions | Options for file import, |
|
slot |
Open the project from a given file path.
| filepath |
|
slot |
Reset all child progress objects. Set progress value to 0, clear progress message,
|
slot |
Run (evaluate) 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 |
|
slot |
Update a macro. The ID cannot be changed!
| id | |
| macroAsJson |