Model

class Communicator.Model()

Object representing the model geometry and its associated data. All major functionality for querying the model hierarchy, retrieving geometry data and loading additional model data are part of this object.

More information can be found here.

Methods

activateCADConfiguration()

activateCADDefaultConfiguration()

activateCADView()

activateCadConfiguration()

activateCadView()

activateDefaultCadConfiguration()

activateDefaultCadView()

addPropertyToNode()

cadConfigurationsEnabled()

clear()

clearNodeFaceVisibility()

clearNodeLineVisibility()

clearNodePointVisibility()

computeMinimumBodyBodyDistance()

computeMinimumFaceFaceDistance()

computeMinimumFaceLineDistance()

computeMinimumFaceRayDistance()

createAndAddBody()

createAndAddRepresentationItem()

createCADView()

createCadView()

createImage()

createMesh()

createMeshInstance()

createNode()

createPMIInstance()

createPart()

createPmiInstance()

deleteImages()

deleteMeshInstances()

deleteMeshes()

deleteNode()

getAbsoluteRootNode()

getActiveCadConfiguration()

getAssociatedModelKey()

getBimIdConnectedElements()

getBimIdFromNode()

getBimIdRelatedElements()

getBimIdRelatingElements()

getBimIdsFromGenericId()

getBimInfoFromBimId()

getBranchVisibility()

getCADActiveConfiguration()

getCADConfigurations()

getCADDefaultConfiguration()

getCADViewPMIs()

getCADViews()

getCadConfigurations()

getCadViewConfiguration()

getCadViewMap()

getCadViewPmis()

getCadViews()

getClientDimensions()

getDataFromIds()

getDataFromKeys()

getDefaultCadConfiguration()

getDefaultCadView()

getEdgeAttributes()

getEdgeCount()

getEdgeProperty()

getFaceAttributes()

getFaceCount()

getFaceProperty()

getFilterName()

getFilters()

getFiltersWithNode()

getGenericIdFromBimId()

getGenericTypeIdMap()

getGenericTypes()

getIfcNodeIds()

getIfcTypeByNodeId()

getIfcTypes()

getLayerIdsFromName()

getLayerName()

getLayers()

getLooseBounding()

getLowestAvailableNodeID()

getLowestAvailableNodeId()

getMeshIds()

getMetallicRoughness()

getModelBounding()

getModelFileNameFromNode()

getModelFileTypeFromNode()

getNodeChildren()

getNodeColorMap()

getNodeEffectiveFaceColor()

getNodeEffectiveLineColor()

getNodeEffectivePointColor()

getNodeExchangeId()

getNodeFaceColor()

getNodeFaceHighlighted()

getNodeGenericId()

getNodeGenericType()

getNodeIDFromSCInstanceKey()

getNodeIdFromBimId()

getNodeIdOffset()

getNodeIdsByGenericIds()

getNodeIdsByIfcGuids()

getNodeLayerId()

getNodeLineColor()

getNodeLineHighlighted()

getNodeMatrix()

getNodeMeshData()

getNodeName()

getNodeNetMatrix()

getNodeParent()

getNodePointColor()

getNodePointHighlighted()

getNodeProperties()

getNodeRealBounding()

getNodeType()

getNodeUnitMultiplier()

getNodeUserData()

getNodeUserDataIndices()

getNodeVisibility()

getNodesBounding()

getNodesByGenericType()

getNodesByIfcType()

getNodesCullingVectors()

getNodesEffectiveFaceColor()

getNodesEffectiveLineColor()

getNodesEffectiveOpacity()

getNodesEffectivePointColor()

getNodesEffectiveTransparency()

getNodesFaceColor()

getNodesFromFiltersId()

getNodesFromLayer()

getNodesFromLayerName()

getNodesFromLayers()

getNodesHaveTransparency()

getNodesHighlighted()

getNodesInstancingSamePart()

getNodesLineColor()

getNodesOpacity()

getNodesPointColor()

getNodesTransparency()

getOutOfHierarchy()

getPMIColor()

getPMIColorOverride()

getPMISubtype()

getPMIType()

getPMIs()

getPmiColor()

getPmiColorOverride()

getPmiSubtype()

getPmiTopologyReferences()

getPmiType()

getPmis()

getPointAttributes()

getPrimaryModelId()

getPrimaryModelKey()

getRelationshipTypesFromBimId()

getRootNode()

getSCInstanceKey()

getUniqueLayerNames()

getUnitMultiplier()

getViewAxes()

getVisibilityState()

hasDepthRange()

hasEffectiveGenericType()

isAnnotationView()

isDrawing()

isFaceMeasurable()

isLineMeasurable()

isMeasurable()

isNodeLoaded()

isWithinExternalModel()

loadMeasurementFromFile()

loadMeasurementFromJson()

loadMeasurementFromString()

loadSubtreeFromModel()

loadSubtreeFromScsBuffer()

loadSubtreeFromScsFile()

loadSubtreeFromScsXmlBuffer()

loadSubtreeFromScsXmlFile()

loadSubtreeFromUrl()

loadSubtreeFromXML()

loadSubtreeFromXmlBuffer()

loadSubtreeFromXmlFile()

registerBimNodes()

registerIfcNodes()

replaceMesh()

requestNodes()

reset()

resetModelHighlight()

resetModelOpacity()

resetModelTransparency()

resetNodeMatrixToInitial()

resetNodesColor()

resetNodesOpacity()

resetNodesTransform()

resetNodesTransparency()

resetNodesVisibility()

setBehaviorInitiallyHidden()

setBodyNodesVisibility()

setDepthRange()

setEdgeProperty()

setEnableAutomaticUnitScaling()

setFaceProperty()

setInstanceModifier()

setMeshLevel()

setMetallicRoughness()

setNodeFaceColor()

setNodeFaceHighlighted()

setNodeFaceVisibility()

setNodeLineColor()

setNodeLineHighlighted()

setNodeLineVisibility()

setNodeMatrix()

setNodePointColor()

setNodePointHighlighted()

setNodePointVisibility()

setNodesColors()

setNodesCullingVector()

setNodesFaceColor()

setNodesHighlighted()

setNodesLineColor()

setNodesLinePattern()

setNodesOpacities()

setNodesOpacity()

setNodesPointColor()

setNodesTexture()

setNodesTransparencies()

setNodesTransparency()

setNodesVisibilities()

setNodesVisibility()

setPMIColor()

setPMIColorOverride()

setPart()

setPhysicalProperties()

setPmiColor()

setPmiColorOverride()

setViewAxes()

switchToModel()

triangulatePolygon()

unsetDepthRange()

unsetMetallicRoughness()

unsetNodeFaceColor()

unsetNodeLineColor()

unsetNodePointColor()

unsetNodesCullingVectors()

unsetNodesFaceColor()

unsetNodesLineColor()

unsetNodesLinePattern()

unsetNodesPointColor()

unsetNodesTexture()

viewAxesHaveBeenSet()


Methods

activateCADConfiguration

Communicator.Model.activateCADConfiguration(nodeId)

Note

activateCADConfiguration is deprecated: Use activateCadConfiguration instead.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[void]

activateCADDefaultConfiguration

Communicator.Model.activateCADDefaultConfiguration()

Note

activateCADDefaultConfiguration is deprecated: Use activateDefaultCadConfiguration instead.

Return type

Promise[void]

activateCADView

Communicator.Model.activateCADView(nodeId, duration)

Note

activateCADView is deprecated: Use activateCadView instead.

Arguments
  • nodeId (Communicator.NodeId()) –

  • duration ({  }()) –

Return type

Promise[void]

activateCadConfiguration

Communicator.Model.activateCadConfiguration(nodeId)

Activates a CAD configuration

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[void]

Returns

None.

activateCadView

Communicator.Model.activateCadView(nodeId, duration)

Activates a CAD View

Arguments
  • nodeId (Communicator.NodeId()) –

  • duration ({  }()) – camera transition time in milliseconds.

Return type

Promise[void]

Returns

None.

activateDefaultCadConfiguration

Communicator.Model.activateDefaultCadConfiguration()

Activates Default CAD configuration

Return type

Promise[void]

Returns

None.

activateDefaultCadView

Communicator.Model.activateDefaultCadView()
Return type

Promise[void]

addPropertyToNode

Communicator.Model.addPropertyToNode(nodeId, propertyName, propertyValue, propertyUnit)

Purpose: Adds a property to the node

Arguments
  • nodeId (Communicator.NodeId()) – node id to set the property on

  • propertyName (string()) –

  • propertyValue (string()) –

  • propertyUnit ([Communicator.UnitElement]()) –

Return type

boolean

Returns

true if all went right, false otherwise

cadConfigurationsEnabled

Communicator.Model.cadConfigurationsEnabled()

Gets whether or not cad configurations are enabled

Return type

Promise[boolean]

Returns

Boolean indicating whether or not cad configurations are enabled

clear

Communicator.Model.clear()

Remove all nodes, CAD views, configurations, and sheets from the model.

Return type

Promise[void]

If you intend to load additional models via the loadSubtree family of methods, you should wait on the resolution of this promise before doing so.

clearNodeFaceVisibility

Communicator.Model.clearNodeFaceVisibility(partId)

Clears the visibility for a node’s face elements, resetting them to default.

Arguments
  • partId (Communicator.PartId()) – the Id of the part to be reset

Return type

void

clearNodeLineVisibility

Communicator.Model.clearNodeLineVisibility(partId)

Clears the visibility for a node’s line elements, resetting them to default.

Arguments
  • partId (Communicator.PartId()) – the Id of the part to clear visibilities from

Return type

void

clearNodePointVisibility

Communicator.Model.clearNodePointVisibility(partId)

Clears the visibility for a node’s point elements, resetting it to default.

Arguments
  • partId (Communicator.PartId()) – the Id of the part to clear visibilities from

Return type

void

computeMinimumBodyBodyDistance

Communicator.Model.computeMinimumBodyBodyDistance(partId1, partId2)

Computes the distance between two bodies

Arguments
  • partId1 (Communicator.PartId()) – id for the part which the first face belongs to

  • partId2 (Communicator.PartId()) – id for the part which the second face belongs to

Return type

Promise[Communicator.FaceFaceDistanceItem]

Returns

a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes

computeMinimumFaceFaceDistance

Communicator.Model.computeMinimumFaceFaceDistance(partId1, faceId1, partId2, faceId2)

Computes the distance between two faces

