![]() |
COLNEO Pro 1.2
|
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.
|
slot |
Adds a webmodule bookmark from its JSON object representation. If the supplied ID is empty or already exists, a new unique ID is generated.
| webmodule | Webmodule bookmark fields. {
"id": "webmodule-1",
"url": "https://www.example.com",
"name": "Example",
"is_homemodule": false,
"preview": "iVBORw0KGgo...",
"icon": "iVBORw0KGgo..."
}
|
|
slot |
Create a project archive.
Create a project archive (cnpzip) on the same level as the project folder (in which the cnp is located) with the same name as the projectfolder and cnpzip as a file extension.
|
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 the data of a specific node (object version) from COLNEO infohub given by its ShortId.
Calls GET /{scope}/nodes/{node}/data in the currently connected infohub scope. The response is a single object in GOM notation. The node's child hierarchy is not included.
| sid | Node short ID in the currently connected infohub scope. |
| options | Optional selection of GOM members to retrieve. If members is empty, infohub returns its default node data. Typical members are info, properties, geometry, relations, relations_right, annotations, typeinfo, and objecttype. |
|
slot |
Download objects as tree from node and instantiate objects as child object of parentid
| parentid | Create downloaded objects as child objects of this object in COLNEO pro |
| params | URL parameters for download Definition gom.options.h:1801 |
| options | Definition gom.options.h:1893 |
|
slot |
Exports one or more models to a file in either JSON (.tree.json), cnZIP (.cnzip), or binary (.cnbin) format.
| filePath | Absolute path to the target file, e.g. "C:/MyModels/Test.cnjson". |
| objectIds | List of root object IDs to export. |
| 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. {
"output" : {
"format":
'cnzip_1.0' // file extension .cnzip
| 'cnbin' // *.cnbin
| 'tree.json_1.0' // *.tree.json
| 'obj' // *.obj
| 'cpixml_1.2' // *.cpixml
},
"members" : [ 'geometry' , 'properties' , 'nodes' ],
"geometry" : { // specification of content of geometry
"fields": ["vertices", "triangles", "faces", "facets", "styles", "edges"],
"whitelist": true
},
"properties": {
"propertytypes" : ["cnName##xs:string", "cnGuid##xs:ID"],
"whitelist": false,
"scripted_properties" : false
},
"nodes": {
"exclude_hidden": false, // if true only visible objects are written to output
"exclude_openings": true, // only valid for objects in domain design 'geo'
"exclude_assembly_parts": false // only valid for object in domain design 'geo'
}
}
|
|
slot |
Get connected coordination model on infohub.
|
slot |
Gets the node path of the coordination model connected to the current project.
Retrieves the path data from COLNEO infohub and waits until the request has completed. The response status, message, and data returned by Infohub are forwarded unchanged.
| options | Specifies the node data included for each path entry. {
"members": ["info", "properties", "relations", "relations_right"],
"properties": {
"propertytypes": ["cnName##xs:string", "project:number##xs:string"],
"is_whitelist": true
},
"relations": {
"relation_filter": {
"expose": true,
"relation_names": ["SUCCESSORS"],
"is_whitelist": true
},
"right_objects": {
"members": ["info", "properties"],
"properties": {
"propertytypes": ["cnName##xs:string"],
"is_whitelist": true
}
}
}
}
|
Property type selections are sent only for whitelist filters. When relations are disabled with relations.relation_filter.expose = false, relation members and relation query parameters are omitted.
Returns status 401 when no Infohub user is logged in. Other HTTP and network errors from the endpoint are returned with their corresponding message.
|
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 the local project struture/coordination model
|
slot |
Get macro data with specified ID.
| id | ID of macro. |
|
slot |
Get IDs of available macros in project.
|
slot |
Get object data from infohub.
Collect and return data specified in options.
| objIds | List of object IDs. |
| options | Specifies which data blocks to retrieve. Available options: |
Example:
|
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 |
Returns all webmodule bookmarks as a JSON array.
|
slot |
Import a model from file. Currently supported file formats include .ifc, .ifcxml, .ifczip, .cpixml, .obj, .cnjson and .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 |
Removes a webmodule bookmark by ID.
| webmodule_id | ID of the webmodule bookmark to remove. |
|
slot |
Reset all child progress objects. Set progress value to 0, clear progress message,
|
slot |
Run (evaluate) a macro
| id | ID of macro. |
|
slot |
Save project under the current file path/name.
If project has not been saved before or is not opened from an existing project, so there is no valid path and name set, this function returns an error (400).
|
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" : " ... ",
"coordinationmodel_shortid": " ... ",
"upload_act_folder": "",
"upload_boq_folder": "",
"upload_doc_folder": "",
"upload_geo_folder": "",
"upload_iss_folder": "",
"upload_cst_folder": ""
}
|
|
slot |
|
slot |
Synchronizes selected project data with the connected COLNEO infohub coordination model.
The local synchronized##xs:dateTime property is compared with the coordination model's info.updated value. A newer coordination model is downloaded; otherwise, the selected local data is uploaded. On the first synchronization, existing coordination-model project information and styles are downloaded when present, while missing members are populated from the local project and local webmodules are always uploaded as the leading value. The project name maps to ProjectInfo::getName() and the project number maps to project:number##xs:string; project IDs are not synchronized. Webmodules map to the bookmarks member of cmconfig:webmodules##xs:object, and styles map to the styles member of cmconfig:styles##xs:object.
| options | Members selected for synchronization. {
"sync_webmodules": true,
"sync_name_and_id": true,
"sync_styles": true
}
|
|
slot |
Update a macro. The ID cannot be changed!
| id | |
| macroAsJson |
|
slot |
Updates an existing model in the project using the specified model file.
| modelId | ID of the model to update. |
| filePath | Full file path to the new model file. |
| options | Update options. {
}
|
|
slot |
Partially updates an existing webmodule bookmark.
| webmodule_id | ID of the webmodule bookmark to update. |
| webmodule | Webmodule bookmark fields to change. |
|
slot |
Upload objects/tree to COLNEO infohub
Endpoint : POST/PATCH [...service_hub...]/{scope}/v2/nodes/{node}/tree
Specify REST verb in options.
| parentsid | Parent ShortID/NodeID |
| objecttree | Tree in GOM JSON notation |
| options | Definition gom.options.h:1974 |
|
slot |
Restores the webmodule model from the webmodules directory of the current project.
The current webmodule records are replaced with the records read from the filesystem. The project must have been saved before this method is called.
|
slot |
Restores the webmodule model from the COLNEO infohub project.
The current webmodule records are replaced with the records received from COLNEO infohub.
|
slot |
Saves the current webmodule model to the webmodules directory of the current project.
The project must have been saved before this method is called.
|
slot |
Saves the current webmodule model to the COLNEO infohub project.