Infohub JS API
Loading...
Searching...
No Matches
IModelViewer Class Reference

Description

Common interface and base class for Model Viewers such as DESITE, COLNEO Pro, Web Viewer, etc.

To create an instance of a ModelViewer use one of the Factory Methods of the specific service classes such as COLNEOproAdapterServices, etc.

Example:

const { COLNEOproAdapterServices } = await import("./node_modules/@colneo/infohub-js-api/dist/adapter/AdapterColneoPro.js");
Infohub.ModelViewer = await COLNEOproAdapterServices.createAdapter()
Adapter Services for COLNEO pro.
Definition AdapterColneoPro.js:53
static async createAdapter()
Create instance of COLNEO pro API class.
Definition AdapterColneoPro.js:73

If the user changes the selection or visibility of objects in the 3D-scene these events are thrown:

Event `selection-changed` when selection of objects in 3d view is changed
Event `visibility-changed` when visibility of objects in 3d view is changed

To connect to these events use connectModelViewer().

Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.
Inheritance diagram for IModelViewer:

Public Member Functions

async addObjectsToSmartSet (smartSetId, objIds, includeChildren)
 addSelectionEventListener (listener)
 addStyleSchemaToSmartSet (smartSetId, options)
 addViewpointToSmartSet (smartSetId, options)
 addVisibilityEventListener (listener)
 connectModelViewer (on_sc, on_vc, cb)
 constructor (t='unknow', n='unknown', v='0.0.0')
 createModel (name, domain, settings)
 createObject (parentId, data)
 createPropertyType (propData, updateExisting)
async createSmartSet (parentId, name, objectIds, options=null)
async createSmartSetContainer (parentId, name)
 createSmartSetsFromSchema (schema)
 deleteObjects (objIds)
 deletePropertyType (ptKeyStr)
async deleteSmartSet (smartSetId)
 dump ()
get eDomain ()
 filterObjectsByProperties (objIds, filterExpression)
 filterObjectsByStatus (objIds, statusCode, statusFlag)
async getChildIds (objIdList, depth=0)
 getDomainByObject (objId)
 getInfo ()
 getModelIds (domains)
 getModelMetadata (modelId)
 getModuleConfig (moduleConfigName)
 getObject (objId, keys)
 getObjectIds (domain)
 getObjectName (objId)
 getObjects (objIdList, opt)
 getObjectsRootId (domain)
 getPickedPoint ()
 getProperties (objId, inclPropsFromTypes, filter)
 getPropertyTypeInfo (ptKeyStr)
 getPropertyTypes (filter)
 getPropertyTypesByObject (objId, filter)
 getPropertyTypeValues (ptKeyStr, options)
 getPropertyValue (objId, ptKeyStr)
 getPropertyValues (objIds, ptKeyStr)
 getSelectedObjectIds (domains)
 getSmartSetsRootId (domain)
async getView (key)
 getVisibleObjectIds (domains)
 importModel (modelId)
 isSelected (objId)
 isVisible (objId)
async mapToExternalID (internalID)
async mapToInternalID (externalID)
 onSelectionChanged ()
 onVisibilityChanged ()
 openUrl (url, target)
 removeModel (modelId)
async removeObjectsFromSmartSet (smartSetId, objIds)
 removeSelectionEventListener (listener)
 removeStyleSchemaFromSmartSet (smartSetId)
 removeViewpointFromSmartSet (smartSetId)
 removeVisibilityEventListener (listener)
async restoreProjectContext (context, cb)
 setAllSelected (domains, flagOnOff)
 setAllVisible (domains, flagOnOff)
 setModuleConfig (moduleConfigName, settings)
 setProperties (objIds, properties)
 setPropertiesByMap (propertyMap)
 setPropertyValue (objId, ptKeyStr, value)
 setSelected (objIds, flagOnOff, options)
async setView (config)
 setVisible (objIds, flagOnOff, options)
 toggleSelection (objIds)
 toggleVisibility (objIds)
 updateSmartSets (smartSetIds)
async zoomTo (config)