Arguments
  • partId1 (Communicator.PartId()) – id for the part which the first face belongs to

  • faceId1 (number()) – id for the face in the first part

  • partId2 (Communicator.PartId()) – id for the part which the second face belongs to

  • faceId2 (number()) – id for the face in the second part

Return type

Promise[Communicator.FaceFaceDistanceItem]

Returns

a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes

computeMinimumFaceLineDistance

Communicator.Model.computeMinimumFaceLineDistance(partId, faceId, ray)

Computers the minimum distance between a face and an infinite line.

Arguments
  • partId (Communicator.PartId()) –

  • faceId (number()) – id of the face in the node

  • ray (Communicator.Ray()) – the line (in the form of a ray) to test against

Return type

Promise[Communicator.FaceFaceDistanceItem]

Returns

a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes

computeMinimumFaceRayDistance

Communicator.Model.computeMinimumFaceRayDistance(partId, faceId, ray)

Computers the minimum distance between a face and a ray.

Arguments
  • partId (Communicator.PartId()) –

  • faceId (number()) – id of the face in the node

  • ray (Communicator.Ray()) – the ray to test against

Return type

Promise[Communicator.FaceFaceDistanceItem]

Returns

a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes

createAndAddBody

Communicator.Model.createAndAddBody(partNodeId, repItemId)

Note

createAndAddBody is deprecated: Use createAndAddRepresentationItem instead.

Arguments
  • partNodeId ({  }()) –

  • repItemId ({  }()) –

Return type

{  }

createAndAddRepresentationItem

Communicator.Model.createAndAddRepresentationItem(partNodeId, repItemId)

Creates a representation item on a part

Arguments
  • partNodeId ({  }()) – ID of the part node

  • repItemId ({  }()) – (optional) Id you want the node to have, if not specified the nodeId will be set automatically. Be aware that if the specified node Id is already used by another node, then it will be ignored and a new one will be set automatically.

Return type

{  }

Returns

node ID to access the created representation item, null is returned if something went wrong

createCADView

Communicator.Model.createCADView(nodeId, viewName, camera, pmiIds, nodesToShow, nodesToHide, nodesIdAndLocalTransforms, cuttingPlane, meshInstanceData)

Note

createCADView is deprecated: Use createCadView instead.

Arguments
  • nodeId (Communicator.NodeId()) –

  • viewName (string()) –

  • camera (Communicator.Camera()) –

  • pmiIds ([Communicator.PmiId]()) –

  • nodesToShow ([Communicator.NodeId]()) –

  • nodesToHide ([Communicator.NodeId]()) –

  • nodesIdAndLocalTransforms ([(Communicator.NodeId, Communicator.Matrix)]()) –

  • cuttingPlane (Communicator.Plane()) –

  • meshInstanceData (Communicator.MeshInstanceData()) –

Return type

{  }

createCadView

Communicator.Model.createCadView(nodeId, viewName, camera, pmiIds, nodesToShow, nodesToHide, nodeIdsAndLocalTransforms, cuttingPlane, meshInstanceData)

Creates a CAD view. This method will trigger a “cadViewCreated” callback if the creation is successful.

Arguments
  • nodeId (Communicator.NodeId()) –

  • viewName (string()) – Name of the view

  • camera (Communicator.Camera()) – Camera that will be set when the view gets activated

  • pmiIds ({  }()) – (optional, pass null or empty array if none to send) Node IDs of the PMI to show for the view

  • nodesToShow ({  }()) – (optional, pass null or empty array if none to send) Node IDs of the elements to force visibility on

  • nodesToHide ({  }()) – (optional, pass null or empty array if none to send) Node IDs of the elements to force visibility off

  • nodeIdsAndLocalTransforms ({  }()) – (optional, pass null or empty array if none to send) array of node ID and matrix pair, defining specific local transform to apply

  • cuttingPlane ({  }()) – (optional, pass null if none to send) Cutting plane to set when the view gets activated

  • meshInstanceData ({  }()) – (optional, pass null if none to send) object that specifies the data for the mesh instance of the rectangular frame (mostly found on capture views)

Return type

{  }

Returns

id of the view, null is returned if the function fails

createImage

Communicator.Model.createImage(primaryImage, thumbnailImage)

Creates an image that can be applied as a texture via setNodesTexture See deleteImages

Arguments
  • primaryImage (Communicator.ImageOptions()) – The image data and associated options

  • thumbnailImage (Communicator.ImageOptions()) – If specified, an uncompressed image that will be used as a placeholder for the primary image until it is fully loaded. Only useful when primaryImage is a compressed image.

Return type

Promise[Communicator.ImageId]

createMesh

Communicator.Model.createMesh(meshData, config)
Arguments
  • meshData (Communicator.MeshData()) – MeshData object containing data to insert into the scene.

  • config ({  }()) –

Return type

Promise[Communicator.MeshId]

Returns

Promise that resolves with a MeshId when the mesh has been created. The MeshId can be used to create instances of the mesh using createMeshInstance

createMeshInstance

Communicator.Model.createMeshInstance(data, parentNodeId, preventFromResetting, isOutOfHierarchy)

Creates an instance of a mesh that has been created using createMesh or retrieved using getMeshIds

Arguments
  • data (Communicator.MeshInstanceData()) – object that specifies the data for this mesh instance

  • parentNodeId ({  }()) – the ID of the desired parent node

  • preventFromResetting ({  }()) – if set to true, then the visibility and positioning won’t be reset when resetxxx() functions gets called.

  • isOutOfHierarchy ({  }()) – True if the node created shouldn’t appear in the model structure.

Return type

Promise[Communicator.NodeId]

Returns

Promise that resolves with a node ID that can be used to perform operations on this instance.

createNode

Communicator.Model.createNode(parentNodeId, nodeName, nodeId, localMatrix, visibility, measurementUnit)

Creates a node

Arguments
  • parentNodeId ({  }()) – ID of the node to link the child node to. This ID should not have a type of Body or BodyInstance. If this parameter is undefined, the child node will be linked to the root.

  • nodeName (string()) –

  • nodeId ({  }()) –

  • localMatrix ({  }()) – (optional) Initial local matrix of the node (identity if none set)

  • visibility ({  }()) – (optional) Initial visibility of the node (visible if nothing set)

  • measurementUnit ({  }()) –

Return type

Communicator.NodeId

Returns

child node ID

createPMIInstance

Communicator.Model.createPMIInstance(data, pmiType, pmiSubType, refOnTopoItems, parentNodeId)

Note

createPMIInstance is deprecated: Use createPmiInstance instead.

Arguments
  • data (Communicator.MeshInstanceData()) –

  • pmiType (Communicator.PmiType()) –

  • pmiSubType (Communicator.PmiSubType()) –

  • refOnTopoItems ([Communicator.RefOnTopoItem]()) –

  • parentNodeId (Communicator.NodeId()) –

Return type

Promise[Communicator.PmiId]

createPart

Communicator.Model.createPart(nodeId)

Creates an part node

Arguments
  • nodeId ({  }()) –

Return type

Communicator.PartId

Returns

a node ID to access the created part node

createPmiInstance

Communicator.Model.createPmiInstance(data, pmiType, pmiSubType, refOnTopoItems, parentNodeId)

Creates a PMI Instance from a mesh that has been created using the createMesh method.

Arguments
  • data (Communicator.MeshInstanceData()) – object that specifies the data for the PMI graphic representation

  • pmiType (Communicator.PmiType()) – see PmiType enum (Datum, Gdt, Dimension…)

  • pmiSubType (Communicator.PmiSubType()) – see PmiSubType enum (DatumTarget, GdtFcf, DimensionDistance…)

  • refOnTopoItems ([Communicator.RefOnTopoItem]()) – see RefOnTopoItem. It defines the PMI links to a body element, like a face or an edge

  • parentNodeId ({  }()) – the ID of the desired parent node

Return type

Promise[Communicator.PmiId]

Returns

Promise that resolves with a node ID that can be used to perform operations on this instance. You can use deleteMeshInstances() to delete the PMI

deleteImages

Communicator.Model.deleteImages(imageIds)

Deletes images created with createImage

Arguments
  • imageIds ([Communicator.ImageId]()) – The IDs of the images to be deleted

Return type

Promise[void]

deleteMeshInstances

Communicator.Model.deleteMeshInstances(nodeIds)

Deletes mesh instances that have been created at run time

Arguments
  • nodeIds ([Communicator.NodeId]()) – array of IDs for mesh instances created at run time that should be destroyed

Return type

Promise[void]

Returns

Promise that resolves when this operation has completed.

deleteMeshes

Communicator.Model.deleteMeshes(ids)

Deletes meshes that have been created at run time.

Arguments
  • ids ([Communicator.MeshId]()) –

Return type

Promise[void]

Returns

Promise that resolves when this operation has completed.

In order for this method to succeed, all mesh instances created for the given IDs must have also been destroyed with deleteMeshInstances

deleteNode

Communicator.Model.deleteNode(nodeId)

Delete a node and all its children

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[void]

getAbsoluteRootNode

Communicator.Model.getAbsoluteRootNode()

Returns the absolute root node of the assembly tree.

Return type

Communicator.NodeId

Returns

Id for the model tree root node or null if the model structure is not loaded.

getActiveCadConfiguration

Communicator.Model.getActiveCadConfiguration()

Gets Active CAD configuration

Return type

{  }

Returns

ID of activated CAD Configuration

getAssociatedModelKey

Communicator.Model.getAssociatedModelKey(nodeId)
Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[{  }]

getBimIdConnectedElements

Communicator.Model.getBimIdConnectedElements(node, bimId, type)

Retrieve all relationships that a bim id have, sorted in 2 arrays (relateds and relatings)

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimId (Communicator.BimId()) – bim id for which you want its relationships.

  • type (Communicator.RelationshipType()) –

Return type

function

Returns

double array of bim id of relationship of the BimId sorted by its relateds and its relatings.

getBimIdFromNode

Communicator.Model.getBimIdFromNode(node)

Retrieves the bim id of the corresponding node id.

Arguments
  • node (Communicator.NodeId()) – the id of the node for which you want its bim id.

Return type

{  }

Returns

the bim id corresponding to the node or null if none.

getBimIdRelatedElements

Communicator.Model.getBimIdRelatedElements(node, bimId, type)

Retrieve all related relationships that a bim id have.

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimId (Communicator.BimId()) – bim id for which you want its related relationships.

  • type (Communicator.RelationshipType()) –

Return type

[Communicator.BimId]

Returns

array of bim id which are the related relationship of the BimId.

