Classes
Methods
# activateStyleSchemaScheme(smartSetId) → {ApiResponse.<boolean>}
Activate style schema scheme.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
ID the SmartSet. |
- Since:
- 10.2025
True if successfully activated.
ApiResponse.<boolean>
# activateViewpoint(objId) → {ApiResponse.<boolean>}
Activate a viewpoint.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID |
True if viewpoint was activated.
ApiResponse.<boolean>
# addObjectsToSmartSet(smartSetId, objIds, includeChildren) → {ApiResponse.<boolean>}
Add objects to SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
SmartSet ID. |
objIds |
Array.<string>
|
Object IDs. |
includeChildren |
boolean
|
true: tree structure, false: flat list |
- Since:
- 10.2025
True if objects effectivily added
ApiResponse.<boolean>
# addStyleSchemaToSmartSet(smartSetId, options) → {ApiResponse.<string>}
Add style to SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
ID the SmartSet. |
options |
object
|
- Since:
- 10.2025
ID of newly created style.
ApiResponse.<string>
# addViewpointToSmartSet(smartSetId, options) → {ApiResponse.<status>}
Add viewpoint to SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
ID the SmartSet. |
options |
object
|
- Since:
- 10.2025
ApiResponse.<status>
# applyStyleToObjects(styleId, objIds) → {ApiResponse.<boolean>}
Apply style to objects.
Parameters:
| Name | Type | Description |
|---|---|---|
styleId |
string
|
Style ID. |
objIds |
Array.<string>
|
Object IDs. |
True if objects style has been changed
ApiResponse.<boolean>
# connectModelViewer(on_sc, on_vc, cb)
Connect signals selection changed and visibility changed to given functions
returns { 'status' : ... }
Parameters:
| Name | Type | Description |
|---|---|---|
on_sc |
function
|
on selection changed |
on_vc |
function
|
on visibility changed |
cb |
*
|
# createModel(name, domain, settings) → {ApiResponse.<string>}
Create model. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Model name. |
domain |
string
|
Domain (e.g. 'geo') |
settings |
object
|
Model settings. |
ID of newly created model.
ApiResponse.<string>
# createObject(parentId, data) → {ApiResponse.<string>}
Create a new object. Synchronizes data with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
parentId |
string
|
ID of parent object |
data |
object
|
Data for the new object in JSON notation |
ID of newly created object.
ApiResponse.<string>
Example
{
info: {
object_type : "geo_container",
object_name : "MyObject"
},
properties: {
...
},
geometry: {
...
}
}
# createPropertyType(propData, updateExisting) → {ApiResponse.<boolean>}
Create or update property type. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
propData |
object
|
Property type definition. |
updateExisting |
boolean
|
Whether to update existing type. |
ApiResponse.<boolean>
Example
* // Example propData objects:
propData1 = {
name: "MyLength",
datatype: "xs:double",
unit: "m"
}
propData2 = {
name: "TrafficLight",
datatype: "xs:string",
values: ["red", "yellow", "green"]
readOnly: true
}
# createSmartSet(parentId, name, objectIds) → {ApiResponse.<string>}
Create new SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
parentId |
string
|
Id of parent |
name |
string
|
Name of the SmartSet. |
objectIds |
Array.<string>
|
null
|
List of object IDs (optional) which should be added as flat list to the SmartSet. |
- Since:
- 10.2025
ID of newly created SmartSet.
ApiResponse.<string>
# createSmartSetsFromSchema(schema) → {ApiResponse.<Array.<string>>}
Create SmartSets from schema.
Parameters:
| Name | Type | Description |
|---|---|---|
schema |
object
|
Schema definition. |
Array of SmartSet IDs.
ApiResponse.<Array.<string>>
# createStyle(styleData) → {ApiResponse.<string>}
Create a new style / material.
Parameters:
| Name | Type | Description |
|---|---|---|
styleData |
object
|
Style definition. |
ID of newly created style.
ApiResponse.<string>
Example
* // Example styleData:
const styleData = {
id: "12345", // optional
name: "MyStyle", // not empty
color: "#rrggbbaa" // valid color value in hexadecimal RGBA format
}
# createViewpoint(parentId, options) → {ApiResponse.<string>}
Create a new viewpoint.
Parameters:
| Name | Type | Description |
|---|---|---|
parentId |
string
|
null
|
ID of parent object |
options |
object
|
ID of newly created viewpoint.
ApiResponse.<string>
# deleteObjects(objIds) → {ApiResponse.<number>}
Delete objects by ID. Synchronizes data with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
IDs of objects to delete. |
Number of objects deleted.
ApiResponse.<number>
# deletePropertyType(ptKeyStr) → {ApiResponse.<boolean>}
Delete exsisting property type. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
ptKeyStr |
string
|
Access key of property type in the format name##datatype. |
ApiResponse.<boolean>
# deleteSmartSet(smartSetId) → {ApiResponse.<boolean>}
Delete a SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
Id of SmartSet. |
- Since:
- 10.2025
True if deleted.
ApiResponse.<boolean>
# deleteStyles(styleIds) → {ApiResponse.<boolean>}
Delete styles / materials.
Parameters:
| Name | Type | Description |
|---|---|---|
styleIds |
Array.<string>
|
IDs of styles to delete. |
- Since:
- 10.2025
True if styles deleted.
ApiResponse.<boolean>
# deleteViewpoint(objId) → {ApiResponse.<boolean>}
Delete a viewpoint.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID |
True if viewpoint was deleted.
ApiResponse.<boolean>
# filterObjectsByProperties(objIds, filterExpression) → {ApiResponse.<Array.<string>>}
Filter objects by property values.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs of objects to filter. |
filterExpression |
Array.<any>
|
Filter criteria. |
Filtered object IDs.
ApiResponse.<Array.<string>>
Examples
[ "$ifcEntity##xs:string" , "==" , "IfcWall" ]
[ "$ifcEntity##xs:string" , "in" , ["IfcWall", "IfcWallStandardCase"]] , "and" , "$cnVolume##xs:double", ">=" , 2.5 ]]
[ "$ifcEntity##xs:string" , "match" , "/^IfcWall/g"]]
# filterObjectsByStatus(objIds, statusCode, statusFlag) → {ApiResponse.<Array.<string>>}
Filter objects by status.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs of objects to filter. |
statusCode |
string
|
one of [ 'selected', 'visible']. |
statusFlag |
boolean
|
true: status, false: inverted status. |
Filtered object IDs.
ApiResponse.<Array.<string>>
# getChildIds(objId, depth) → {ApiResponse.<Array.<string>>}
Get children of object up to depth.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
depth |
number
|
[optional] Recursion depth, default = 0 (maximum depth) |
- Since:
- 10.2025
- IDs if contained objects upto given depth
ApiResponse.<Array.<string>>
# getInfo() → {object}
Get name and version of the current ModelViewer.
- Since:
- 10.2025
JSON object containing name and version.
object
# getInfohubSettings() → {object}
settings object
object
Example
{
'scope_id' : ' ... ',
'project_shortid' : ' ... ',
'connected_by' : ' ... '
}
# getModelIds(domain) → {ApiResponse.<Array.<string>>}
Get model IDs for given domains.
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
Array.<string>
|
Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act']. |
- Since:
- 10.2025
Array of model IDs.
ApiResponse.<Array.<string>>
# getModelMetadata(modelId) → {ApiResponse.<object>}
Get metadata for given model.
Parameters:
| Name | Type | Description |
|---|---|---|
modelId |
string
|
Model ID. |
- Since:
- 10.2025
ApiResponse.<object>
# getObject(objId) → {ApiResponse.<cnObject>}
Get object by ID. Synchronizes data with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
ID of object. |
returns object in GOM format
# getObjectIds(domain) → {ApiResponse.<Array.<string>>}
Get all object IDs for given domains as list.
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
Array.<string>
|
Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act']. |
Array of object IDs.
ApiResponse.<Array.<string>>
# getParentId(objId) → {ApiResponse.<string>}
Get parent ID of object.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
- Since:
- 10.2025
- ID of closest parent
ApiResponse.<string>
# getProjectDirectory() → {ApiResponse.<string>}
Get project directory
file path
ApiResponse.<string>
# getProjectInfo() → {ApiResponse.<object>}
Get project metadata
- Since:
- 10.2025
//RM
ApiResponse.<object>
# getProperties(objId, inclPropsFromTypes, filter) → {ApiResponse.<object>}
Get all properties of object.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
inclPropsFromTypes |
boolean
|
Include props from types. |
filter |
object
|
Filter criteria. |
ApiResponse.<object>
Examples
* // Example filter object:
const filter = {
name: "MyPset:MyNumber*",
datatype : ["xs:double", "xs:float"]
};
data: {
"MyPset:MyNumber##xs:double": "11",
"MyPset:MyNumberNew##xs:float": 42,
}
# getPropertyTypeInfo(ptKeyStr) → {ApiResponse.<(object|null)>}
Get property type metadata.
Parameters:
| Name | Type | Description |
|---|---|---|
ptKeyStr |
string
|
Access key of property type in the format name##datatype. |
ApiResponse.<(object|null)>
Example
data: {
name: "cnName",
displayName: "cn:Name",
datatype: "xs:string",
readonly: false,
...
}
# getPropertyTypeValues(ptKeyStr, options) → {ApiResponse.<Array.<string>>}
Get unique property values for type.
Parameters:
| Name | Type | Description |
|---|---|---|
ptKeyStr |
string
|
Access key of property type in the format name##datatype. |
options |
object
|
Options for filtering. |
- Since:
- 10.2025
returns list of unique property values
ApiResponse.<Array.<string>>
Example
* // Example options object:
const options = {
objects: ['obj_1', 'obj_2'],
precision: 0.0001,
case_sensitive: true,
interval_size: 2.0,
interval_offset: 1.0,
date_grouping: 'week',
max_values: 0
};
# getPropertyTypes(filter) → {ApiResponse.<Array.<string>>}
Get a list of all available property types matching filter.
Parameters:
| Name | Type | Description |
|---|---|---|
filter |
object
|
Filter criteria. |
ApiResponse.<Array.<string>>
Example
* // Example filter object:
const filter = {
name: "MyPset:MyNumber*",
datatype : ["xs:double", "xs:float"]
readOnly: true
};
# getPropertyTypesByObject(objId, filter) → {ApiResponse.<Array.<object>>}
Get property types used by object.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
filter |
object
|
Filter criteria. |
ApiResponse.<Array.<object>>
Examples
* // Example filter object:
const filter = {
name: "MyPset:MyNumber*",
datatype : ["xs:double", "xs:float"]
readOnly: true
};
data: [
{
name: "MyPset:MyNumber",
displayName: "MyPset:MyNumber",
datatype: "xs:double",
readonly: true,
...
}
]
# getPropertyValue(objId, ptKeyStr) → {ApiResponse.<any>}
Get property value for object.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
ptKeyStr |
string
|
Access key of property type in the format name##datatype. |
-alue of property, depending on the datatype
ApiResponse.<any>
# getPropertyValues(objIds, ptKeyStr) → {ApiResponse.<Array.<object>>}
Get property values for multiple objects.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs. |
ptKeyStr |
string
|
Access key of property type in the format name##datatype. |
Map with object IDs as keys.
ApiResponse.<Array.<object>>
Example
data: {
"id1" : {
"value": 1.234,
"comment": ""
},
...
}
# getRootNodeId(domain) → {ApiResponse.<string>}
Get root node of object trees for a given domain.
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
string
|
Domain (e.g. 'geo') |
- Since:
- 10.2025
returns ID of root node of object trees for a given domain
ApiResponse.<string>
# getRootNodeIdOfSets(domain) → {ApiResponse.<string>}
Get root nodes of smartsets for given domain.
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
string
|
Domain (e.g. 'geo') |
- Since:
- 10.2025
ApiResponse.<string>
# getSelectedObjectIds(domain) → {ApiResponse.<Array.<string>>}
Get IDs of currently selected objects.
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
Array.<string>
|
Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act']. |
- Since:
- 10.2025
returns IDs of currently selected objects
ApiResponse.<Array.<string>>
# getStyleData(styleId, key) → {ApiResponse.<(object|string)>}
Get information about specific style / material attributes.
Parameters:
| Name | Type | Description |
|---|---|---|
styleId |
string
|
Style ID. |
key |
string
|
If specified, only the corresponding attribute is returned, otherwise the entire object. |
- Since:
- 10.2025
Style attribute info.
ApiResponse.<(object|string)>
# getStyleIds() → {ApiResponse.<Array.<string>>}
Get list of Ids of all available styles.
- Since:
- 10.2025
Array of style object Ids.
ApiResponse.<Array.<string>>
# getStyles(objIDs) → {ApiResponse.<Array.<object>>}
Get styles / materials / colors applied to given objects.
Parameters:
| Name | Type | Description |
|---|---|---|
objIDs |
Array.<string>
|
Object IDs. |
- Since:
- 10.2025
Array of applied style / material objects.
ApiResponse.<Array.<object>>
# getViewpointData(objId) → {ApiResponse.<object>}
Get viewpoint data.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID |
JSON object with viewpoint data.
ApiResponse.<object>
# getViewpointIds() → {ApiResponse.<Array.<string>>}
Get list of all viewpoints.
- Since:
- 10.2025
ApiResponse.<Array.<string>>
# getVisibleObjectIds(domain) → {ApiResponse.<Array.<string>>}
Get IDs of currently visible objects in given domain/domains.
Parameters:
| Name | Type | Description |
|---|---|---|
domain |
Array.<string>
|
Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act']. |
- Since:
- 10.2025
returns IDs of currently visible objects in given domain/domains
ApiResponse.<Array.<string>>
# importModel(modelId) → {ApiResponse.<boolean>}
Add model to coordination model. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
modelId |
string
|
Model ID. |
True if successfully added
ApiResponse.<boolean>
# isSelected(objId) → {ApiResponse.<boolean>}
Check if object is selected.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
True if object is selected.
ApiResponse.<boolean>
# isVisible(objId) → {ApiResponse.<boolean>}
Check if object is visible.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
True if object is visible.
ApiResponse.<boolean>
# loginUser(cb, user)
Get user,token from ModelViewer
returns { 'status' : 'data' : { 'user' : " ... " 'token' : " ... " } }
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
cb |
*
|
||
user |
*
|
null |
# onSelectionChanged()
# onVisibilityChanged()
# openUrl(url, target)
Open URL/Link in Browser (target = null -> default browser )
Parameters:
| Name | Type | Description |
|---|---|---|
url |
*
|
|
target |
*
|
# removeModel(modelId) → {ApiResponse.<boolean>}
remove model from project. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
modelId |
string
|
Model ID. |
True if model was successfully removed.
ApiResponse.<boolean>
# removeObjectsFromSmartSet(smartSetId, objIds) → {ApiResponse.<boolean>}
Remove objects from SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
SmartSet ID. |
objIds |
Array.<string>
|
Object IDs to remove. |
- Since:
- 10.2025
True if objects effectivily removed
ApiResponse.<boolean>
# removeStyleSchemaFromSmartSet(smartSetId) → {ApiResponse.<boolean>}
Remove style from SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
ID the SmartSet. |
- Since:
- 10.2025
True if successfully removed.
ApiResponse.<boolean>
# removeViewpointFromSmartSet(smartSetId) → {ApiResponse.<boolean>}
remove viewpoint to SmartSet.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
ID the SmartSet. |
- Since:
- 10.2025
True if successfully removed.
ApiResponse.<boolean>
# resetStylesOfObjects(objIds) → {ApiResponse.<boolean>}
Reset styles to default.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs. |
- Since:
- 10.2025
True if reset succeeded. styles reset to default
ApiResponse.<boolean>
# async restoreProjectContext(ctx, cb) → {Promise.<ApiResponse>}
Restore project context (scope,project) from model viewer (from current project) and store it in infohub context ctx.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
Context
|
|
cb |
*
|
Call back |
Returns object with status and ProjectContext data
Promise.<ApiResponse>
# saveProject() → {ApiResponse.<boolean>}
Save current project, show SaveFileDialog if project was newly created and no file path is available.
True if project was saved successfully.
ApiResponse.<boolean>
# setInfohubSettings(settings) → {ApiResponse.<void>}
Parameters:
| Name | Type | Description |
|---|---|---|
settings |
object
|
{ 'scope_id' : ' ... ', 'project_shortid' : ' ... ', 'connected_by' : ' ... ' } |
complies with COLNEOpro-API, 2025-10-14, ar
ApiResponse.<void>
# setProperties(objIds, propertyMap) → {ApiResponse.<boolean>}
Set multiple property values. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs. |
propertyMap |
object
|
Key/value pairs, key format name##datatype |
ApiResponse.<boolean>
Example
* // Example propertyMap object:
const propertyMap = {
"myType##xs:string": "ABC",
"myNumber##xs:double": 1.234,
"myBoolean##xs:boolean": true
};
# setPropertyValue(objId, ptKeyStr, value) → {ApiResponse.<boolean>}
Set single property value. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID. |
ptKeyStr |
string
|
Access key of property type in the format name##datatype. |
value |
string
|
New value. |
ApiResponse.<boolean>
# setSelected(objIds, flagOnOff, exclusively) → {ApiResponse.<number>}
Set selection of objects.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs. |
flagOnOff |
boolean
|
Selection flag. |
exclusively |
boolean
|
If true, clear all other selections. |
- Since:
- 10.2025
Number of objects whose selection changed.
ApiResponse.<number>
# setViewpointData(objId, viewpointData) → {ApiResponse.<boolean>}
Set viewpoint data.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID |
viewpointData |
object
|
Viewpoint data to set. |
True if viewpoint data was set.
ApiResponse.<boolean>
# setVisible(objIds, flagOnOff, exclusively) → {ApiResponse.<number>}
Set visibility of objects.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs. |
flagOnOff |
boolean
|
true: visible, false: hidden |
exclusively |
boolean
|
If the 'exclusivly' flag is set to true, the domains affected are determined by the specified objects. The remaining objects in these domains are set to the inverse status. |
- Since:
- 10.2025
Number of objects whose status changed.
ApiResponse.<number>
# toggleSelection(objIds) → {ApiResponse.<void>}
Toggle selection status of given objects.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs to toggle. |
ApiResponse.<void>
# toggleVisibility(objIds) → {ApiResponse.<void>}
Toggle visibility of given objects.
Parameters:
| Name | Type | Description |
|---|---|---|
objIds |
Array.<string>
|
Object IDs to toggle. |
ApiResponse.<void>
# updateSmartSet(smartSetId) → {ApiResponse.<boolean>}
Update SmartSet. Synchronizes with Infohub.
Parameters:
| Name | Type | Description |
|---|---|---|
smartSetId |
string
|
SmartSet ID. |
True if SmartSet was updated.
ApiResponse.<boolean>
# updateStyle(styleId, styleData) → {ApiResponse.<boolean>}
Update style / material.
Parameters:
| Name | Type | Description |
|---|---|---|
styleId |
string
|
Style ID. |
styleData |
object
|
Updated style data. |
True if style was updated.
ApiResponse.<boolean>
# updateViewpoint(objId, data) → {ApiResponse.<boolean>}
Update existing viewpoint.
Parameters:
| Name | Type | Description |
|---|---|---|
objId |
string
|
Object ID |
data |
object
|
Data for the viewpoint in JSON notation |
- Since:
- 10.2025
True if update was successful.
ApiResponse.<boolean>