Login, Logout

 loginUser (cb, user=null)
 loginUser_iam (cb, user=null)
 loginUser_idp (cb, user=null)
 logoutUser (cb)

COLNEO infohub

async getInfohubSettings ()
async setInfohubSettings (settings)
async setInfohubSettingsFromContext (ctx)
async restoreContextFromInfohubSettings (ctx)
async saveInfohubSettings ()

Project

async getProjectInfo ()
 getProjectId ()
 getProjectName ()
 setProjectName (n)
 getProjectNumber ()
 setProjectNumber (nr)
 getProjectDirectory (projectId)
 saveProject ()

Object Hierarchy

 getParentId (objId)
 getRootNodeId (domain)
 getRootNodeIdOfSets (domain)

Viewpoints

async showHomeViewpoint ()
 getViewpointIds ()
 createViewpoint (parentId, options)
 updateViewpoint (objId, data)
 activateViewpoint (objId)
 getViewpointData (objId)
 setViewpointData (objId, viewpointData)
 deleteViewpoint (objId)

Styles

 getStyleIds (objID)
 getStyles (styleIDs)
 createStyle (styleData)
 updateStyle (styleId, styleData)
 deleteStyles (styleIds)
 applyStyleToObjects (styleId, objIds)
 resetStylesOfObjects (objIds)
async resetStyles (domains)
 activateStyleScheme (smartSetId)

Viewer Configuration

async setConfig (cfg)
async getConfig ()

Viewer Tools

async transformObject (id, T, includeContained)
 checkOverlapObjectList (idList, overlapAllowed=0.1, statusCallback=null)
async calcOptOBB (objIds)
async checkOverlapObjects (id1, id2)

Public Attributes

 _infohub_project_ctx = null
 apiName = null
 viewerName = null
 viewerVersion = null

Static Public Attributes

static eDomain

Function Documentation

◆ activateStyleScheme()

activateStyleScheme ( smartSetId)

Activate style scheme.

Parameters
{string}smartSetId - ID the SmartSet/Style Scheme.
Returns
{ApiResponse<boolean>} True if successfully activated.
Since
06.2026
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ activateViewpoint()

activateViewpoint ( objId)

Activate a viewpoint.

Parameters
{string}objId - Object ID
Returns
{ApiResponse<boolean>} True if viewpoint was activated.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ addObjectsToSmartSet()

async addObjectsToSmartSet ( smartSetId,
objIds,
includeChildren )

Add objects to SmartSet.

Parameters
{string}smartSetId - SmartSet ID.
{string[]}objIds - Object IDs.
{boolean}includeChildren true: tree structure, false: flat list
Returns
{ApiResponse<int>} Number of added objects
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ addSelectionEventListener()

addSelectionEventListener ( listener)

add selection listener, no extra call back function

Parameters
{*}listener
Returns
{Promise<null>}
Since
08.12.2025, ar
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ addStyleSchemaToSmartSet()

addStyleSchemaToSmartSet ( smartSetId,
options )

Add style to SmartSet.

Parameters
{string}smartSetId - ID the SmartSet.
{object}options
Returns
{ApiResponse<string>} ID of newly created style.
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ addViewpointToSmartSet()

addViewpointToSmartSet ( smartSetId,
options )

Add viewpoint to SmartSet.

Parameters
{string}smartSetId - ID the SmartSet.
{object}options
Returns
{ApiResponse<status>}
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ addVisibilityEventListener()

addVisibilityEventListener ( listener)

add visibility listener, no extra call back function

Parameters
{*}listener
Returns
{Promise<null>}
Since
08.12.2025, ar
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ applyStyleToObjects()

applyStyleToObjects ( styleId,
objIds )

Apply style to objects.

Parameters
{string}styleId - Style ID.
{string[]}objIds - Object IDs.
Returns
{ApiResponse<boolean>} True if objects style has been changed
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ calcOptOBB()

async calcOptOBB ( objIds)

Calculate optimized oriented bounding boxes (OBBs) for given object IDs.