getBimIdRelatingElements

Communicator.Model.getBimIdRelatingElements(node, bimId, type)

Retrieve all relating relationships that a bim id have.

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimId (Communicator.BimId()) – bim id for which you want its relating relationships.

  • type (Communicator.RelationshipType()) –

Return type

[Communicator.BimId]

Returns

array of bim id which are the relating relationship of the BimId.

getBimIdsFromGenericId

Communicator.Model.getBimIdsFromGenericId(ifcGuid)

Retrieves the bim ids of the corresponding generic id.

Arguments
  • ifcGuid (Communicator.GenericId()) – the generic id for which you want its bim id.

Return type

[Communicator.BimId]

Returns

the bim id corresponding to the ifcGuid or null if none.

getBimInfoFromBimId

Communicator.Model.getBimInfoFromBimId(node, bimId)

Retrieve the name of the bim element

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimId (Communicator.BimId()) – bim id for which you want the bim element name.

Return type

function

Returns

the name and the info regarding the connection to a node of the bim element.

getBranchVisibility

Communicator.Model.getBranchVisibility(nodeId)

Branch visibility indicates the visibility state for all of a node’s children.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node at the root of the branch.

Return type

Communicator.BranchVisibility

Returns

Shown/Hidden if all children have the same visibility state, Mixed otherwise.

getCADActiveConfiguration

Communicator.Model.getCADActiveConfiguration()

Note

getCADActiveConfiguration is deprecated: Use getActiveCadConfiguration instead.

Return type

{  }

getCADConfigurations

Communicator.Model.getCADConfigurations()

Note

getCADConfigurations is deprecated: Use getCadConfigurations instead.

Return type

Communicator.IdStringMap

getCADDefaultConfiguration

Communicator.Model.getCADDefaultConfiguration()

Note

getCADDefaultConfiguration is deprecated: Use getDefaultCadConfiguration instead.

Return type

{  }

getCADViewPMIs

Communicator.Model.getCADViewPMIs(nodeId)

Note

getCADViewPMIs is deprecated: Use getCadViewPmis instead.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

[Communicator.PmiId]

getCADViews

Communicator.Model.getCADViews()

Note

getCADViews is deprecated: Use getCadViews instead.

Return type

Communicator.IdStringMap

getCadConfigurations

Communicator.Model.getCadConfigurations()

Gets CAD configurations

Return type

Communicator.IdStringMap

Returns

an object mapping CAD configuration ID to config name

getCadViewConfiguration

Communicator.Model.getCadViewConfiguration(cadViewNodeId)

Get the configuration in which the view is defined

Arguments
  • cadViewNodeId (Communicator.NodeId()) –

Return type

{  }

Returns

ID of CAD Configuration of the view

getCadViewMap

Communicator.Model.getCadViewMap()

Gets CAD View information for this model.

Return type

Map[Communicator.NodeId, string]

Returns

a map mapping associating CAD View ID to name

getCadViewPmis

Communicator.Model.getCadViewPmis(nodeId)

Get PMI IDs for a CAD View

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

[Communicator.PmiId]

Returns

IDs of visible PMIs for the view

getCadViews

Communicator.Model.getCadViews()

Note

getCadViews is deprecated: Use getCadViewMap instead.

Return type

Communicator.IdStringMap

getClientDimensions

Communicator.Model.getClientDimensions()

Returns the dimensions of the client.

Return type

(number, number)

Returns

a pair of numbers, [width, height].

getDataFromIds

Communicator.Model.getDataFromIds(ids)

Returns a chunk of keyed data

Arguments
  • ids (SC.DataIds()) –

Return type

Promise[[Uint8Array]]

Returns

promise that resolves when this operation has completed returning an array of 8bits int arrays for each ModelKey-DataKey pairs

getDataFromKeys

Communicator.Model.getDataFromKeys(ids)

Note

getDataFromKeys is deprecated: Use getDataFromIds instead.

Arguments
  • ids (SC.DataIds()) –

Return type

Promise[[Uint8Array]]

getDefaultCadConfiguration

Communicator.Model.getDefaultCadConfiguration()

Gets CAD default configuration

Return type

{  }

Returns

ID of default CAD Configuration

getDefaultCadView

Communicator.Model.getDefaultCadView()

Gets CAD default view

Return type

{  }

Returns

ID of default CAD Configuration

getEdgeAttributes

Communicator.Model.getEdgeAttributes(nodeId, edgeIndex)

Returns edge attributes for a node of the given node and edge.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve edge properties from

  • edgeIndex (number()) – Index of edge for which to retrieve edge attributes

Return type

Promise[{  }]

Returns

Promise for the requested edge attributes. Properties returned will be null if none associated with the edge.

getEdgeCount

Communicator.Model.getEdgeCount(nodeId)

Returns edge count for a node of the given node.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve edge count from

Return type

Promise[number]

Returns

Promise providing the number of edges

getEdgeProperty

Communicator.Model.getEdgeProperty(nodeId, edgeId)

Returns edge properties for a node of the given node and edge.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve edge properties from

  • edgeId (number()) –

Return type

Promise[{  }]

Returns

Promise for the requested edge properties. Properties returned will be null if none associated with the edge.

getFaceAttributes

Communicator.Model.getFaceAttributes(nodeId, faceIndex)

Returns face attributes for a node of the given node and face.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve edge properties from

  • faceIndex (number()) – Index of face for which to retrieve face attributes

Return type

Promise[{  }]

Returns

Promise for the requested face attributes. Properties returned will be null if none associated with the edge.

getFaceCount

Communicator.Model.getFaceCount(nodeId)

Returns face count for a node of the given node and face.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve face count from

Return type

Promise[number]

Returns

Promise providing the number of faces

getFaceProperty

Communicator.Model.getFaceProperty(nodeId, faceId)

Returns Face properties for a node of the given node and face.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve face properties from

  • faceId (number()) –

Return type

Promise[{  }]

Returns

Promise for the requested face properties. Properties returned will be null if none associated with the face.

getFilterName

Communicator.Model.getFilterName(filterId)
Arguments
  • filterId (Communicator.FilterId()) –

Return type

{  }

Returns

The name of a filter for the given filter ID index or null if filter was not found

getFilters

Communicator.Model.getFilters()

Returns names and ids of all filters available in the scene

Return type

Map[Communicator.FilterId, Communicator.FilterName]

Returns

a map associating Filter IDs to filter names

getFiltersWithNode

Communicator.Model.getFiltersWithNode(nodeIdSearched)
Arguments
  • nodeIdSearched (Communicator.NodeId()) –

Return type

[Communicator.FilterId]

Returns

Filters which retain or remove the given node.

getGenericIdFromBimId

Communicator.Model.getGenericIdFromBimId(node, bimId)

Retrieves the generic id of the corresponding bim id.

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimId (Communicator.BimId()) – bim id for which you want its generic id.

Return type

{  }

Returns

the generic id corresponding to the BimId or null if none.

getGenericTypeIdMap

Communicator.Model.getGenericTypeIdMap()

Gets all generic types and NodeIds with that type.

Return type

Map[Communicator.GenericType, Set[Communicator.NodeId]]

Returns

Map containing generic types and NodeIds

getGenericTypes

Communicator.Model.getGenericTypes()

This function gets all generic types contained in the model.

Return type

[Communicator.GenericType]

Returns

All generic types.

getIfcNodeIds

Communicator.Model.getIfcNodeIds()

Note

getIfcNodeIds is deprecated: Use getGenericTypeIdMap instead.

Return type

Map[Communicator.GenericType, Set[Communicator.NodeId]]

getIfcTypeByNodeId

Communicator.Model.getIfcTypeByNodeId(id)

Note

getIfcTypeByNodeId is deprecated: Use getGenericTypeIdMap instead.

Arguments
  • id (Communicator.NodeId()) –

Return type

{  }

getIfcTypes

Communicator.Model.getIfcTypes()

Note

getIfcTypes is deprecated: Use getGenericTypes instead.

Return type

[Communicator.GenericType]

getLayerIdsFromName

Communicator.Model.getLayerIdsFromName(name)
Arguments
  • name (Communicator.LayerName()) –

Return type

{  }

Returns

Id of layers for the given filter name or null if no layers are found

getLayerName

Communicator.Model.getLayerName(layerId)
Arguments
  • layerId (Communicator.LayerId()) –

Return type

{  }

Returns

The name of a layer for the given filter ID or null if layer was not found

getLayers

Communicator.Model.getLayers()

Returns names and ids of all layers available in the scene

Return type

Map[Communicator.LayerId, Communicator.LayerName]

Returns

a map associating Layer IDs to Layer names

getLooseBounding

Communicator.Model.getLooseBounding()

Gets the world space bounding box for the model. This does not take node visibility into account.

Return type

Promise[Communicator.Box]

Returns

Promise that resolves with a Box representing the world space bounding box of the model.

getLowestAvailableNodeID

Communicator.Model.getLowestAvailableNodeID()

Note

getLowestAvailableNodeID is deprecated: Use getLowestAvailableNodeId instead.

Return type

Communicator.NodeId

getLowestAvailableNodeId

Communicator.Model.getLowestAvailableNodeId()

Returns the lowest available node ID

Return type

Communicator.NodeId

getMeshIds

Communicator.Model.getMeshIds(nodeIds)

Retrieve the MeshId associated with the mesh data attached to the given nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) –

Return type

Promise[[Communicator.MeshId]]

getMetallicRoughness

Communicator.Model.getMetallicRoughness(nodeIds)

Gets the metallic and roughness factors for the supplied nodes materials. Materials that are not currently set to use the Metallic Roughness shading model will have a null entry

Arguments
  • nodeIds ([Communicator.NodeId]()) – List of nodes to get material properties for

Return type

Promise[[{  }]]

getModelBounding

Communicator.Model.getModelBounding(ignoreInvisible, includeExcluded, tightBounding)

Gets the world space bounding box for the model.

Arguments
  • ignoreInvisible (boolean()) –

  • includeExcluded (boolean()) –

  • tightBounding ({  }()) –

Return type

Promise[Communicator.Box]

Returns

Promise that resolves with a Box representing the world space bounding box of the model.

getModelFileNameFromNode

Communicator.Model.getModelFileNameFromNode(nodeId)
Arguments
  • nodeId (Communicator.NodeId()) –

Return type

{  }

Returns

the original file name of the model which contain the given node or null if the node is not found.

getModelFileTypeFromNode

Communicator.Model.getModelFileTypeFromNode(nodeId)
Arguments
  • nodeId (Communicator.NodeId()) –

Return type

{  }

Returns

the original file type of the model which contain the given node or null if the node is not found.

getNodeChildren

Communicator.Model.getNodeChildren(nodeId, includeOutOfHierarchy)

Returns IDs for child nodes for the given Id.

Arguments
  • nodeId (Communicator.NodeId()) –

  • includeOutOfHierarchy ({  }()) – true to include Out Of Hierarchy node, false or null to exclude them

Return type

[Communicator.NodeId]

Returns

ID for the children of this node, or null if the ID is invalid

getNodeColorMap

Communicator.Model.getNodeColorMap(startNodeId, elementType)

Gets a map associating NodeIds to colors that are set on those nodes. Only NodeIds of nodes that have a color set will be included.

Arguments
  • startNodeId (Communicator.NodeId()) – The start node to walk when building the color map.

  • elementType (Communicator.ElementType()) – Returned colors are of this element type.

Return type

Promise[Map[Communicator.NodeId, Communicator.Color]]

getNodeEffectiveFaceColor

Communicator.Model.getNodeEffectiveFaceColor(partId, faceIndex)

Gets the color set via setNodeFaceColor on a face element. If no color has been set, the node’s face color will be returned. If the node’s face color has not been set, the color specified when the model was authored will be returned.

Arguments
  • partId (Communicator.PartId()) –

  • faceIndex (number()) – the index of the face in the node

Return type

Promise[{  }]

getNodeEffectiveLineColor

Communicator.Model.getNodeEffectiveLineColor(partId, lineIndex)

Gets the color set via setNodeLineColor on a line element. If no color has been set, the node’s line color will be returned. If the node’s line color has not been set, the color specified when the model was authored will be returned.

Arguments
  • partId (Communicator.PartId()) –

  • lineIndex (number()) – the index of the line in the node

Return type

Promise[{  }]

getNodeEffectivePointColor

Communicator.Model.getNodeEffectivePointColor(partId, pointIndex)

Gets the color set via setNodePointColor on a point element. If no color has been set, the node’s point color will be returned. If the node’s point color has not been set, the color specified when the model was authored will be returned.

Arguments
  • partId (Communicator.PartId()) –

  • pointIndex (number()) – the index of the point in the node

Return type

Promise[{  }]

getNodeExchangeId

Communicator.Model.getNodeExchangeId(nodeId)

Returns the Exchange ID of a node in the assembly tree.

Arguments
  • nodeId (Communicator.NodeId()) – The node ID to get the Exchange ID of.

Return type

{  }

Returns

The Exchange ID of the node with the given nodeId or null if no Exchange ID is found.

getNodeFaceColor

Communicator.Model.getNodeFaceColor(partId, faceIndex)

Gets the color set via setNodeFaceColor on a face element. If no color has been set, null will be returned. See also: getNodeEffectiveFaceColor

Arguments
  • partId (Communicator.PartId()) –

  • faceIndex (number()) – the index of the face in the node

Return type

Promise[{  }]

getNodeFaceHighlighted

Communicator.Model.getNodeFaceHighlighted(nodeId, faceIndex)

Returns whether the supplied face element has been highlighted with setNodeFaceHighlighted

Arguments
  • nodeId (Communicator.NodeId()) – the ID of the node containing the face element

  • faceIndex (number()) – the index of the face within the node

Return type

Promise[boolean]

getNodeGenericId

Communicator.Model.getNodeGenericId(nodeId)
Arguments
  • nodeId (Communicator.NodeId()) –

Return type

{  }

Returns

the generic id of the given node or null if the node is not found.

getNodeGenericType

Communicator.Model.getNodeGenericType(nodeId)
Arguments
  • nodeId (Communicator.NodeId()) –

Return type

{  }

Returns

the generic type of the given node or null if the node is not found.

getNodeIDFromSCInstanceKey

Communicator.Model.getNodeIDFromSCInstanceKey(inclusionKey, instanceKey)

Returns the body node instance ID for the given SC instance ID

Note

getNodeIDFromSCInstanceKey is deprecated

Arguments
  • inclusionKey (SC.InclusionKey()) –

  • instanceKey (SC.InstanceKey()) –

Return type

{  }

Returns

body node instance ID

getNodeIdFromBimId

Communicator.Model.getNodeIdFromBimId(node, bimID)

Retrieves the node id of the corresponding bim id.

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimID (Communicator.BimId()) – bim id for which you want its node id.

Return type

{  }

Returns

the node id corresponding to the BimId or null if none.

getNodeIdOffset

Communicator.Model.getNodeIdOffset(nodeId)

Retrieves the node ID offset for a given node.

Arguments
  • nodeId (Communicator.NodeId()) – The node to obtain the node ID offset from.

Return type

Communicator.NodeIdOffset

Returns

The node ID offset for the supplied node.

getNodeIdsByGenericIds

Communicator.Model.getNodeIdsByGenericIds(genericIds)

Returns a list of node IDs given a list of generic IDs. Note that the returned list of node IDs may be longer than the provided list of generic IDs since one ID can be used by more than one node.

Arguments
  • genericIds ([Communicator.GenericId]()) – Array of generic IDs to find nodes fore

Return type

[Communicator.NodeId]

Returns

Array of node ids corresponding to the provided generic IDs

getNodeIdsByIfcGuids

Communicator.Model.getNodeIdsByIfcGuids(ifcGuids)

Note

getNodeIdsByIfcGuids is deprecated: Use getNodeIdsByGenericIds instead.

Arguments
  • ifcGuids ([Communicator.IfcGuid]()) –

Return type

[Communicator.NodeId]

getNodeLayerId

Communicator.Model.getNodeLayerId(nodeId)

Returns the layer ID of a node in the assembly tree.

Arguments
  • nodeId (Communicator.NodeId()) – The node ID to get the Exchange ID of.

Return type

{  }

Returns

The layer ID of the node with the given nodeId or null if no layer is found.

getNodeLineColor

Communicator.Model.getNodeLineColor(partId, lineIndex)

Gets the color set via setNodeLineColor on a line element. If no color has been set, null will be returned.

Arguments
  • partId (Communicator.PartId()) –

  • lineIndex (number()) – the index of the line in the node

Return type

Promise[{  }]

getNodeLineHighlighted

Communicator.Model.getNodeLineHighlighted(nodeId, lineIndex)

Returns whether the supplied line element has been highlighted with setNodeLineHighlighted

Arguments
  • nodeId (Communicator.NodeId()) – the ID of the node containing the line element

  • lineIndex (number()) – the index of the line within the node

Return type

Promise[boolean]

getNodeMatrix

Communicator.Model.getNodeMatrix(nodeId)

Returns a copy of the Matrix for a node of the given ID

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Communicator.Matrix

Returns

Copy of the Matrix of the node

getNodeMeshData

Communicator.Model.getNodeMeshData(nodeId)

Fetch the mesh data for a particular node

Arguments
  • nodeId (Communicator.NodeId()) – the node’s ID

Return type

Promise[Communicator.MeshDataCopy]

getNodeName

Communicator.Model.getNodeName(nodeId)

Returns the name for a node in the assembly tree.

Arguments
  • nodeId (Communicator.NodeId()) – The node ID to get the name of.

Return type

{  }

Returns

The name of the node with the given nodeId or null if no name is found.

getNodeNetMatrix

Communicator.Model.getNodeNetMatrix(nodeId)

Returns net matrix for a node of the given ID

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Communicator.Matrix

Returns

Net Matrix of the Node

getNodeParent

Communicator.Model.getNodeParent(nodeId)

Returns the parent Id for the given node id.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

{  }

Returns

ID of the parent node for the supplied ID. If the ID is invalid or the root ID, null is returned.

getNodePointColor

Communicator.Model.getNodePointColor(partId, pointIndex)

Gets the color set via setNodePointColor on a point element. If no color has been set, null will be returned. See also: getNodeEffectivePointColor

Arguments
  • partId (Communicator.PartId()) –

  • pointIndex (number()) – the index of the point in the node

Return type

Promise[{  }]

getNodePointHighlighted

Communicator.Model.getNodePointHighlighted(nodeId, pointIndex)

Returns whether the supplied point element has been highlighted with setNodePointHighlighted

Arguments
  • nodeId (Communicator.NodeId()) – the ID of the node containing the point element

  • pointIndex (number()) – the index of the point within the node

Return type

Promise[boolean]

getNodeProperties

Communicator.Model.getNodeProperties(nodeId)

Returns the properties for the given node ID.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[{  }]

Returns

object properties for the supplied ID, or null if the ID was invalid

getNodeRealBounding

Communicator.Model.getNodeRealBounding(nodeId)

Gets the world space bounding box for a node including any effects (explosion, camera suppression, etc). Note: This function can have performance implications when used on nodes with many children.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node for which you wish to get the bounding box.

Return type

Promise[Communicator.Box]

Returns

Promise that resolves with the world space bounding box for the given ID.

getNodeType

Communicator.Model.getNodeType(nodeId)

Returns the type of the node with the given ID.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Communicator.NodeType

Returns

The type of the node.

getNodeUnitMultiplier

Communicator.Model.getNodeUnitMultiplier(nodeId)

Returns the unit multiplier affecting the supplied node. This number is a multiplier of millimeters (for example inches will be 25.4). The default value is 1.0.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

number

Returns

The unit multiplier for the model (in mm)

getNodeUserData

Communicator.Model.getNodeUserData(nodeId, index)

Returns the user data for a given node and index.

Arguments
  • nodeId (Communicator.NodeId()) – The ID of the node to query.

  • index (Communicator.UserDataIndex()) – The index of the data.

Return type

Uint8Array

Returns

The user data.

getNodeUserDataIndices

Communicator.Model.getNodeUserDataIndices(nodeId)

Returns all the UserDataIndex items associated with the input node.

Arguments
  • nodeId (Communicator.NodeId()) – The ID of the node to query.

Return type

[Communicator.UserDataIndex]

Returns

A list of UserDataIndex, possibly empty.

getNodeVisibility

Communicator.Model.getNodeVisibility(nodeId)

Returns the current visibility for a node.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to get visibility for.

Return type

boolean

Returns

true if the current node’s visibility state is on or false if it is not.

getNodesBounding

Communicator.Model.getNodesBounding(nodeIds, config)

Gets the world space bounding box for a list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes for which you wish to get the bounding box.

  • config (Communicator.GetNodesBoundingConfig()) – Allows fine control of what body types to compute the bounding against. If not provided, all body types are considered.