Parameters
{string[]}objIds
Returns
{ApiResponse<object>} Number of affected objects
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ checkOverlapObjectList()

checkOverlapObjectList ( idList,
overlapAllowed = 0.1,
statusCallback = null )

Check overlap of oriented bounding boxes (OBBs) for given IDs every object against every other object.

Objects having no geometry are ignored.

Parameters
{string[]}idList
{number}overlapAllowed - Minimum overlap to report (0.0 - 1.0), default: 0.1
{function|null}statusCallback - Optional callback function to report progress status.
Returns
{ApiResponse<object[]>} data: Array of overlapping OBB pairs. [ { id1: id1, id2: id2, maxOverlap: 0.9 }, ... ]
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ checkOverlapObjects()

async checkOverlapObjects ( id1,
id2 )

Calculate overlap of oriented bounding boxes (OBBs) for two given object IDs.

Parameters
{string}id1
{string}id2
Returns
{ApiResponse<number>} max overlap. example: 0.9 for 90% overlap
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ connectModelViewer()

connectModelViewer ( on_sc,
on_vc,
cb )

@method

@description Connect signals selection changed and visibility changed to given functions.

Returns
{Object}
{
'status' : ...
}
Parameters
{function}on_sc Function to be called on selection changed, null to disconnect
{function}on_vc Function to be called on visibility changed, null to disconnect
{*}cb
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ constructor()

constructor ( t = 'unknow',
n = 'unknown',
v = '0.0.0' )

◆ createModel()

createModel ( name,
domain,
settings )

Create model.

Synchronizes with Infohub.

Parameters
{string}name - Model name.
{string}domain - Domain (e.g. 'geo')
{object}settings - Model settings.
Returns
{ApiResponse<string>} ID of newly created model.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ createObject()

createObject ( parentId,
data )

◆ createPropertyType()

createPropertyType ( propData,
updateExisting )

◆ createSmartSet()

async createSmartSet ( parentId,
name,
objectIds,
options = null )

Create new SmartSet.

Parameters
{string}parentId Id of parent or domain name (eDomain) for topmost
{string}name Name of the SmartSet.
{string[]}objectIds List of object IDs (root nodes, children will be automatically collected). If all objects should be taken into account, use getObjectsRootId(domain) to get ID of root node of domain and add root node of domain as SmartSet Object only. To add specific objects to a SmartSet (Set by enumeration) use objects which are leafs in the object hierarchy as SmartSet Objects.
{object|null}options Additional options for SmartSet creation.

{ "filter": { "skip_openings": true, "skip_assembly_parts": false, "visible_only": false }, "group_by": { "propertytypes": [ "ifcEntity##xs:string", "cnVolume##xs:double" ], "options": { "decimal_precision": 4, "case_sensitive": true, "skip_null_values": true, "interval_size": 5.0, "interval_offset": 0.0, "date_grouping": "week" } } }

Returns
{ApiResponse<string>} ID of newly created SmartSet.
Since
10.2025 @update 09.12.2025, ar
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ createSmartSetContainer()

async createSmartSetContainer ( parentId,
name )

Creates a container in smart sets structure.

Parameters
{string}parentId ID of parent
{string}name Name of container
Returns
{ApiResponse<string>}
Since
10.2025 RM
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ createSmartSetsFromSchema()

createSmartSetsFromSchema ( schema)

Create SmartSets from schema.

Parameters
{object}schema - Schema definition.
Returns
{ApiResponse<string[]>} Array of SmartSet IDs.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ createStyle()

createStyle ( styleData)

Get information about specific style / material attributes.

Parameters
{string}styleId - Style ID.
{string}key - If specified, only the corresponding attribute is returned, otherwise the entire object.
Returns
{ApiResponse<object|string>} Style attribute info.
Since
10.2025 DEPRACTED : 01.2026
   Create a new style / material.
   @param {object} styleData - Style definition.
   @example 