Return type

Promise[Communicator.Box]

Returns

Promise that resolves with the world space bounding box for the given IDs.

getNodesByGenericType

Communicator.Model.getNodesByGenericType(genericType)

This function returns all NodeIds with an IFC type.

Arguments
  • genericType (Communicator.GenericType()) –

Return type

{  }

Returns

All NodeIds with an IFC type

getNodesByIfcType

Communicator.Model.getNodesByIfcType(ifcType)

Note

getNodesByIfcType is deprecated: Use getNodesByGenericType instead.

Arguments
  • ifcType (Communicator.IfcType()) –

Return type

{  }

getNodesCullingVectors

Communicator.Model.getNodesCullingVectors(nodeIds)

Retrieves the vector and angle used to determine an object’s visibility based on camera orientation. If unset, null will appear at the corresponding array index.

Arguments
  • nodeIds ([Communicator.NodeId]()) – The nodes to query culling vectors from.

Return type

Promise[[{  }]]

Returns

A promise of culling vectors.

getNodesEffectiveFaceColor

Communicator.Model.getNodesEffectiveFaceColor(nodeIds)

Gets the color set on the faces of a list of leaf nodes. If no color has been set, the color specified when the model was authored will be returned.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes to be queried

Return type

Promise[[Communicator.Color]]

getNodesEffectiveLineColor

Communicator.Model.getNodesEffectiveLineColor(nodeIds)

Gets the color set on the lines of a list of leaf nodes. If no color has been set, the color specified when the model was authored will be returned.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes to be queried

Return type

Promise[[Communicator.Color]]

getNodesEffectiveOpacity

Communicator.Model.getNodesEffectiveOpacity(leafNodes, elementType)

Gets the opacity set on a list of leaf nodes multiplied by the opacity specified when the model was authored. If no opacity has been set, the opacity specified when the model was authored will be returned directly.

Arguments
  • leafNodes ([Communicator.NodeId]()) –

  • elementType (Communicator.ElementType()) – the type of element (faces, lines or points) to query

Return type

Promise[[number]]

getNodesEffectivePointColor

Communicator.Model.getNodesEffectivePointColor(nodeIds)

Gets the color set on the points of a list of leaf nodes. If no color has been set, the color specified when the model was authored will be returned.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes to be queried

Return type

Promise[[Communicator.Color]]

getNodesEffectiveTransparency

Communicator.Model.getNodesEffectiveTransparency(leafNodes, elementType)

Note

getNodesEffectiveTransparency is deprecated: use getNodesEffectiveOpacity instead.

Arguments
  • leafNodes ([Communicator.NodeId]()) –

  • elementType (Communicator.ElementType()) –

Return type

Promise[[number]]

getNodesFaceColor

Communicator.Model.getNodesFaceColor(nodeIds)

Gets the color set via setNodesFaceColor on the faces of a list of leaf nodes. If no color has been explicitly set for a particular node, null will appear at the corresponding position in the returned array. See also: getNodesEffectiveFaceColor

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes to be queried

Return type

Promise[[{  }]]

getNodesFromFiltersId

Communicator.Model.getNodesFromFiltersId(filtersId)
Arguments
  • filtersId ([Communicator.FilterId]()) – array of filters indexes to take in account

Return type

{  }

Returns

nodesId of nodes retained by the given filter indices and the type of filter (inclusive or not). Returns null if no filter is found.

getNodesFromLayer

Communicator.Model.getNodesFromLayer(layerId, onlyTreeNodes)

Returns IDs of nodes in the given layer.

Arguments
  • layerId (Communicator.LayerId()) – The layer ID to get nodes from.

  • onlyTreeNodes ({  }()) – if true return only nodes present in model Tree

Return type

{  }

Returns

An array of nodes Id of nodes with the given layerId or null if no layers are found.

getNodesFromLayerName

Communicator.Model.getNodesFromLayerName(layerName, onlyTreeNodes)

Returns IDs of nodes in the given layer.

Arguments
  • layerName (Communicator.LayerName()) –

  • onlyTreeNodes ({  }()) – if true return only nodes present in model Tree

Return type

{  }

Returns

An array of nodes Id of nodes with the given layerName or null if no layers are found.

getNodesFromLayers

Communicator.Model.getNodesFromLayers(layersId, onlyTreeNodes)

Returns IDs of nodes in given layers.

Arguments
  • layersId ([Communicator.LayerId]()) – Array of layers Id to get nodes from.

  • onlyTreeNodes ({  }()) – if true return only nodes present in model Tree

Return type

{  }

Returns

An array of nodes Id of nodes with one of the given layerId or null if no layers are found.

getNodesHaveTransparency

Communicator.Model.getNodesHaveTransparency(nodeIds)

Returns whether nodes with the given NodeIds have an opacity value that is not fully opaque.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes to query.

Return type

Promise[[boolean]]

Returns

array of boolean values corresponding to the id array passed into the function. A value of true indicates that the node contains transparency and is not fully opaque.

getNodesHighlighted

Communicator.Model.getNodesHighlighted(partIds)

Returns whether the supplied nodes have been highlighted with setNodesHighlighted

Arguments
  • partIds ([Communicator.PartId]()) –

Return type

Promise[[boolean]]

getNodesInstancingSamePart

Communicator.Model.getNodesInstancingSamePart(nodeId)

Returns IDs of nodes who instance the same part as the supplied node. This method should be called on nodes whose type is PartInstance.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[{  }]

Returns

Array containing PartInstance node IDs. These nodes all instance the same part as the supplied node. If this method is called on a node which is not of type PartInstance then null will be returned.

getNodesLineColor

Communicator.Model.getNodesLineColor(nodeIds)

Gets the color set via setNodesLineColor on the lines of a list of leaf nodes. If no color has been set for a particular node, null will appear at the corresponding position in the returned array.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes to be queried

Return type

Promise[[{  }]]

getNodesOpacity

Communicator.Model.getNodesOpacity(leafNodes)

Gets the opacity set via setNodesOpacity on a list of leaf nodes. If no value has been set for a particular node, null will appear at the corresponding position in the returned array.

Arguments
  • leafNodes ([Communicator.NodeId]()) –

Return type

Promise[[{  }]]

getNodesPointColor

Communicator.Model.getNodesPointColor(nodeIds)

Gets the color set via setNodesPointColor on the points of a list of leaf nodes. If no color has been explicitly set for a particular node, null will appear at the corresponding position in the returned array. See also: getNodesEffectivePointColor

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of the nodes to be queried

Return type

Promise[[{  }]]

getNodesTransparency

Communicator.Model.getNodesTransparency(leafNodes)

Note

getNodesTransparency is deprecated: use getNodesOpacity instead.

Arguments
  • leafNodes ([Communicator.NodeId]()) –

Return type

Promise[[{  }]]

getOutOfHierarchy

Communicator.Model.getOutOfHierarchy(nodeId)

Returns “Out Of Hierarchy” status for child node for the given Id.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

boolean

Returns

false if node is Out Of Hierarchy, true if it is

getPMIColor

Communicator.Model.getPMIColor()

Note

getPMIColor is deprecated: Use getPmiColor instead.

Return type

Communicator.Color

getPMIColorOverride

Communicator.Model.getPMIColorOverride()

Note

getPMIColorOverride is deprecated: Use getPmiColorOverride instead.

Return type

boolean

getPMISubtype

Communicator.Model.getPMISubtype(pmiId)

Note

getPMISubtype is deprecated: Use getPmiSubtype instead.

Arguments
  • pmiId (Communicator.PmiId()) –

Return type

Communicator.PmiSubType

getPMIType

Communicator.Model.getPMIType(pmiId)

Note

getPMIType is deprecated: Use getPmiType instead.

Arguments
  • pmiId (Communicator.PmiId()) –

Return type

Communicator.PmiType

getPMIs

Communicator.Model.getPMIs()

Note

getPMIs is deprecated: Use getPmis instead.

Return type

Communicator.IdStringMap

getPmiColor

Communicator.Model.getPmiColor()

Returns the set PMI override color (if none is set, defaults to black)

Return type

Communicator.Color

Returns

color

getPmiColorOverride

Communicator.Model.getPmiColorOverride()
Return type

boolean

Returns

a boolean value indicating the status of the PMI override color.

getPmiSubtype

Communicator.Model.getPmiSubtype(pmiId)

Returns the subtype of a given PMI

Arguments
  • pmiId (Communicator.PmiId()) –

Return type

Communicator.PmiSubType

Returns

Subtype of the PMI (Dimension distance, Datum target, GD&T fcf…)

getPmiTopologyReferences

Communicator.Model.getPmiTopologyReferences(pmiNodeId)

Gets an array of PMI topology references linking a PMI node to a body element, like a face or an edge.

Arguments
  • pmiNodeId (Communicator.NodeId()) – the ID of the PMI node.

Return type

{  }

getPmiType

Communicator.Model.getPmiType(pmiId)

Returns the type of a given PMI

Arguments
  • pmiId (Communicator.PmiId()) –

Return type

Communicator.PmiType

Returns

Type of the PMI (Dimension, Datum, GD&T…)

getPmis

Communicator.Model.getPmis()

Returns names and ids of all the PMIs available in the scene

Return type

Communicator.IdStringMap

Returns

a map associating PMI IDs to PMI names

getPointAttributes

Communicator.Model.getPointAttributes(nodeId, pointIndex)

Returns point attributes for a node of the given node and point.

Arguments
  • nodeId (Communicator.NodeId()) – Node to retrieve point properties from

  • pointIndex (number()) – Index of point for which to retrieve point attributes

Return type

Promise[{  }]

Returns

Promise for the requested point attributes. Properties returned will be null if none associated with the point.

getPrimaryModelId

Communicator.Model.getPrimaryModelId()

Note

getPrimaryModelId is deprecated

Return type

Promise[SC.ModelKey]

getPrimaryModelKey

Communicator.Model.getPrimaryModelKey()

Note

getPrimaryModelKey is deprecated

Return type

Promise[SC.ModelKey]

getRelationshipTypesFromBimId

Communicator.Model.getRelationshipTypesFromBimId(node, bimId)

Retrieves all type of relationships that a bim id has.

Arguments
  • node (Communicator.NodeId()) – any known node id of the working model.

  • bimId (Communicator.BimId()) – bim id for which you want its types of relationships.

Return type

[Communicator.RelationshipType]

Returns

array of type of relationship corresponding to the BimId.

getRootNode

Communicator.Model.getRootNode()

Note

getRootNode is deprecated: Use getAbsoluteRootNode instead.

Return type

Communicator.NodeId

getSCInstanceKey

Communicator.Model.getSCInstanceKey(bodyId)

Returns the SC ID of a body instance

Note

getSCInstanceKey is deprecated

Arguments
  • bodyId (Communicator.BodyId()) –

Return type

{  }

Returns

SC instance ID, a pair of numbers consisting of the inclusion ID and the instance ID. null is returned if the function fails.

getUniqueLayerNames

Communicator.Model.getUniqueLayerNames()

Return names of layers. Different layers can have the same name. Some layers can be unnamed.

Return type

[Communicator.LayerName]

Returns

Names of layers

getUnitMultiplier

Communicator.Model.getUnitMultiplier()

Returns the unit multiplier affecting the root of the first loaded model. This number is a multiplier of millimeters (for example inches will be 25.4). The default value is 1.0.

Note

getUnitMultiplier is deprecated: Use getNodeUnitMultiplier instead.

Return type

number

Returns

The unit multiplier for the model (in mm)

getViewAxes

Communicator.Model.getViewAxes()
Return type

Communicator.ViewAxes

Returns

the up and front vectors for the model coordinate system.

getVisibilityState

Communicator.Model.getVisibilityState(startNodeId)

Returns a defaultVisibility boolean value and a visibilityException set of NodeIds. defaultVisibility will be true if there are more nodes visible than hidden, and false otherwise. If defaultVisibility is true, set of nodes that are hidden, if false, nodes that are visible.

Arguments
  • startNodeId (Communicator.NodeId()) –

Return type

Promise[Communicator.VisibilityState]

hasDepthRange

Communicator.Model.hasDepthRange(nodeIds)
Arguments
  • nodeIds ([Communicator.NodeId]()) –

Return type

Promise[[boolean]]

hasEffectiveGenericType

Communicator.Model.hasEffectiveGenericType(nodeId, genericType)

Checks if a NodeId is a generic type.

Arguments
  • nodeId (Communicator.NodeId()) –

  • genericType (Communicator.GenericType()) –

Return type

boolean

isAnnotationView

Communicator.Model.isAnnotationView(cadViewNodeId)

Tells if the view is an annotation view or not

Arguments
  • cadViewNodeId (Communicator.CadViewId()) – Node ID of the CAD view

Return type

boolean

Returns

true if the view is an annotation view

isDrawing

Communicator.Model.isDrawing()

Tells if the model is a CAD drawing or not

Return type

boolean

Returns

true if the model is a CAD drawing

isFaceMeasurable

Communicator.Model.isFaceMeasurable(bodyId, faceIndex)
Arguments
  • bodyId (Communicator.NodeId()) –

  • faceIndex (number()) –

Return type

Promise[boolean]

isLineMeasurable

Communicator.Model.isLineMeasurable(bodyId, lineIndex)
Arguments
  • bodyId (Communicator.NodeId()) – ID of the body node containing the line

  • lineIndex (number()) – Index of the line ot be checked

Return type

Promise[boolean]

Returns

true if the line has associated measurement data

isMeasurable

Communicator.Model.isMeasurable()
Return type

boolean

Returns

true if the model contains measurement data.

isNodeLoaded

Communicator.Model.isNodeLoaded(nodeId)

Queries if a node is fully loaded or not.

Arguments
  • nodeId (Communicator.NodeId()) – The node to query.

Return type

boolean

Returns

True if the node is fully loaded; false otherwise.

isWithinExternalModel

Communicator.Model.isWithinExternalModel(nodeId)

Returns true if the node is within an external model.

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

boolean

loadMeasurementFromFile

Communicator.Model.loadMeasurementFromFile(filename)

Loads measurement data from a ZIP file

Arguments
  • filename (string()) – Name of a file containing ZIP measurement data

Return type

Promise[void]

loadMeasurementFromJson

Communicator.Model.loadMeasurementFromJson(json)

Loads measurement data from a JSON object

Arguments
  • json (any()) – JSON object containing measurement data

Return type

Promise[void]

loadMeasurementFromString

Communicator.Model.loadMeasurementFromString(str)

Loads measurement data from a JSON string

Arguments
  • str (string()) – JSON string containing measurement data

Return type

Promise[void]

loadSubtreeFromModel

Communicator.Model.loadSubtreeFromModel(nodeId, modelName, config)

Loads the tree stored in a model file and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • modelName (Communicator.ScModelName()) – The name of the model to load.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

Communicator.Model.loadSubtreeFromModel(nodeId, modelName, additionalMatrix)

Loads the tree stored in a model file and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • modelName (Communicator.ScModelName()) – The name of the model to load.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

loadSubtreeFromScsBuffer

Communicator.Model.loadSubtreeFromScsBuffer(nodeId, buffer, config)

Loads the tree stored in a model file and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • buffer (Communicator.ScsBuffer()) – The SCS buffer to load.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

Communicator.Model.loadSubtreeFromScsBuffer(nodeId, buffer, additionalMatrix)

Loads the tree stored in a model file and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • buffer (Communicator.ScsBuffer()) – The SCS buffer to load.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

loadSubtreeFromScsFile

Communicator.Model.loadSubtreeFromScsFile(nodeId, scsFilename, config)

Loads the tree stored in a model file and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • scsFilename (Communicator.ScsUri()) – The name of the SCS file to load.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

Communicator.Model.loadSubtreeFromScsFile(nodeId, scsFilename, additionalMatrix)

Loads the tree stored in a model file and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • scsFilename (Communicator.ScsUri()) – The name of the SCS file to load.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

loadSubtreeFromScsXmlBuffer

Communicator.Model.loadSubtreeFromScsXmlBuffer(nodeId, xmlData, modelNameToScs, config)

Loads the tree stored in the XML and query loading of required meshes Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlData ({  }()) – XML document or XML document string.

  • modelNameToScs ({  }()) – Optional callback to massage model names within the XML file to SCS file URLS or SCS file buffers. Return null to skip the model.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.

Communicator.Model.loadSubtreeFromScsXmlBuffer(nodeId, xmlData, modelNameToScs, additionalMatrix, allowMissingExternalModels)

Loads the tree stored in the XML and query loading of required meshes. Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlData ({  }()) – XML document or XML document string.

  • modelNameToScs ({  }()) – Optional callback to massage model names within the XML file to SCS file URLS or SCS file buffers. Return null to skip the model.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

  • allowMissingExternalModels ({  }()) – Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.

loadSubtreeFromScsXmlFile

Communicator.Model.loadSubtreeFromScsXmlFile(nodeId, xmlFilename, modelNameToScs, config)

Loads the tree stored in the XML and query loading of required meshes Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlFilename (Communicator.XmlFilename()) – URL of XML file to load.

  • modelNameToScs ({  }()) – Optional callback to massage model names within the XML file to SCS file URLS or SCS file buffers. Return null to skip the model.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.

Communicator.Model.loadSubtreeFromScsXmlFile(nodeId, xmlFilename, modelNameToScs, additionalMatrix, allowMissingExternalModels)

Loads the tree stored in the XML and query loading of required meshes Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlFilename (Communicator.XmlFilename()) – URL of XML file to load.

  • modelNameToScs ({  }()) – Optional callback to massage model names within the XML file to SCS file URLS or SCS file buffers. Return null to skip the model.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

  • allowMissingExternalModels ({  }()) – Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.

loadSubtreeFromUrl

Communicator.Model.loadSubtreeFromUrl(nodeId, xmlFilename)

Note

loadSubtreeFromUrl is deprecated: Use loadSubtreeFromXmlFile instead.

Arguments
  • nodeId (Communicator.NodeId()) –

  • xmlFilename (Communicator.XmlFilename()) –

Return type

Promise[[Communicator.NodeId]]

loadSubtreeFromXML

Communicator.Model.loadSubtreeFromXML(nodeId, xmlData)

Note

loadSubtreeFromXML is deprecated: Use loadSubtreeFromXmlBuffer instead.

Arguments
  • nodeId (Communicator.NodeId()) –

  • xmlData (string()) –

Return type

Promise[[Communicator.NodeId]]

loadSubtreeFromXmlBuffer

Communicator.Model.loadSubtreeFromXmlBuffer(nodeId, xmlData, massageModelName, config)

Loads the tree stored in the XML and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlData ({  }()) – XML document or XML document string.

  • massageModelName ({  }()) – Optional callback to massage model names within the XML file. Return null to skip the model.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

Communicator.Model.loadSubtreeFromXmlBuffer(nodeId, xmlData, massageModelName, additionalMatrix, allowMissingExternalModels)

Loads the tree stored in the XML and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlData ({  }()) – XML document or XML document string.

  • massageModelName ({  }()) – Optional callback to massage model names within the XML file. Return null to skip the model.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

  • allowMissingExternalModels ({  }()) – Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

loadSubtreeFromXmlFile

Communicator.Model.loadSubtreeFromXmlFile(nodeId, xmlFilename, massageModelName, config)

Loads the tree stored in the XML and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlFilename (Communicator.XmlFilename()) – URL of XML file to load.

  • massageModelName ({  }()) – Optional callback to massage model names within the XML file. Return null to skip the model.

  • config (Communicator.LoadSubtreeConfig()) – Configuration to control load behavior.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

Communicator.Model.loadSubtreeFromXmlFile(nodeId, xmlFilename, massageModelName, additionalMatrix, allowMissingExternalModels)

Loads the tree stored in the XML and query loading of required meshes

Arguments
  • nodeId (Communicator.NodeId()) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.

  • xmlFilename (Communicator.XmlFilename()) – URL of XML file to load.

  • massageModelName ({  }()) – Optional callback to massage model names within the XML file. Return null to skip the model.

  • additionalMatrix ({  }()) – Optional matrix to get multiplied into the net attachment matrix.

  • allowMissingExternalModels ({  }()) – Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

registerBimNodes

Communicator.Model.registerBimNodes(startNodeId, attributeToMask, legacy_useAttributeTitle)

This function recursively discovers BIM nodes in the supplied subtree and registers them.

Arguments
  • startNodeId (Communicator.NodeId()) – The root of the subtree to walk for registration.

  • attributeToMask ((value): Communicator.BimMask()) – The callback used to obtain a node’s BimMask from its attributes.

  • legacy_useAttributeTitle ({  }()) –

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

registerIfcNodes

Communicator.Model.registerIfcNodes(startNodeId, legacy_useAttributeTitle)