Example styleData: const styleData = { id: "12345", // optional name: "MyStyle", // not empty color: "#rrggbbaa" // valid color value in hexadecimal RGBA format }
Returns
{ApiResponse<string>} ID of newly created style.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ createViewpoint()

createViewpoint ( parentId,
options )

Create a new viewpoint.

Parameters
{string| null} parentId - ID of parent object
{object}options
Returns
{ApiResponse<string>} ID of newly created viewpoint.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ deleteObjects()

deleteObjects ( objIds)

Delete objects by ID.

Synchronizes data with Infohub.

Parameters
{string[]}objIds - IDs of objects to delete.
Returns
{ApiResponse<number>} Number of objects deleted.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ deletePropertyType()

deletePropertyType ( ptKeyStr)

Delete exsisting property type.

Synchronizes with Infohub.

Parameters
{string}ptKeyStr - Access key of property type in the format name##datatype.
Returns
{ApiResponse<boolean>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ deleteSmartSet()

async deleteSmartSet ( smartSetId)

Delete a SmartSet.

Parameters
{string}smartSetId - Id of SmartSet.
Returns
{ApiResponse<boolean>} True if deleted.
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ deleteStyles()

deleteStyles ( styleIds)

Delete styles / materials.

Parameters
{string[]}styleIds - IDs of styles to delete.
Returns
{ApiResponse<boolean>} True if styles deleted.
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ deleteViewpoint()

deleteViewpoint ( objId)

Delete a viewpoint.

Parameters
{string}objId - Object ID
Returns
{ApiResponse<boolean>} True if viewpoint was deleted.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ dump()

dump ( )

Dump info to console @updated 12.01.2026, SW.

Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ eDomain()

get eDomain ( )

◆ filterObjectsByProperties()

filterObjectsByProperties ( objIds,
filterExpression )

◆ filterObjectsByStatus()

filterObjectsByStatus ( objIds,
statusCode,
statusFlag )

Filter objects by status.

Parameters
{string[]}objIds - Object IDs of objects to filter.
{string}statusCode - one of [ 'selected', 'visible', 'wired', 'locked'].
{boolean}statusFlag - true: status, false: inverted status.
Returns
{ApiResponse<string[]>} Filtered object IDs.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getChildIds()

async getChildIds ( objIdList,
depth = 0 )

Collect object Ids contained in objects of objIdList, serach to depth of 'depth' or the complete hiererchy if depth is 0 (default).

Parameters
{*}objIdList Collect child ids from these root objects
{*}depth [optional] Recursion depth, default = 0 (maximum depth)
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getConfig()

async getConfig ( )
Returns
{Promise<ApiResponse>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getDomainByObject()

getDomainByObject ( objId)

Get domain for given object.

Parameters
{*}objId - ID of Object
Returns
{ApiResponse<string>} Domain as eDomain
Since
01.2026 SW
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getInfo()

getInfo ( )

Get name and version of the current ModelViewer.

Returns
{object} JSON object containing name and version.
{
"name" : "...",
"type" : "...",
"version" : ".."
}
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getInfohubSettings()

async getInfohubSettings ( )
Returns
{object} settings object
{
'scope_id' : ' ... ',
'project_shortid' : ' ... ',
'coordinationmodel_shortid' : ' ... ',
'connected_by' : ' ... '
}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getModelIds()

getModelIds ( domains)

Get model IDs for given domains.

Parameters
{eDomain[]}domains - Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act'].
Returns
{ApiResponse<string[]>} Array of model IDs.
Since
10.2025 @updated 01.2026, SW - domains instead of domain
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getModelMetadata()

getModelMetadata ( modelId)

Get metadata for given model.

Parameters
{string}modelId - Model ID.
Returns
{ApiResponse<object>}
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getModuleConfig()

getModuleConfig ( moduleConfigName)
Parameters
{string}moduleConfigName - The name of the module-specific configuration file (e.g., "module_mapping.config").
Returns
{object} module's configuration object
{
"schema_shortid":"...",
}
Since
01.2026, SW
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getObject()

getObject ( objId,
keys )

Get object by ID.

Synchronizes data with Infohub.

Parameters
{string}objId - ID of object.
Returns
{ApiResponse<cnObject>} returns object in GOM format
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getObjectIds()

getObjectIds ( domain)
    Get all object IDs for given domains as list.

    @param {eDomain[]} domain Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act'].
    @returns {ApiResponse<string[]>} Array of object IDs.
    @example
   // example

modelviewer and gom are defined in index.js like this:

import { IModelViewer } from "./node_modules/@colneo/infohub-js-api/dist/adapter/IModelViewer.js"

window.Infohub = {}

window.Infohub.ModelViewer = new IModelViewer() // will be instantiated later by specific product CN pro etc.

import { eDomain } from "./node_modules/@colneo/infohub-js-api/dist/gom/gom.js";

window.gom = {} window.gom.eDomain = eDomain

Ui.MessageComponent.showInfo("Berechne OOBB ... ")

const objectids = (await Infohub.ModelViewer.getObjectIds( gom.eDomain.GEO )).data

console.log( objectids )

Ui.MessageComponent.showInfo( `Berechne OOBB für ${objectids.length} Objekte ... ` )

let count = 0

for( const id of objectids ) {

... do something count++ if( count % 100 == 0 ) { console.log( calc ... ${count} ) } }

Ui.MessageComponent.showInfo( OOBB wurde für ${objectids.length} Objekte berechnet. , 0 )

Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getObjectName()

getObjectName ( objId)

Get Name for given object.

Usually objects have an built-in ID and Name.
The name is stored in a special property such as cnName in DESITE and cnName in COLNEO pro.

Parameters
{*}objId - ID of Object
Returns
{ApiResponse<string>} Object Name
Since
01.2026 SW
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getObjects()

getObjects ( objIdList,
opt )

◆ getObjectsRootId()

getObjectsRootId ( domain)

Get root object ID for given domain.

Parameters
{*}domain - Domain (e.g. 'geo')
Returns
{ApiResponse<string>} Root object ID
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getParentId()

getParentId ( objId)

Get parent ID of object.

Parameters
{string}objId - Object ID.
Returns
{ApiResponse<string>} - ID of closest parent
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getPickedPoint()

getPickedPoint ( )

return { 'intern' : [ ix , iy , iz ], 'global' : [ x , y , z ] }

Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getProjectDirectory()

getProjectDirectory ( projectId)

Get project directory.

Returns
{ApiResponse<string>} file path
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getProjectId()

getProjectId ( )

Get project id.

Since
12.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getProjectInfo()

async getProjectInfo ( )

Get project information about local model viewer project.

Get project metadata

Returns
{ApiResponse<object>} data = {
 "id"                : " ... project id ... ",
 "number"            : " ... "
 "name"              :
 "shortdescription"  : 
 "description"       :
 "absolutepath"      : " ... local path ... ",
 "filename"          : " ... local file name "
}
Since
02.2026
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getProjectName()

◆ getProjectNumber()

◆ getProperties()

getProperties ( objId,
inclPropsFromTypes,
filter )

◆ getPropertyTypeInfo()

getPropertyTypeInfo ( ptKeyStr)

◆ getPropertyTypes()

getPropertyTypes ( filter)

◆ getPropertyTypesByObject()

getPropertyTypesByObject ( objId,
filter )

◆ getPropertyTypeValues()

getPropertyTypeValues ( ptKeyStr,
options )

◆ getPropertyValue()

getPropertyValue ( objId,
ptKeyStr )

Get property value for object.

Parameters
{string}objId - Object ID.
{string}ptKeyStr - Access key of property type in the format name##datatype.
Returns
{ApiResponse<any>} -alue of property, depending on the datatype
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getPropertyValues()

getPropertyValues ( objIds,
ptKeyStr )

◆ getRootNodeId()

getRootNodeId ( domain)

Get root node of object trees for a given domain.

Parameters
{string}domain - Domain (e.g. 'geo')
Returns
{ApiResponse<string>} returns ID of root node of object trees for a given domain
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getRootNodeIdOfSets()

getRootNodeIdOfSets ( domain)

Get root nodes of smartsets for given domain.

Parameters
{string}domain - Domain (e.g. 'geo')
Returns
{ApiResponse<string>}
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getSelectedObjectIds()

getSelectedObjectIds ( domains)

Get IDs of currently selected objects.

Parameters
{eDomain[]}domains - Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act'].
Returns
{ApiResponse<string[]>} returns IDs of currently selected objects
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getSmartSetsRootId()

getSmartSetsRootId ( domain)

◆ getStyleIds()

getStyleIds ( objID)

Get list of Ids of all available styles.

Returns
{ApiResponse<string[]>} Array of style object Ids.
Since
10.2025 @updated 01.2026
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getStyles()

getStyles ( styleIDs)

Get styles / materials / colors applied to given objects.

Parameters
{string[]}styleIDs - Style IDs.
Returns
{ApiResponse<object[]>} Array of applied style / material objects.
Since
10.2025 @updated 01.2026
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getView()

◆ getViewpointData()

getViewpointData ( objId)

Get viewpoint data.

Parameters
{string}objId - Object ID
Returns
{ApiResponse<object>} JSON object with viewpoint data.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getViewpointIds()

getViewpointIds ( )

Get list of all viewpoint ids.

Returns
{ApiResponse<string[]>}
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ getVisibleObjectIds()

getVisibleObjectIds ( domains)

Get IDs of currently visible objects in given domain/domains.

Parameters
{eDomain[]}domains - Domain (e.g. 'all') or combination as array, e.g. ['geo', 'act'].
Returns
{ApiResponse<string[]>} returns IDs of currently visible objects in given domain/domains
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ importModel()

importModel ( modelId)

Add model to coordination model.

Synchronizes with Infohub.

Parameters
{string}modelId - Model ID.
Returns
{ApiResponse<boolean>} True if successfully added @updated 01.2026, SW modelId instead of filename
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ isSelected()

isSelected ( objId)

Check if object is selected.

Parameters
{string}objId - Object ID.
Returns
{ApiResponse<boolean>} True if object is selected.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ isVisible()

isVisible ( objId)

Check if object is visible.

Parameters
{string}objId - Object ID.
Returns
{ApiResponse<boolean>} True if object is visible.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ loginUser()

loginUser ( cb,
user = null )

◆ loginUser_iam()

loginUser_iam ( cb,
user = null )

◆ loginUser_idp()

loginUser_idp ( cb,
user = null )

◆ logoutUser()

logoutUser ( cb)

@description Logout user.

Clear user and token.

Parameters
{function}cb Callback function
Returns
{ApiResponse<Object>} response
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ mapToExternalID()

async mapToExternalID ( internalID)

Maps one internal object ID to their corresponding external (IFC) ID.

The returned object uses internal IDs as keys and external IDs as values. In most cases, the internal and external IDs may be identical (except DESITE Version > 3.4.0).

Parameters
{string}internalID - internal element ID
Returns
{Promise<Object<string, string>>} A promise that resolves to a mapping object in the format: { internalID: externalID }.
Since
01.2026, SW
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ mapToInternalID()

async mapToInternalID ( externalID)

Maps external (IFC) ID to their corresponding internal element ID(s).

The returned object uses the external ID as keys and internal IDs as values. In most cases, the internal and external IDs may be identical (except DESITE Version > 3.4.0).

Parameters
{string}externalID - external (IFC) ID to be mapped.
Returns
{Promise<Object<string, string>>} mapping object in the format: { externalID: internalID }.
Since
01.2026, SW
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ onSelectionChanged()

◆ onVisibilityChanged()

◆ openUrl()

openUrl ( url,
target )

Open URL/Link in Browser (target = null -> default browser ).

Parameters
{*}url
{*}target Open URL in this target (ignore, no effect now, -> future use for tabs etc.)
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ removeModel()

removeModel ( modelId)

remove model from project.

Synchronizes with Infohub.

Parameters
{string}modelId - Model ID.
Returns
{ApiResponse<boolean>} True if model was successfully removed.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ removeObjectsFromSmartSet()

async removeObjectsFromSmartSet ( smartSetId,
objIds )

Remove objects from SmartSet.

Parameters
{string}smartSetId - SmartSet ID.
{string[]}objIds - Object IDs to remove.
Returns
{ApiResponse<boolean>} True if objects effectivily removed
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ removeSelectionEventListener()

removeSelectionEventListener ( listener)

remove selection listener, no extra call back function

Parameters
{*}listener
Returns
{Promise<null>}
Since
08.12.2025, ar
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ removeStyleSchemaFromSmartSet()

removeStyleSchemaFromSmartSet ( smartSetId)

Remove style from SmartSet.

Parameters
{string}smartSetId - ID the SmartSet.
Returns
{ApiResponse<boolean>} True if successfully removed.
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ removeViewpointFromSmartSet()

removeViewpointFromSmartSet ( smartSetId)

remove viewpoint to SmartSet.

Parameters
{string}smartSetId - ID the SmartSet.
Returns
{ApiResponse<boolean>} True if successfully removed.
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ removeVisibilityEventListener()

removeVisibilityEventListener ( listener)

remove visibility listener, no extra call back function

Parameters
{*}listener
Returns
{Promise<null>}
Since
08.12.2025, ar
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ resetStyles()

async resetStyles ( domains)

◆ resetStylesOfObjects()

resetStylesOfObjects ( objIds)

Reset styles to default.

Parameters
{string[]}objIds - Object IDs.
Returns
{ApiResponse<boolean>} True if reset succeeded. styles reset to default
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ restoreContextFromInfohubSettings()

async restoreContextFromInfohubSettings ( ctx)

Get infohub settings from ModelViewer (scope,project,coordmodel) and set it to Infohub Context.

Parameters
{*}ctx Write settings to this Infohub Context
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ restoreProjectContext()

async restoreProjectContext ( context,
cb )

◆ saveInfohubSettings()

async saveInfohubSettings ( )

◆ saveProject()

saveProject ( )

Save current project, show SaveFileDialog if project was newly created and no file path is available.

Returns
{ApiResponse<boolean>} True if project was saved successfully.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setAllSelected()

setAllSelected ( domains,
flagOnOff )

Set all objects of specified domains as selected or deselected.

Example:

// assume a COLNEO pro adapter is instantiated (e.g. in index.js) ...
const { COLNEOproAdapterServices } = await import("./node_modules/@colneo/infohub-js-api/dist/adapter/AdapterColneoPro.js");
Infohub.ModelViewer = await COLNEOproAdapterServices.createAdapter()
// clear selection of objects in domain 'geometry'
Infohub.ModelViewer.setAllSelected( [ Infohub.ModelViewer.eDomain.GEO ], false )
Parameters
{boolean}flagOnOff
{string[]}domains
Returns
{ApiResponse<void>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setAllVisible()

setAllVisible ( domains,
flagOnOff )

◆ setConfig()

async setConfig ( cfg)

Set viewer configuration.


Changes configuration partially!

Parameters
{*}cfg = {
"edges" : bool,     // draw edges of objects

"grid"  : {
    "show"  : bool,
    "color" : #hex
},

"background" : {
    "color" : #hex
}
}
Returns
{Promise<ApiResponse>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setInfohubSettings()

async setInfohubSettings ( settings)
Parameters
{object}settings { 'scope_id' : ' ... ', 'project_shortid' : ' ... ', 'coordinationmodel_shortid' : ' ... ', 'connected_by' : ' ... ' }
Returns
{ApiResponse<void>} complies with COLNEOpro-API, 2025-10-14, ar
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setInfohubSettingsFromContext()

async setInfohubSettingsFromContext ( ctx)

◆ setModuleConfig()

setModuleConfig ( moduleConfigName,
settings )
Parameters
{string}moduleConfigName - The name of the module-specific configuration file (e.g., "module_mapping.config").
{Object}settings - An object containing configuration values, e.g: { "schema_shortid":"fl0Ke_IGoV8=", }
Returns
{ApiResponse<void>}
Since
01.2026, SW
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setProjectName()

◆ setProjectNumber()

◆ setProperties()

setProperties ( objIds,
properties )

◆ setPropertiesByMap()

setPropertiesByMap ( propertyMap)

Set properties in a batch by a property map object -> properties.

Parameters
{*}propertyMap {
    "object id 1" : {
        "proptypeid1" : value1,
        "proptypeid2" : value2
    },
    "object id 2" : {
        "proptypeid1" : value1,
        "proptypeid2" : value2,
        "proptypeid3" : value3,
    },
}
Returns
{ApiResponse<boolean>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setPropertyValue()

setPropertyValue ( objId,
ptKeyStr,
value )

Set single property value.

Synchronizes with Infohub.

Parameters
{string}objId - Object ID.
{string}ptKeyStr - property typeidö in the format name##datatype.
{string}value - New value.
Returns
{ApiResponse<boolean>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setSelected()

setSelected ( objIds,
flagOnOff,
options )

Set selection of objects.

Parameters
{string[]}objIds - Object IDs.
{boolean}flagOnOff - Selection flag.
{Object}[options] - Optional configuration object.
{boolean}[options.with_children=false] - Include child objects.
{boolean}[options.exclusively=false] - If true, clear all other selections.
Returns
{ApiResponse<number>} Number of objects whose selection changed.
Since
02.2026 RM
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setView()

◆ setViewpointData()

setViewpointData ( objId,
viewpointData )

Set viewpoint data.

Parameters
{string}objId - Object ID
{object}viewpointData - Viewpoint data to set.
Returns
{ApiResponse<boolean>} True if viewpoint data was set.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ setVisible()

setVisible ( objIds,
flagOnOff,
options )

◆ showHomeViewpoint()

async showHomeViewpoint ( )

◆ toggleSelection()

toggleSelection ( objIds)

Toggle selection status of given objects.

Parameters
{string[]}objIds - Object IDs to toggle.
Returns
{ApiResponse<void>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ toggleVisibility()

toggleVisibility ( objIds)

Toggle visibility of given objects.

Parameters
{string[]}objIds - Object IDs to toggle.
Returns
{ApiResponse<void>}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ transformObject()

async transformObject ( id,
T,
includeContained )

Rotate and Translate object.

Rotation is executed first around point 'rotatePoint' with rotation matrix 'rotateMat6rix', then object is translated.

if includeContained is true ont only the geometry of the object itself is transformed but also the included objects ('id' could be a model, a container or an assembly)

Parameters
{*}id
{*}T = { 'move' : [], 'rotate' : { 'pivot' : [ x , y , z ], 'alpha' : val_deg }
}
Returns
{ApiResponse}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ updateSmartSets()

updateSmartSets ( smartSetIds)

Update SmartSets.

Synchronizes with Infohub.

Parameters
{string[]}smartSetIds - array of SmartSet IDs.
Returns
{ApiResponse<boolean>} True if SmartSet was updated.
Since
07.2026 RM
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ updateStyle()

updateStyle ( styleId,
styleData )

Update style / material.

Parameters
{string}styleId - Style ID.
{object}styleData - Updated style data.
Returns
{ApiResponse<boolean>} True if style was updated.
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ updateViewpoint()

updateViewpoint ( objId,
data )

Update existing viewpoint.

Parameters
{string}objId - Object ID
{object}data - Data for the viewpoint in JSON notation
Returns
{ApiResponse<boolean>} True if update was successful.
Since
10.2025
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ zoomTo()

Member Data Documentation

◆ _infohub_project_ctx

_infohub_project_ctx = null

◆ apiName

◆ eDomain

eDomain
static
Initial value:
= {
GEO: "geo",
ACT: "act",
BOQ: "boq",
DOC: "doc",
TYP: "typ",
ISS: "iss",
RES: "res",
BST: "bst",
CST: "cst",
ALL: "all"
}
Examples
C:/xampp/htdocs/InfohubJsApi/src/adapter/IModelViewer.js.

◆ viewerName

◆ viewerVersion