This function recursively discovers IFC nodes in the supplied subtree and registers them.

Arguments
  • startNodeId (Communicator.NodeId()) – The root of the subtree to walk for registration.

  • legacy_useAttributeTitle ({  }()) –

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

replaceMesh

Communicator.Model.replaceMesh(id, data)

Replace a mesh’s data. This will affect all instances of that mesh.

Arguments
Return type

Promise[void]

requestNodes

Communicator.Model.requestNodes(nodeIds)

Specifies nodes for the system to load. This method is useful when the viewer was created with the streamOnDemand option set to true.

Arguments
  • nodeIds ([Communicator.NodeId]()) – array of unique IDs for the system to load

Return type

Promise[void]

reset

Communicator.Model.reset()

Resets the state of the model to its default

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

resetModelHighlight

Communicator.Model.resetModelHighlight()

Resets highlight for all nodes in the model.

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

resetModelOpacity

Communicator.Model.resetModelOpacity()

Resets opacity for all nodes in the model.

Return type

void

Returns

Promise that resolves when this operation has completed.

resetModelTransparency

Communicator.Model.resetModelTransparency()

Note

resetModelTransparency is deprecated: Use resetModelOpacity instead.

Return type

Communicator.DeprecatedPromise

resetNodeMatrixToInitial

Communicator.Model.resetNodeMatrixToInitial(nodeId)

Reset node matrix to the one set as the initial one

Arguments
  • nodeId (Communicator.NodeId()) –

Return type

Promise[void]

resetNodesColor

Communicator.Model.resetNodesColor()

Resets color for all nodes in the model.

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

resetNodesOpacity

Communicator.Model.resetNodesOpacity(nodeIds)

Resets opacity for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes whose opacity will be reset to their default values

Return type

void

resetNodesTransform

Communicator.Model.resetNodesTransform()

Resets transform for all nodes in the model.

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

resetNodesTransparency

Communicator.Model.resetNodesTransparency(nodeIds)

Note

resetNodesTransparency is deprecated: use resetNodesOpacity instead.

Arguments
  • nodeIds ([Communicator.NodeId]()) –

Return type

Communicator.DeprecatedPromise

resetNodesVisibility

Communicator.Model.resetNodesVisibility()

Resets visibility for all nodes in the model.

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

setBehaviorInitiallyHidden

Communicator.Model.setBehaviorInitiallyHidden(enabled)

By default, objects that are initially hidden stays hidden unless specifically set to be shown. This function allows this behavior to be disabled.

Arguments
  • enabled (boolean()) – value indicating if initially hidden objects stay hidden

Return type

void

setBodyNodesVisibility

Communicator.Model.setBodyNodesVisibility(startNodeId, visibility)

Sets the visibility of all body nodes starting from a given node.

Arguments
  • startNodeId (Communicator.NodeId()) – The start node to walk when updating body nodes visibility.

  • visibility (boolean()) – If true, nodes will be shown. If false, they will be hidden.

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

Communicator.Model.setBodyNodesVisibility(startNodeId, visibilityFormatter)

Sets the visibility of all body nodes starting from a given node.

Arguments
  • startNodeId (Communicator.NodeId()) – The start node to walk when updating body nodes visibility.

  • visibilityFormatter ((node): {  }()) – A function that returns the visibility for a given node id

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

setDepthRange

Communicator.Model.setDepthRange(nodeIds, min, max)

Remaps the depth values used for z-ordering of pixels to the given range, which must be a subset of [0,1]. The depth value at the near plane (normally 0) is mapped to min and the value at the far plane (normally 1) is mapped to max.

Arguments
  • nodeIds ([Communicator.NodeId]()) – the node IDs to operate on

  • min (number()) – the depth value at the near plane

  • max (number()) – the depth value at the far plane

Return type

Communicator.DeprecatedPromise

The smaller the range, the more z-fighting you will see among objects set to that range.

setEdgeProperty

Communicator.Model.setEdgeProperty(nodeId, edgeId, prop)

Set edge property for a node of the given node and edge.

Arguments
  • nodeId (Communicator.NodeId()) –

  • edgeId (number()) –

  • prop (Communicator.SubentityProperties.Base()) – property (CircleElement, LineElement…)

Return type

void

setEnableAutomaticUnitScaling

Communicator.Model.setEnableAutomaticUnitScaling(enabled)

If enabled then models loaded into an existing scene with a different unit value will be scaled to the unit value of the current scene.

Arguments
  • enabled (boolean()) – value indicating if automatic unit scaling will be active

Return type

void

setFaceProperty

Communicator.Model.setFaceProperty(nodeId, faceId, prop)

Set face property for a node of the given node and face.

Arguments
  • nodeId (Communicator.NodeId()) –

  • faceId (number()) –

  • prop (Communicator.SubentityProperties.Base()) – property (CylinderElement, PlaneElement…)

Return type

void

setInstanceModifier

Communicator.Model.setInstanceModifier(instanceModifier, nodeIds, value)

Allows changing the behavior in the viewer

Arguments
  • instanceModifier (Communicator.InstanceModifier()) – InstanceModifier

  • nodeIds ([Communicator.NodeId]()) – Array of node ids

  • value (boolean()) – boolean

Return type

Communicator.DeprecatedPromise

setMeshLevel

Communicator.Model.setMeshLevel(nodeIds, meshLevel)

Sets the desired mesh level

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes in the assembly on which mesh level will be set

  • meshLevel (number()) – 0 standard, 1 low, 2 extra low

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when the operation has completed.

setMetallicRoughness

Communicator.Model.setMetallicRoughness(nodeIds, metallicFactor, roughnessFactor)

Sets the metallic and roughness factors for the supplied nodes materials. Materials that are not currently set to use the Metallic Roughness shading model will be upgraded to use this mode.

Arguments
  • nodeIds ([Communicator.NodeId]()) – List of nodes to set material properties for

  • metallicFactor (number()) – The metalness of the material

  • roughnessFactor (number()) – The roughness of the material

Return type

void

setNodeFaceColor

Communicator.Model.setNodeFaceColor(partId, faceId, color)

Sets the color for a face element. This color will take precedence over any currently set color on the node

Arguments
  • partId (Communicator.PartId()) –

  • faceId (number()) – the Id of the face in the node that will have its color set

  • color (Communicator.Color()) – the color to set

Return type

Communicator.DeprecatedPromise

setNodeFaceHighlighted

Communicator.Model.setNodeFaceHighlighted(nodeId, faceId, highlighted)

Sets whether the face element for a given node should appear highlighted. When a face element is highlighted, the highlight color will override any color previously set on the element.

Arguments
  • nodeId (Communicator.NodeId()) – the id for the node containing the face element.

  • faceId (number()) – the face Id that is the target of this operation.

  • highlighted (boolean()) – value indicating whether the supplied face element should be highlighted.

Return type

Communicator.DeprecatedPromise

setNodeFaceVisibility

Communicator.Model.setNodeFaceVisibility(partId, faceId, visibility)

Sets the visibility for a face element. This visibility setting will take precedence over other element visibility settings

Arguments
  • partId (Communicator.PartId()) – the Id of the part containing the face

  • faceId (number()) – the Id of the face in the node that will have its visibility set

  • visibility (boolean()) – visibility state to be set

Return type

void

setNodeLineColor

Communicator.Model.setNodeLineColor(partId, lineId, color)

Sets the color for a line element.

Arguments
  • partId (Communicator.PartId()) –

  • lineId (number()) – the Id of the line in the node that will have its color set.

  • color (Communicator.Color()) – the color to set.

Return type

Communicator.DeprecatedPromise

setNodeLineHighlighted

Communicator.Model.setNodeLineHighlighted(partId, lineId, highlighted)

Sets whether the line element for a given node should appear highlighted. When a line element is highlighted, the highlight color will override any color previously set on the element.

Arguments
  • partId (Communicator.PartId()) –

  • lineId (number()) – the line Id that is the target of this operation.

  • highlighted (boolean()) – value indicating whether the supplied line element should be highlighted.

Return type

Communicator.DeprecatedPromise

setNodeLineVisibility

Communicator.Model.setNodeLineVisibility(partId, lineId, visibility)

Sets the visibility for a line element. This visibility setting will take precedence over other element visibility settings

Arguments
  • partId (Communicator.PartId()) – the Id of the part containing the line

  • lineId (number()) – the Id of the line in the node that will have its visibility set

  • visibility (boolean()) – visibility state to be set

Return type

void

setNodeMatrix

Communicator.Model.setNodeMatrix(nodeId, matrix, setAsInitial)

Sets Matrix for a node of the given ID

Arguments
  • nodeId (Communicator.NodeId()) –

  • matrix (Communicator.Matrix()) –

  • setAsInitial ({  }()) – tells if you want to change the node initial matrix or not

Return type

Promise[void]

setNodePointColor

Communicator.Model.setNodePointColor(partId, pointId, color)

Sets the color for a point element.

Arguments
  • partId (Communicator.PartId()) – the Id of the node containing the point.

  • pointId (number()) – the Id of the point in the node that will have its color set.

  • color (Communicator.Color()) – the color to set.

Return type

void

setNodePointHighlighted

Communicator.Model.setNodePointHighlighted(partId, pointId, highlighted)

Sets whether the point element for a given node should appear highlighted. When a point element is highlighted, the highlight color will override any color previously set on the element.

Arguments
  • partId (Communicator.NodeId()) –

  • pointId (number()) – the point Id that is the target of this operation.

  • highlighted (boolean()) – value indicating whether the supplied point element should be highlighted.

Return type

Communicator.DeprecatedPromise

setNodePointVisibility

Communicator.Model.setNodePointVisibility(partId, pointId, visibility)

Sets the visibility for a point element. This visibility setting will take precedence over other element visibility settings

Arguments
  • partId (Communicator.PartId()) – the Id of the part containing the point

  • pointId (number()) – the Id of the point in the node that will have its visibility set

  • visibility (boolean()) – visibility state to be set

Return type

void

setNodesColors

Communicator.Model.setNodesColors(colorMap, alsoApplyToWireframe, alsoApplyToPoints)

Sets colors for a given set of nodes.

Arguments
  • colorMap ({  }()) –

  • alsoApplyToWireframe ({  }()) – change or not lines color

  • alsoApplyToPoints ({  }()) – change or not points color

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

setNodesCullingVector

Communicator.Model.setNodesCullingVector(nodeIds, space, vector, toleranceDegrees)

Sets a vector and angle used to determine an object’s visibility based on camera orientation.

Arguments
  • nodeIds ([Communicator.NodeId]()) –

  • space (Communicator.CullingVectorSpace()) – The space in which the culling vector is defined.

  • vector (Communicator.Point3()) – A vector that will be compared with the view vector.

  • toleranceDegrees (Communicator.Degrees()) – The maximum angle between the culling vector and the view vector within which the object will be visible.

Return type

Communicator.DeprecatedPromise

setNodesFaceColor

Communicator.Model.setNodesFaceColor(nodeIds, color)

Sets the color on the faces for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes whose color to set

  • color (Communicator.Color()) – the color to set

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

setNodesHighlighted

Communicator.Model.setNodesHighlighted(partIds, highlighted)

Sets whether the supplied nodes should appear highlighted. When a node is highlighted, the highlight color will override any color previously set on the model.

Arguments
  • partIds ([Communicator.PartId]()) –

  • highlighted (boolean()) – value indicating whether the supplied nodes should be highlighted.

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

Tip: An easy way to unhighlight the entire model is to call setNodesHighlighted on the root node of the model:

hwv.model.setNodesHighlighted([hwv.model.getAbsoluteRootNode()], false);

(In this case, hwv is your instance of WebViewer

setNodesLineColor

Communicator.Model.setNodesLineColor(nodeIds, color)

Sets the color on the lines/edges for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes whose color to set

  • color (Communicator.Color()) – the color to set

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

setNodesLinePattern

Communicator.Model.setNodesLinePattern(nodeIds, pattern, patternLength, patternLengthUnit)

Applies the given line pattern to the specified nodes. See also unsetNodesLinePattern

Arguments
  • nodeIds ([Communicator.NodeId]()) – The IDs of the nodes.

  • pattern (Communicator.LinePattern()) – The line pattern. See LinePattern for details.

  • patternLength (number()) – The length of a single repetition of the line pattern.

  • patternLengthUnit (Communicator.LinePatternLengthUnit()) – The unit in which the length of the pattern is measured. See LinePatternLengthUnit for details.

Return type

void

setNodesOpacities

Communicator.Model.setNodesOpacities(params)

Sets opacity for a given set of nodes.

Arguments
  • params ({  }()) – object mapping node IDs to opacity to set for that NodeId. The opacity value should be between the range of 0.0 and 1.0. 0.0 indicates fully transparent, while 1.0 is fully opaque.

Return type

void

setNodesOpacity

Communicator.Model.setNodesOpacity(nodeIds, opacity)

Sets opacity for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes whose opacity will be set

  • opacity (number()) – opacity value to apply to each node. The value should be between the range of 0.0 and 1.0. 0.0 indicates fully transparent, while 1.0 is fully opaque.

Return type

void

setNodesPointColor

Communicator.Model.setNodesPointColor(nodeIds, color)

Sets the color on the points for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes whose color to set

  • color (Communicator.Color()) –

Return type

void

Returns

Promise that resolves when this operation has completed.

setNodesTexture

Communicator.Model.setNodesTexture(nodeIds, options)

Apply an image to a node as a texture map. See createImage and unsetNodesTexture

Arguments
  • nodeIds ([Communicator.NodeId]()) – The nodes on which to apply the texture

  • options (Communicator.TextureOptions()) – Options specifying how the texture is applied

Return type

Promise[void]

setNodesTransparencies

Communicator.Model.setNodesTransparencies(params)

Note

setNodesTransparencies is deprecated: use setNodesOpacities instead.

Arguments
  • params ({  }()) –

Return type

Communicator.DeprecatedPromise

setNodesTransparency

Communicator.Model.setNodesTransparency(nodeIds, transparency)

Note

setNodesTransparency is deprecated: use setNodesOpacity instead.

Arguments
  • nodeIds ([Communicator.NodeId]()) –

  • transparency (number()) –

Return type

Communicator.DeprecatedPromise

setNodesVisibilities

Communicator.Model.setNodesVisibilities(mapping, initiallyHiddenStayHidden)

Sets the visibility for a given set of nodes.

Arguments
  • mapping ({  }()) – The mapping of node IDs to boolean value indicating the visibility setting for that node.

  • initiallyHiddenStayHidden ({  }()) – Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by setBehaviorInitiallyHidden

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

setNodesVisibility

Communicator.Model.setNodesVisibility(nodeIds, visibility, initiallyHiddenStayHidden)

Sets visibility for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – The node IDs whose visibilities will be set.

  • visibility (boolean()) – If true, nodes will be shown. If false, they will be hidden.

  • initiallyHiddenStayHidden ({  }()) – Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by setBehaviorInitiallyHidden

Return type

Promise[void]

Returns

Promise that resolves when the operation has completed.

setPMIColor

Communicator.Model.setPMIColor(color)

Note

setPMIColor is deprecated: Use setPmiColor instead.

Arguments
Return type

void

setPMIColorOverride

Communicator.Model.setPMIColorOverride(enableOverride)

Note

setPMIColorOverride is deprecated: Use setPmiColorOverride instead.

Arguments
  • enableOverride (boolean()) –

Return type

Communicator.DeprecatedPromise

setPart

Communicator.Model.setPart(assemblyNodeId, partNodeId)

Set a part on an assembly node

Arguments
  • assemblyNodeId ({  }()) –

  • partNodeId ({  }()) –

Return type

boolean

Returns

true if all went right, false otherwise

setPhysicalProperties

Communicator.Model.setPhysicalProperties(nodeId, gravityCenter, surfaceArea, volume)

Purpose: Sets physical properties

Arguments
  • nodeId (Communicator.NodeId()) – node id to set the property on, the node id has to be a body node

  • gravityCenter (Communicator.Point3()) – gravity center in local coordinates

  • surfaceArea (number()) – surface area, in squared current unit

  • volume (number()) – volume, in cubed current unit

Return type

boolean

Returns

true if all went right, false otherwise

setPmiColor

Communicator.Model.setPmiColor(color)

Saves a PMI override color

Arguments
Return type

void

setPmiColorOverride

Communicator.Model.setPmiColorOverride(enableOverride, rootId)

Takes a boolean value and either enables the set PMI override color or resets all PMI colors to their default

Arguments
  • enableOverride (boolean()) –

  • rootId (Communicator.NodeId()) –

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

setViewAxes

Communicator.Model.setViewAxes(frontVector, upVector)

Sets the up and front vectors for the model coordinate system. Both the upVector and frontVector must be unique, cardinal axes.

Arguments
Return type

void

switchToModel

Communicator.Model.switchToModel(newModelFilename)

Delete all the current scene and load the specified model instead. Also triggers a “modelSwitched” when finished.

Arguments
  • newModelFilename (Communicator.ScModelName()) – Name of the model file to load after the existing scene gets deleted

Return type

Promise[[Communicator.NodeId]]

Returns

A Promise of the newly loaded model’s root nodes IDs.

triangulatePolygon

Communicator.Model.triangulatePolygon(polygonPoints, normal)

Triangulates the supplied polygon.

Arguments
  • polygonPoints ({  }()) – An array of point data for the polygon. Points are stored [XYZXYZXYZ…] format.

  • normal (Communicator.Point3()) – The normal of the polygon to triangulate.

Return type

Float32Array

Returns

An array containing the point data for the generated triangles. Points are stored [XYZXYZXYZ…] format. This returned list is always divisible by 9 (3 points per triangle; 3 floats per point).

unsetDepthRange

Communicator.Model.unsetDepthRange(nodeIds)

Unsets the depth range set by setDepthRange

Arguments
  • nodeIds ([Communicator.NodeId]()) – the node IDs to operate on

Return type

void

unsetMetallicRoughness

Communicator.Model.unsetMetallicRoughness(nodeIds)

Unsets the metallic and roughness values set with setMetallicRoughness These materials will no longer use the Metallic Roughness shading model.

Arguments
  • nodeIds ([Communicator.NodeId]()) – List of nodes to unset material properties for

Return type

void

unsetNodeFaceColor

Communicator.Model.unsetNodeFaceColor(partId, faceId)

Unsets the color for a face element. This will return the face’s color to its default state.

Arguments
  • partId (Communicator.PartId()) –

  • faceId (number()) – the Id of the face in the node that will have its color unset

Return type

Communicator.DeprecatedPromise

unsetNodeLineColor

Communicator.Model.unsetNodeLineColor(partId, lineId)

Unsets the color for a line element. This will return the line’s color to its default state.

Arguments
  • partId (Communicator.PartId()) –

  • lineId (number()) – the Id of the line in the node that will have its color unset

Return type

Communicator.DeprecatedPromise

unsetNodePointColor

Communicator.Model.unsetNodePointColor(partId, pointId)

Unsets the color for a point element. This will return the point’s color to its default state.

Arguments
  • partId (Communicator.PartId()) – the Id of the node containing the point

  • pointId (number()) – the Id of the point in the node that will have its color unset

Return type

void

unsetNodesCullingVectors

Communicator.Model.unsetNodesCullingVectors(nodeIds)

Unsets the vector and angle used to determine an object’s visibility based on camera orientation.

Arguments
  • nodeIds ([Communicator.NodeId]()) – The nodes to unset culling vectors on.

Return type

Communicator.DeprecatedPromise

unsetNodesFaceColor

Communicator.Model.unsetNodesFaceColor(nodeIds)

Unsets the color on the faces for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes to modify

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

unsetNodesLineColor

Communicator.Model.unsetNodesLineColor(nodeIds)

Unsets the color on the lines for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes to modify

Return type

Communicator.DeprecatedPromise

Returns

Promise that resolves when this operation has completed.

unsetNodesLinePattern

Communicator.Model.unsetNodesLinePattern(nodeIds)

Removes the line pattern applied by setNodesLinePattern

Arguments
  • nodeIds ([Communicator.NodeId]()) – The IDs of the nodes.

Return type

void

unsetNodesPointColor

Communicator.Model.unsetNodesPointColor(nodeIds)

Unsets the color on the points for a given list of nodes.

Arguments
  • nodeIds ([Communicator.NodeId]()) – IDs of nodes to modify

Return type

void

unsetNodesTexture

Communicator.Model.unsetNodesTexture(nodeIds)

Remove one or more textures applied via setNodesTexture

Arguments
  • nodeIds ([Communicator.NodeId]()) – The nodes from which to remove the texture or textures

Return type

void

viewAxesHaveBeenSet

Communicator.Model.viewAxesHaveBeenSet()

Gets whether there has been a successful call to setViewAxes.

Return type

boolean