Model
-
class
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](https://docs.techsoft3d.com/communicator/latest/prog_guide/viewing/data_model/model-tree.html).
Methods
activateCadConfiguration()
activateCadView()
activateDefaultCadConfiguration()
activateDefaultCadView()
addPropertyToNode()
cadConfigurationsEnabled()
clear()
clearNodeFaceVisibility()
clearNodeLineVisibility()
clearNodePointVisibility()
computeMinimumBodyBodyDistance()
computeMinimumFaceFaceDistance()
computeMinimumFaceLineDistance()
computeMinimumFaceRayDistance()
createAndAddRepresentationItem()
createCadView()
createImage()
createMesh()
createMeshInstance()
createNode()
createPart()
createPmiInstance()
deleteImages()
deleteMeshInstances()
deleteMeshes()
deleteNode()
getAbsoluteRootNode()
getActiveCadConfiguration()
getAssociatedModelKey()
getBimIdConnectedElements()
getBimIdFromNode()
getBimIdRelatedElements()
getBimIdRelatingElements()
getBimIdsFromGenericId()
getBimInfoFromBimId()
getBranchVisibility()
getCadConfigurations()
getCadViewConfiguration()
getCadViewMap()
getCadViewPmis()
getDataFromIds()
getDefaultCadConfiguration()
getDefaultCadView()
getEdgeAttributes()
getEdgeCount()
getEdgeProperty()
getFaceAttributes()
getFaceCount()
getFaceProperty()
getFilterName()
getFilters()
getFiltersWithNode()
getGenericIdFromBimId()
getGenericTypeIdMap()
getGenericTypes()
getLayerIdsFromName()
getLayerName()
getLayers()
getLooseBounding()
getLowestAvailableNodeId()
getMeshIds()
getMetallicRoughness()
getModelBounding()
getModelFileNameFromNode()
getModelFileTypeFromNode()
getNodeCappingMeshData()
getNodeChildren()
getNodeColorMap()
getNodeEffectiveFaceColor()
getNodeEffectiveLineColor()
getNodeEffectivePointColor()
getNodeExchangeId()
getNodeFaceColor()
getNodeFaceHighlighted()
getNodeGenericId()
getNodeGenericType()
getNodeIdFromBimId()
getNodeIdOffset()
getNodeIdsByGenericIds()
getNodeLayerId()
getNodeLineColor()
getNodeLineHighlighted()
getNodeMatrix()
getNodeMeshData()
getNodeName()
getNodeNetMatrix()
getNodeParent()
getNodePointColor()
getNodePointHighlighted()
getNodeProperties()
getNodeRealBounding()
getNodeType()
getNodeUnitMultiplier()
getNodeUserData()
getNodeUserDataIndices()
getNodeVisibility()
getNodesBounding()
getNodesByGenericType()
getNodesCappingMeshData()
getNodesCullingVectors()
getNodesEffectiveFaceColor()
getNodesEffectiveLineColor()
getNodesEffectiveOpacity()
getNodesEffectivePointColor()
getNodesFaceColor()
getNodesFromFiltersId()
getNodesFromLayer()
getNodesFromLayerName()
getNodesFromLayers()
getNodesHaveTransparency()
getNodesHighlighted()
getNodesInstancingSamePart()
getNodesLineColor()
getNodesOpacity()
getNodesPointColor()
getOutOfHierarchy()
getPmiColor()
getPmiColorOverride()
getPmiSubtype()
getPmiTopologyReferences()
getPmiType()
getPmis()
getPointAttributes()
getRelationshipTypesFromBimId()
getUniqueLayerNames()
getViewAxes()
getVisibilityState()
hasDepthRange()
hasEffectiveGenericType()
isAnnotationView()
isCombineStateView()
isDrawing()
isFaceMeasurable()
isLineMeasurable()
isMeasurable()
isNodeLoaded()
isWithinExternalModel()
loadMeasurementFromFile()
loadMeasurementFromJson()
loadMeasurementFromString()
loadSubtreeFromModel()
loadSubtreeFromScsBuffer()
loadSubtreeFromScsFile()
loadSubtreeFromScsXmlBuffer()
loadSubtreeFromScsXmlFile()
loadSubtreeFromXmlBuffer()
loadSubtreeFromXmlFile()
registerBimNodes()
registerIfcNodes()
replaceMesh()
requestNodes()
reset()
resetModelHighlight()
resetModelOpacity()
resetNodeMatrixToInitial()
resetNodesColor()
resetNodesOpacity()
resetNodesTransform()
resetNodesVisibility()
setBehaviorInitiallyHidden()
setBodyNodesVisibility()
setDepthRange()
setEdgeProperty()
setEnableAutomaticUnitScaling()
setFaceProperty()
setInstanceModifier()
setMeshLevel()
setMetallicRoughness()
setNodeFaceColor()
setNodeFaceHighlighted()
setNodeFaceVisibility()
setNodeLineColor()
setNodeLineHighlighted()
setNodeLineVisibility()
setNodeMatrix()
setNodePointColor()
setNodePointHighlighted()
setNodePointVisibility()
setNodesAmbientColor()
setNodesAmbientMix()
setNodesColors()
setNodesCullingVector()
setNodesFaceColor()
setNodesFaceEmissiveColor()
setNodesFaceSpecularColor()
setNodesFaceSpecularIntensity()
setNodesHighlighted()
setNodesLineColor()
setNodesLinePattern()
setNodesOpacities()
setNodesOpacity()
setNodesPointColor()
setNodesTexture()
setNodesVisibilities()
setNodesVisibility()
setPart()
setPhysicalProperties()
setPmiColor()
setPmiColorOverride()
setViewAxes()
switchToModel()
triangulatePolygon()
unsetDepthRange()
unsetMetallicRoughness()
unsetNodeFaceColor()
unsetNodeLineColor()
unsetNodePointColor()
unsetNodesCullingVectors()
unsetNodesFaceColor()
unsetNodesFaceEmissiveColor()
unsetNodesFaceSpecularColor()
unsetNodesFaceSpecularIntensity()
unsetNodesLineColor()
unsetNodesLinePattern()
unsetNodesPointColor()
unsetNodesTexture()
viewAxesHaveBeenSet()
Methods
activateCadConfiguration
activateCadView
-
Model.
activateCadView
(nodeId, duration, massageCamera, view) Arguments: - nodeId (
number()
) – None - duration (
number()
) – camera transition time in milliseconds. - massageCamera (
boolean()
) – If true, undesirable authored cameras may be modified into a camera with more reasonable values - view (
View()
) – View to activate the CAD View in. Visibility will be applied to all views. Uses default view if not specified.
Activates a CAD View
Returns: None. Return type: Promise <void> - nodeId (
activateDefaultCadConfiguration
-
Model.
activateDefaultCadConfiguration
(fitNodes, view) Arguments: - fitNodes (
boolean()
) – Fit view to visible nodes if possible (default true) - view (
View()
) – View to set the CAD Configuration in. Visibility will be applied to all views. Uses default view if not specified.
Activates Default CAD configuration
Returns: None. Return type: Promise <void> - fitNodes (
activateDefaultCadView
-
Model.
activateDefaultCadView
(duration, massageCamera, view) Arguments: - duration (
number()
) – Duration of the camera animation - massageCamera (
boolean()
) – If true, undesirable authored cameras may be modified into a camera with more reasonable values - view (
View()
) – View to set the CAD View in. Visibility will be applied to all views. Uses default view if not specified.
Activate the default CAD view
Returns: None. Return type: Promise <void> - duration (
addPropertyToNode
-
Model.
addPropertyToNode
(nodeId, propertyName, propertyValue, propertyUnit) Arguments: - nodeId (
number()
) – None - propertyName (
string()
) – None - propertyValue (
string()
) – None - propertyUnit (
[UnitElement]()
) – None
Purpose: Adds a property to the node
Param: nodeId node id to set the property on Param: property name Param: property value Returns: true if all went right, false otherwise Return type: boolean - nodeId (
cadConfigurationsEnabled
-
Model.
cadConfigurationsEnabled
() Gets whether or not cad configurations are enabled
Returns: Boolean indicating whether or not cad configurations are enabled Return type: Promise <boolean>
clear
-
Model.
clear
() Remove all nodes, CAD views, configurations, and sheets from the model.
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.Return type: Promise <void>
clearNodeFaceVisibility
-
Model.
clearNodeFaceVisibility
(partId) Arguments: - partId (
number()
) – the Id of the part to be reset
Clears the visibility for a node’s face elements, resetting them to default.
Return type: void - partId (
clearNodeLineVisibility
-
Model.
clearNodeLineVisibility
(partId) Arguments: - partId (
number()
) – the Id of the part to clear visibilities from
Clears the visibility for a node’s line elements, resetting them to default.
Return type: void - partId (
clearNodePointVisibility
-
Model.
clearNodePointVisibility
(partId) Arguments: - partId (
number()
) – the Id of the part to clear visibilities from
Clears the visibility for a node’s point elements, resetting it to default.
Return type: void - partId (
computeMinimumBodyBodyDistance
-
Model.
computeMinimumBodyBodyDistance
(partId1, partId2) Arguments: - partId1 (
number()
) – id for the part which the first face belongs to - partId2 (
number()
) – id for the part which the second face belongs to
Computes the distance between two bodies
Returns: a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes Return type: Promise <FaceFaceDistanceItem> - partId1 (
computeMinimumFaceFaceDistance
-
Model.
computeMinimumFaceFaceDistance
(partId1, faceId1, partId2, faceId2) Arguments: - partId1 (
number()
) – id for the part which the first face belongs to - faceId1 (
number()
) – id for the face in the first part - partId2 (
number()
) – id for the part which the second face belongs to - faceId2 (
number()
) – id for the face in the second part
Computes the distance between two faces
Returns: a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes Return type: Promise <FaceFaceDistanceItem> - partId1 (
computeMinimumFaceLineDistance
-
Model.
computeMinimumFaceLineDistance
(partId, faceId, ray) Arguments: - partId (
number()
) – None - faceId (
number()
) – id of the face in the node - ray (
Ray()
) – the line (in the form of a ray) to test against
Computers the minimum distance between a face and an infinite line.
Returns: a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes Return type: Promise <FaceFaceDistanceItem> - partId (
computeMinimumFaceRayDistance
-
Model.
computeMinimumFaceRayDistance
(partId, faceId, ray) Arguments: - partId (
number()
) – None - faceId (
number()
) – id of the face in the node - ray (
Ray()
) – the ray to test against
Computers the minimum distance between a face and a ray.
Returns: a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes Return type: Promise <FaceFaceDistanceItem> - partId (
createAndAddRepresentationItem
-
Model.
createAndAddRepresentationItem
(partNodeId[, repItemId]) Arguments: - partNodeId (
undefined | null | number()
) – ID of the part node - repItemId (
null | number()
) – optional (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.
Creates a representation item on a part
Returns: node ID to access the created representation item, null is returned if something went wrong Return type: null | number - partNodeId (
createCadView
-
Model.
createCadView
(nodeId, viewName, camera[, pmiIds[, nodesToShow[, nodesToHide[, nodeIdsAndLocalTransforms[, cuttingPlane[, meshInstanceData]]]]]]) Arguments: - nodeId (
number()
) – None - viewName (
string()
) – Name of the view - camera (
Camera()
) – Camera that will be set when the view gets activated - pmiIds (
null | [number]()
) – optional (optional, pass null or empty array if none to send) Node IDs of the PMI to show for the view - nodesToShow (
null | [number]()
) – optional (optional, pass null or empty array if none to send) Node IDs of the elements to force visibility on - nodesToHide (
null | [number]()
) – optional (optional, pass null or empty array if none to send) Node IDs of the elements to force visibility off - nodeIdsAndLocalTransforms (
null | [(number, Matrix)]()
) – optional (optional, pass null or empty array if none to send) array of node ID and matrix pair, defining specific local transform to apply - cuttingPlane (
null | Plane()
) – optional (optional, pass null if none to send) Cutting plane to set when the view gets activated. Distance of the planes must be in the same unit as the model. - meshInstanceData (
null | MeshInstanceData()
) – optional (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)
Creates a CAD view. This method will trigger a “cadViewCreated” callback if the creation is successful.
Returns: id of the view, null is returned if the function fails Return type: null | number - nodeId (
createImage
-
Model.
createImage
(primaryImage[, thumbnailImage]) Arguments: - primaryImage (
ImageOptions()
) – The image data and associated options - thumbnailImage (
ImageOptions()
) – optional If specified, an uncompressed image that will be used as a placeholder for the primary image until it is fully loaded. Only useful whenprimaryImage
is a compressed image.
Creates an image that can be applied as a texture via [[setNodesTexture]]. See [[deleteImages]].
Return type: Promise <ImageId> - primaryImage (
createMesh
-
Model.
createMesh
(meshData[, config]) Arguments: - meshData (
MeshData()
) – [[MeshData]] object containing data to insert into the scene. - config (
function()
) – optional None
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]].
Return type: Promise <MeshId>
- meshData (
createMeshInstance
-
Model.
createMeshInstance
(data[, parentNodeId[, preventFromResetting[, isOutOfHierarchy]]]) Arguments: - data (
MeshInstanceData()
) – object that specifies the data for this mesh instance - parentNodeId (
null | number()
) – optional the ID of the desired parent node - preventFromResetting (
null | boolean()
) – optional if set to true, then the visibility and positioning won’t be reset when resetxxx() functions gets called. - isOutOfHierarchy (
null | boolean()
) – optional True if the node created shouldn’t appear in the model structure.
Creates an instance of a mesh that has been created using [[createMesh]] or retrieved using [[getMeshIds]].
Returns: Promise that resolves with a node ID that can be used to perform operations on this instance. Return type: Promise <number> - data (
createNode
-
Model.
createNode
(parentNodeId, nodeName[, nodeId[, localMatrix[, visibility[, measurementUnit]]]]) Arguments: - parentNodeId (
undefined | null | number()
) – ID of the node to link the child node to. This ID should not have a type of Body or BodyInstance. If this parameter isundefined
, the child node will be linked to the root. - nodeName (
string()
) – None - nodeId (
null | number()
) – optional None - localMatrix (
null | Matrix()
) – optional (optional) Initial local matrix of the node (identity if none set) - visibility (
null | boolean()
) – optional (optional) Initial visibility of the node (visible if nothing set) - measurementUnit (
null | number()
) – optional None
Creates a node
Returns: child node ID Return type: number - parentNodeId (
createPart
-
Model.
createPart
([nodeId]) Arguments: - nodeId (
null | number()
) – optional None
Creates an part node
Returns: a node ID to access the created part node Return type: number - nodeId (
createPmiInstance
-
Model.
createPmiInstance
(data, pmiType, pmiSubType, refOnTopoItems[, parentNodeId]) Arguments: - data (
MeshInstanceData()
) – object that specifies the data for the PMI graphic representation - pmiType (
PmiType()
) – see PmiType enum (Datum, Gdt, Dimension…) - pmiSubType (
PmiSubType()
) – see PmiSubType enum (DatumTarget, GdtFcf, DimensionDistance…) - refOnTopoItems (
[RefOnTopoItem]()
) – see RefOnTopoItem. It defines the PMI links to a body element, like a face or an edge - parentNodeId (
null | number()
) – optional the ID of the desired parent node
Creates a PMI Instance from a mesh that has been created using the createMesh method.
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 Return type: Promise <number> - data (
deleteImages
-
Model.
deleteImages
(imageIds) Arguments: - imageIds (
[ImageId]()
) – The IDs of the images to be deleted
Deletes images created with [[createImage]].
Return type: Promise <void> - imageIds (
deleteMeshInstances
-
Model.
deleteMeshInstances
(nodeIds) Arguments: - nodeIds (
[number]()
) – array of IDs for mesh instances created at run time that should be destroyed
Deletes mesh instances that have been created at run time
Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - nodeIds (
deleteMeshes
-
Model.
deleteMeshes
(ids) Arguments: - ids (
[MeshId]()
) – None
Deletes meshes that have been created at run time.
In order for this method to succeed, all mesh instances created for the given IDs must have also been destroyed with [[deleteMeshInstances]].
Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - ids (
deleteNode
-
Model.
deleteNode
(nodeId) Arguments: - nodeId (
number()
) – None
Delete a node and all its children
Return type: Promise <void> - nodeId (
getAbsoluteRootNode
-
Model.
getAbsoluteRootNode
() Returns the absolute root node of the assembly tree.
Returns: Id for the model tree root node or null if the model structure is not loaded. Return type: number
getActiveCadConfiguration
-
Model.
getActiveCadConfiguration
() Gets Active CAD configuration
Returns: ID of activated CAD Configuration Return type: null | number
getAssociatedModelKey
-
Model.
getAssociatedModelKey
(nodeId) Arguments: - nodeId (
number()
) – None
Return type: Promise <null | ModelKey>
- nodeId (
getBimIdConnectedElements
-
Model.
getBimIdConnectedElements
(node, bimId, type) Arguments: - node (
number()
) – any known node id of the working model. - bimId (
string()
) – bim id for which you want its relationships. - type (
RelationshipType()
) – None
Retrieve all relationships that a bim id have, sorted in 2 arrays (relateds and relatings)
Returns: double array of bim id of relationship of the BimId sorted by its relateds and its relatings. Return type: function - node (
getBimIdFromNode
-
Model.
getBimIdFromNode
(node) Arguments: - node (
number()
) – the id of the node for which you want its bim id.
Retrieves the bim id of the corresponding node id.
Returns: the bim id corresponding to the node or null if none. Return type: null | string - node (
getBimIdRelatingElements
-
Model.
getBimIdRelatingElements
(node, bimId, type) Arguments: - node (
number()
) – any known node id of the working model. - bimId (
string()
) – bim id for which you want its relating relationships. - type (
RelationshipType()
) – None
Retrieve all relating relationships that a bim id have.
Returns: array of bim id which are the relating relationship of the BimId. Return type: [string] - node (
getBimIdsFromGenericId
-
Model.
getBimIdsFromGenericId
(ifcGuid) Arguments: - ifcGuid (
string()
) – the generic id for which you want its bim id.
Retrieves the bim ids of the corresponding generic id.
Returns: the bim id corresponding to the ifcGuid or null if none. Return type: [string] - ifcGuid (
getBimInfoFromBimId
-
Model.
getBimInfoFromBimId
(node, bimId) Arguments: - node (
number()
) – any known node id of the working model. - bimId (
string()
) – bim id for which you want the bim element name.
Retrieve the name of the bim element
Returns: the name and the info regarding the connection to a node of the bim element. Return type: function - node (
getBranchVisibility
-
Model.
getBranchVisibility
(nodeId) Arguments: - nodeId (
number()
) – ID of the node at the root of the branch.
Branch visibility indicates the visibility state for all of a node’s children.
Returns: Shown/Hidden if all children have the same visibility state, Mixed otherwise. Return type: BranchVisibility - nodeId (
getCadConfigurations
-
Model.
getCadConfigurations
() Gets CAD configurations
Returns: an object mapping CAD configuration ID to config name Return type: IdStringMap
getCadViewConfiguration
-
Model.
getCadViewConfiguration
(cadViewNodeId) Arguments: - cadViewNodeId (
number()
) – None
Get the configuration in which the view is defined
Returns: ID of CAD Configuration of the view Return type: null | number - cadViewNodeId (
getCadViewMap
-
Model.
getCadViewMap
() Gets CAD View information for this model.
Returns: a map mapping associating CAD View ID to name Return type: Map <number, string>
getCadViewPmis
-
Model.
getCadViewPmis
(nodeId) Arguments: - nodeId (
number()
) – None
Get PMI IDs for a CAD View
Returns: IDs of visible PMIs for the view Return type: [number] - nodeId (
getDataFromIds
-
Model.
getDataFromIds
(ids) Arguments: - ids (
DataIds()
) – None
Returns a data object. During the authoring phase, a user can store general data within a model. (This is how properties are stored, for example.) This function allows you to retrieve the data from the client application.
See: Model::Insert
Returns: promise that resolves when this operation has completed returning an array of 8bits int arrays for each ModelKey-DataKey pairs Return type: Promise <[Uint8Array]> - ids (
getDefaultCadConfiguration
-
Model.
getDefaultCadConfiguration
() Gets CAD default configuration
Returns: ID of default CAD Configuration Return type: null | number
getDefaultCadView
-
Model.
getDefaultCadView
() Gets CAD default view
Returns: ID of default CAD Configuration Return type: null | number
getEdgeAttributes
-
Model.
getEdgeAttributes
(nodeId, edgeIndex) Arguments: - nodeId (
number()
) – Node to retrieve edge properties from - edgeIndex (
number()
) – Index of edge for which to retrieve edge attributes
Returns edge attributes for a node of the given node and edge.
Returns: Promise for the requested edge attributes. Properties returned will be null if none associated with the edge. Return type: Promise <null | SubentityAttributes> - nodeId (
getEdgeCount
-
Model.
getEdgeCount
(nodeId) Arguments: - nodeId (
number()
) – Node to retrieve edge count from
Returns edge count for a node of the given node.
Returns: Promise providing the number of edges Return type: Promise <number> - nodeId (
getEdgeProperty
-
Model.
getEdgeProperty
(nodeId, edgeId) Arguments: - nodeId (
number()
) – Node to retrieve edge properties from - edgeId (
number()
) – None
Returns edge properties for a node of the given node and edge.
Returns: Promise for the requested edge properties. Properties returned will be null if none associated with the edge. Return type: Promise <null | Edge> - nodeId (
getFaceAttributes
-
Model.
getFaceAttributes
(nodeId, faceIndex) Arguments: - nodeId (
number()
) – Node to retrieve edge properties from - faceIndex (
number()
) – Index of face for which to retrieve face attributes
Returns face attributes for a node of the given node and face.
Returns: Promise for the requested face attributes. Properties returned will be null if none associated with the edge. Return type: Promise <null | SubentityAttributes> - nodeId (
getFaceCount
-
Model.
getFaceCount
(nodeId) Arguments: - nodeId (
number()
) – Node to retrieve face count from
Returns face count for a node of the given node and face.
Returns: Promise providing the number of faces Return type: Promise <number> - nodeId (
getFaceProperty
-
Model.
getFaceProperty
(nodeId, faceId) Arguments: - nodeId (
number()
) – Node to retrieve face properties from - faceId (
number()
) – None
Returns Face properties for a node of the given node and face.
Returns: Promise for the requested face properties. Properties returned will be null if none associated with the face. Return type: Promise <null | Face> - nodeId (
getFilterName
-
Model.
getFilterName
(filterId) Arguments: - filterId (
FilterId()
) – None
Returns: The name of a filter for the given filter ID index or null if filter was not found
Return type: null | string
- filterId (
getFilters
-
Model.
getFilters
() Returns names and ids of all filters available in the scene
Returns: a map associating Filter IDs to filter names Return type: Map <FilterId, string>
getFiltersWithNode
-
Model.
getFiltersWithNode
(nodeIdSearched) Arguments: - nodeIdSearched (
number()
) – None
Returns: Filters which retain or remove the given node.
Return type: [FilterId]
- nodeIdSearched (
getGenericIdFromBimId
-
Model.
getGenericIdFromBimId
(node, bimId) Arguments: - node (
number()
) – any known node id of the working model. - bimId (
string()
) – bim id for which you want its generic id.
Retrieves the generic id of the corresponding bim id.
Returns: the generic id corresponding to the BimId or null if none. Return type: null | string - node (
getGenericTypeIdMap
-
Model.
getGenericTypeIdMap
() Gets all generic types and NodeIds with that type.
Returns: Map containing generic types and NodeIds Return type: Map <string, Set <number>>
getGenericTypes
-
Model.
getGenericTypes
() This function gets all generic types contained in the model.
Returns: All generic types. Return type: [string]
getLayerIdsFromName
-
Model.
getLayerIdsFromName
(name) Arguments: - name (
string()
) – None
Returns: Id of layers for the given filter name or null if no layers are found
Return type: null | [LayerId]
- name (
getLayerName
-
Model.
getLayerName
(layerId) Arguments: - layerId (
LayerId()
) – None
Returns: The name of a layer for the given filter ID or null if layer was not found
Return type: null | string
- layerId (
getLayers
-
Model.
getLayers
() Returns names and ids of all layers available in the scene
Returns: a map associating Layer IDs to Layer names Return type: Map <LayerId, string>
getLooseBounding
-
Model.
getLooseBounding
() Gets the world space bounding box for the model. This does not take node visibility into account.
Returns: Promise that resolves with a Box representing the world space bounding box of the model. Return type: Promise <Box>
getLowestAvailableNodeId
-
Model.
getLowestAvailableNodeId
() Returns the lowest available node ID
Return type: number
getMeshIds
-
Model.
getMeshIds
(nodeIds) Arguments: - nodeIds (
[number]()
) – None
Retrieve the [[MeshId]] associated with the mesh data attached to the given nodes.
Return type: Promise <[MeshId]> - nodeIds (
getMetallicRoughness
-
Model.
getMetallicRoughness
(nodeIds) Arguments: - nodeIds (
[number]()
) – List of nodes to get material properties for
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
Return type: Promise <[null | MetallicRoughnessValue]> - nodeIds (
getModelBounding
-
Model.
getModelBounding
(ignoreInvisible, includeExcluded, tightBounding) Arguments: - ignoreInvisible (
boolean()
) – None - includeExcluded (
boolean()
) – None - tightBounding (
boolean()
) – None
Gets the world space bounding box for the model.
Returns: Promise that resolves with a Box representing the world space bounding box of the model. Return type: Promise <Box> - ignoreInvisible (
getModelFileNameFromNode
-
Model.
getModelFileNameFromNode
(nodeId) Arguments: - nodeId (
number()
) – None
Returns: the original file name of the model which contain the given node or null if the node is not found.
Return type: null | string
- nodeId (
getModelFileTypeFromNode
-
Model.
getModelFileTypeFromNode
(nodeId) Arguments: - nodeId (
number()
) – None
Returns: the original file type of the model which contain the given node or null if the node is not found.
Return type: null | FileType
- nodeId (
getNodeCappingMeshData
-
Model.
getNodeCappingMeshData
(nodeId) Arguments: - nodeId (
number()
) – None
Fetch the mesh data for any capping geometry on a particular node
Return type: Promise <null | MeshDataCopy> - nodeId (
getNodeChildren
-
Model.
getNodeChildren
(nodeId[, includeOutOfHierarchy]) Arguments: - nodeId (
number()
) – None - includeOutOfHierarchy (
boolean()
) – optional true to include Out Of Hierarchy node, false or null to exclude them
Returns IDs for child nodes for the given Id.
Returns: ID for the children of this node, or null if the ID is invalid Return type: [number] - nodeId (
getNodeColorMap
-
Model.
getNodeColorMap
(startNodeId, elementType) Arguments: - startNodeId (
number()
) – The start node to walk when building the color map. - elementType (
ElementType()
) – Returned colors are of this element type.
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.
Return type: Promise <Map <number, Color>> - startNodeId (
getNodeEffectiveFaceColor
-
Model.
getNodeEffectiveFaceColor
(partId, faceIndex[, view]) Arguments: - partId (
number()
) – None - faceIndex (
number()
) – the index of the face in the node - view (
View()
) – optional the View to use when calculating view effects
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.
Return type: Promise <null | Color> - partId (
getNodeEffectiveLineColor
-
Model.
getNodeEffectiveLineColor
(partId, lineIndex[, view]) Arguments: - partId (
number()
) – None - lineIndex (
number()
) – the index of the line in the node - view (
View()
) – optional the View to use when calculating view effects
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.
Return type: Promise <null | Color> - partId (
getNodeEffectivePointColor
-
Model.
getNodeEffectivePointColor
(partId, pointIndex[, view]) Arguments: - partId (
number()
) – None - pointIndex (
number()
) – the index of the point in the node - view (
View()
) – optional the View to use for calculating view effects
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.
Return type: Promise <null | Color> - partId (
getNodeExchangeId
-
Model.
getNodeExchangeId
(nodeId) Arguments: - nodeId (
number()
) – The node ID to get the Exchange ID from.
Returns the Exchange ID of a node in the assembly tree.
Returns: The Exchange ID of the node with the given nodeId or null if no Exchange ID is found. Return type: null | string - nodeId (
getNodeFaceColor
-
Model.
getNodeFaceColor
(partId, faceIndex) Arguments: - partId (
number()
) – None - faceIndex (
number()
) – the index of the face in the node
Gets the color set via [[setNodeFaceColor]] on a face element. If no color has been set,
null
will be returned. <br><br> See also: [[getNodeEffectiveFaceColor]]Return type: Promise <null | Color> - partId (
getNodeFaceHighlighted
-
Model.
getNodeFaceHighlighted
(nodeId, faceIndex) Arguments: - nodeId (
number()
) – the ID of the node containing the face element - faceIndex (
number()
) – the index of the face within the node
Returns whether the supplied face element has been highlighted with [[setNodeFaceHighlighted]].
Return type: Promise <boolean> - nodeId (
getNodeGenericId
-
Model.
getNodeGenericId
(nodeId) Arguments: - nodeId (
number()
) – None
Returns: the generic id of the given node or null if the node is not found.
Return type: null | string
- nodeId (
getNodeGenericType
-
Model.
getNodeGenericType
(nodeId) Arguments: - nodeId (
number()
) – None
Returns: the generic type of the given node or null if the node is not found.
Return type: null | string
- nodeId (
getNodeIdFromBimId
-
Model.
getNodeIdFromBimId
(node, bimID) Arguments: - node (
number()
) – any known node id of the working model. - bimID (
string()
) – bim id for which you want its node id.
Retrieves the node id of the corresponding bim id.
Returns: the node id corresponding to the BimId or null if none. Return type: null | number - node (
getNodeIdOffset
-
Model.
getNodeIdOffset
(nodeId) Arguments: - nodeId (
number()
) – The node to obtain the node ID offset from.
Retrieves the node ID offset for a given node.
Returns: The node ID offset for the supplied node. Return type: number - nodeId (
getNodeIdsByGenericIds
-
Model.
getNodeIdsByGenericIds
(genericIds) Arguments: - genericIds (
[string]()
) – Array of generic IDs to find nodes fore
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.
Returns: Array of node ids corresponding to the provided generic IDs Return type: [number] - genericIds (
getNodeLayerId
-
Model.
getNodeLayerId
(nodeId) Arguments: - nodeId (
number()
) – The node ID to get the Exchange ID from.
Returns the layer ID of a node in the assembly tree.
Returns: The layer ID of the node with the given nodeId or null if no layer is found. Return type: null | LayerId - nodeId (
getNodeLineColor
-
Model.
getNodeLineColor
(partId, lineIndex) Arguments: - partId (
number()
) – None - lineIndex (
number()
) – the index of the line in the node
Gets the color set via [[setNodeLineColor]] on a line element. If no color has been set,
null
will be returned.Return type: Promise <null | Color> - partId (
getNodeLineHighlighted
-
Model.
getNodeLineHighlighted
(nodeId, lineIndex) Arguments: - nodeId (
number()
) – the ID of the node containing the line element - lineIndex (
number()
) – the index of the line within the node
Returns whether the supplied line element has been highlighted with [[setNodeLineHighlighted]].
Return type: Promise <boolean> - nodeId (
getNodeMatrix
-
Model.
getNodeMatrix
(nodeId) Arguments: - nodeId (
number()
) – None
Returns a copy of the Matrix for a node of the given ID
Returns: Copy of the Matrix of the node Return type: Matrix - nodeId (
getNodeMeshData
-
Model.
getNodeMeshData
(nodeId) Arguments: - nodeId (
number()
) – the node’s ID
Fetch the mesh data for a particular node
Return type: Promise <MeshDataCopy> - nodeId (
getNodeName
-
Model.
getNodeName
(nodeId) Arguments: - nodeId (
number()
) – The node ID to get the name of.
Returns the name for a node in the assembly tree.
Returns: The name of the node with the given nodeId or null if no name is found. Return type: null | string - nodeId (
getNodeNetMatrix
-
Model.
getNodeNetMatrix
(nodeId) Arguments: - nodeId (
number()
) – None
Returns net matrix for a node of the given ID
Returns: Net Matrix of the Node Return type: Matrix - nodeId (
getNodeParent
-
Model.
getNodeParent
(nodeId) Arguments: - nodeId (
number()
) – None
Returns the parent Id for the given node id.
Returns: ID of the parent node for the supplied ID. If the ID is invalid or the root ID, null is returned. Return type: null | number - nodeId (
getNodePointColor
-
Model.
getNodePointColor
(partId, pointIndex) Arguments: - partId (
number()
) – None - pointIndex (
number()
) – the index of the point in the node
Gets the color set via [[setNodePointColor]] on a point element. If no color has been set,
null
will be returned. <br><br> See also: [[getNodeEffectivePointColor]]Return type: Promise <null | Color> - partId (
getNodePointHighlighted
-
Model.
getNodePointHighlighted
(nodeId, pointIndex) Arguments: - nodeId (
number()
) – the ID of the node containing the point element - pointIndex (
number()
) – the index of the point within the node
Returns whether the supplied point element has been highlighted with [[setNodePointHighlighted]].
Return type: Promise <boolean> - nodeId (
getNodeProperties
-
Model.
getNodeProperties
(nodeId, computeFromChildren) Arguments: - nodeId (
number()
) – None - computeFromChildren (
boolean()
) – If true physical properties will be computed from child nodes.
Returns the properties for the given node ID.
Returns: object properties for the supplied ID, or null if the ID was invalid Return type: Promise <null | StringStringMap> - nodeId (
getNodeRealBounding
-
Model.
getNodeRealBounding
(nodeId[, view]) Arguments: - nodeId (
number()
) – ID of the node for which you wish to get the bounding box. - view (
View()
) – optional View to use for determining visibility.
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.
Returns: Promise that resolves with the world space bounding box for the given ID. Return type: Promise <Box> - nodeId (
getNodeType
-
Model.
getNodeType
(nodeId) Arguments: - nodeId (
number()
) – None
Returns the type of the node with the given ID.
Returns: The type of the node. Return type: NodeType - nodeId (
getNodeUnitMultiplier
-
Model.
getNodeUnitMultiplier
(nodeId) Arguments: - nodeId (
number()
) – None
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 is1.0
.Returns: The unit multiplier for the model (in mm) Return type: number - nodeId (
getNodeUserData
-
Model.
getNodeUserData
(nodeId, index) Arguments: - nodeId (
number()
) – The ID of the node to query. - index (
UserDataIndex()
) – The index of the data.
Returns the user data for a given node and index.
Returns: The user data. Throws: InvalidNodeIdError
InvalidIndexError
Return type: Uint8Array - nodeId (
getNodeUserDataIndices
-
Model.
getNodeUserDataIndices
(nodeId) Arguments: - nodeId (
number()
) – The ID of the node to query.
Returns all the
UserDataIndex
items associated with the input node.Returns: A list of UserDataIndex
, possibly empty.Throws: InvalidNodeIdError
Return type: [UserDataIndex] - nodeId (
getNodeVisibility
-
Model.
getNodeVisibility
(nodeId) Arguments: - nodeId (
number()
) – ID of the node to get visibility for.
Returns the current visibility for a node.
Returns: true if the current node’s visibility state is on or false if it is not. Return type: boolean - nodeId (
getNodesBounding
-
Model.
getNodesBounding
(nodeIds[, config]) Arguments: - nodeIds (
[number]()
) – IDs of the nodes for which you wish to get the bounding box. - config (
GetNodesBoundingConfig()
) – optional Allows fine control of what body types to compute the bounding against. If not provided, all body types are considered.
Gets the world space bounding box for a list of nodes.
Returns: Promise that resolves with the world space bounding box for the given IDs. Return type: Promise <Box> - nodeIds (
getNodesByGenericType
-
Model.
getNodesByGenericType
(genericType) Arguments: - genericType (
string()
) – None
This function returns all NodeIds with an IFC type.
Returns: All NodeIds with an IFC type Return type: null | Set <number> - genericType (
getNodesCappingMeshData
-
Model.
getNodesCappingMeshData
(nodeIds) Arguments: - nodeIds (
[number]()
) – the node IDs to get capping data from.
Fetch the mesh data for any capping geometry on a list of nodes and their children
Return type: Promise <[MeshDataCopy]> - nodeIds (
getNodesCullingVectors
-
Model.
getNodesCullingVectors
(nodeIds) Arguments: - nodeIds (
[number]()
) – The nodes to query culling vectors from.
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.Returns: A promise of culling vectors. Return type: Promise <[null | CullingVector]> - nodeIds (
getNodesEffectiveFaceColor
-
Model.
getNodesEffectiveFaceColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of the nodes to be queried
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.
Return type: Promise <[Color]> - nodeIds (
getNodesEffectiveLineColor
-
Model.
getNodesEffectiveLineColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of the nodes to be queried
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.
Return type: Promise <[Color]> - nodeIds (
getNodesEffectiveOpacity
-
Model.
getNodesEffectiveOpacity
(leafNodes, elementType) Arguments: - leafNodes (
[number]()
) – None - elementType (
ElementType()
) – the type of element (faces, lines or points) to query
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.
Return type: Promise <[number]> - leafNodes (
getNodesEffectivePointColor
-
Model.
getNodesEffectivePointColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of the nodes to be queried
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.
Return type: Promise <[Color]> - nodeIds (
getNodesFaceColor
-
Model.
getNodesFaceColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of the nodes to be queried
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. <br><br> See also: [[getNodesEffectiveFaceColor]]Return type: Promise <[null | Color]> - nodeIds (
getNodesFromFiltersId
-
Model.
getNodesFromFiltersId
(filtersId) Arguments: - filtersId (
[FilterId]()
) – array of filters indexes to take in account
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.
Return type: null | FilteredNodes
- filtersId (
getNodesFromLayer
-
Model.
getNodesFromLayer
(layerId[, onlyTreeNodes]) Arguments: - layerId (
LayerId()
) – The layer ID to get nodes from. - onlyTreeNodes (
boolean()
) – optional if true return only nodes present in model Tree
Returns IDs of nodes in the given layer.
Returns: An array of nodes Id of nodes with the given layerId or null if no layers are found. Return type: null | [number] - layerId (
getNodesFromLayerName
-
Model.
getNodesFromLayerName
(layerName[, onlyTreeNodes]) Arguments: - layerName (
string()
) – None - onlyTreeNodes (
boolean()
) – optional if true return only nodes present in model Tree
Returns IDs of nodes in the given layer.
Returns: An array of nodes Id of nodes with the given layerName or null if no layers are found. Return type: null | [number] - layerName (
getNodesFromLayers
-
Model.
getNodesFromLayers
(layersId[, onlyTreeNodes]) Arguments: - layersId (
[LayerId]()
) – Array of layers Id to get nodes from. - onlyTreeNodes (
boolean()
) – optional if true return only nodes present in model Tree
Returns IDs of nodes in given layers.
Returns: An array of nodes Id of nodes with one of the given layerId or null if no layers are found. Return type: null | [number] - layersId (
getNodesHaveTransparency
-
Model.
getNodesHaveTransparency
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes to query.
Returns whether nodes with the given NodeIds have an opacity value that is not fully opaque.
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. Return type: Promise <[boolean]> - nodeIds (
getNodesHighlighted
-
Model.
getNodesHighlighted
(partIds) Arguments: - partIds (
[number]()
) – None
Returns whether the supplied nodes have been highlighted with [[setNodesHighlighted]].
Return type: Promise <[boolean]> - partIds (
getNodesInstancingSamePart
-
Model.
getNodesInstancingSamePart
(nodeId) Arguments: - nodeId (
number()
) – None
Returns IDs of nodes who instance the same part as the supplied node. This method should be called on nodes whose type is
PartInstance
.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 typePartInstance
thennull
will be returned.Return type: Promise <null | [number]> - nodeId (
getNodesLineColor
-
Model.
getNodesLineColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of the nodes to be queried
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.Return type: Promise <[null | Color]> - nodeIds (
getNodesOpacity
-
Model.
getNodesOpacity
(leafNodes) Arguments: - leafNodes (
[number]()
) – None
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.Return type: Promise <[null | number]> - leafNodes (
getNodesPointColor
-
Model.
getNodesPointColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of the nodes to be queried
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. <br><br> See also: [[getNodesEffectivePointColor]]Return type: Promise <[null | Color]> - nodeIds (
getOutOfHierarchy
-
Model.
getOutOfHierarchy
(nodeId) Arguments: - nodeId (
number()
) – None
Returns “Out Of Hierarchy” status for child node for the given Id.
Returns: false if node is Out Of Hierarchy, true if it is Return type: boolean - nodeId (
getPmiColor
-
Model.
getPmiColor
() Returns the set PMI override color (if none is set, defaults to black)
Returns: color Return type: Color
getPmiColorOverride
-
Model.
getPmiColorOverride
() Returns: a boolean value indicating the status of the PMI override color. Return type: boolean
getPmiSubtype
-
Model.
getPmiSubtype
(pmiId) Arguments: - pmiId (
number()
) – None
Returns the subtype of a given PMI
Returns: Subtype of the PMI (Dimension distance, Datum target, GD&T fcf…) Return type: PmiSubType - pmiId (
getPmiTopologyReferences
-
Model.
getPmiTopologyReferences
(pmiNodeId) Arguments: - pmiNodeId (
number()
) – the ID of the PMI node.
Gets an array of PMI topology references linking a PMI node to a body element, like a face or an edge.
Return type: null | [RefOnTopoItem] - pmiNodeId (
getPmiType
-
Model.
getPmiType
(pmiId) Arguments: - pmiId (
number()
) – None
Returns the type of a given PMI
Returns: Type of the PMI (Dimension, Datum, GD&T…) Return type: PmiType - pmiId (
getPmis
-
Model.
getPmis
() Returns names and ids of all the PMIs available in the scene
Returns: a map associating PMI IDs to PMI names Return type: IdStringMap
getPointAttributes
-
Model.
getPointAttributes
(nodeId, pointIndex) Arguments: - nodeId (
number()
) – Node to retrieve point properties from - pointIndex (
number()
) – Index of point for which to retrieve point attributes
Returns point attributes for a node of the given node and point.
Returns: Promise for the requested point attributes. Properties returned will be null if none associated with the point. Return type: Promise <null | SubentityAttributes> - nodeId (
getRelationshipTypesFromBimId
-
Model.
getRelationshipTypesFromBimId
(node, bimId) Arguments: - node (
number()
) – any known node id of the working model. - bimId (
string()
) – bim id for which you want its types of relationships.
Retrieves all type of relationships that a bim id has.
Returns: array of type of relationship corresponding to the BimId. Return type: [RelationshipType] - node (
getUniqueLayerNames
-
Model.
getUniqueLayerNames
() Return names of layers. Different layers can have the same name. Some layers can be unnamed.
Returns: Names of layers Return type: [string]
getViewAxes
-
Model.
getViewAxes
() Returns: the up and front vectors for the model coordinate system. Return type: ViewAxes
getVisibilityState
-
Model.
getVisibilityState
(startNodeId) Arguments: - startNodeId (
number()
) – None
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.
Return type: Promise <VisibilityState> - startNodeId (
hasDepthRange
-
Model.
hasDepthRange
(nodeIds) Arguments: - nodeIds (
[number]()
) – None
Return type: Promise <[boolean]>
- nodeIds (
hasEffectiveGenericType
-
Model.
hasEffectiveGenericType
(nodeId, genericType) Arguments: - nodeId (
number()
) – None - genericType (
string()
) – None
Checks if a [[NodeId]] is a generic type.
Return type: boolean - nodeId (
isAnnotationView
-
Model.
isAnnotationView
(cadViewNodeId) Arguments: - cadViewNodeId (
number()
) – Node ID of the CAD view
Tells if the view is an annotation view or not
Returns: true if the view is an annotation view Return type: boolean - cadViewNodeId (
isCombineStateView
-
Model.
isCombineStateView
(cadViewNodeId) Arguments: - cadViewNodeId (
number()
) – Node ID of the CAD view
Tells if the view is a combine state view or not
Returns: true if the view is a combine state view Return type: boolean - cadViewNodeId (
isDrawing
-
Model.
isDrawing
() Tells if the model is a CAD drawing or not
Returns: true if the model is a CAD drawing Return type: boolean
isFaceMeasurable
-
Model.
isFaceMeasurable
(bodyId, faceIndex) Arguments: - bodyId (
number()
) – None - faceIndex (
number()
) – None
Return type: Promise <boolean>
- bodyId (
isLineMeasurable
-
Model.
isLineMeasurable
(bodyId, lineIndex) Arguments: - bodyId (
number()
) – ID of the body node containing the line - lineIndex (
number()
) – Index of the line ot be checked
Returns: true if the line has associated measurement data
Return type: Promise <boolean>
- bodyId (
isMeasurable
-
Model.
isMeasurable
() Returns: true if the model contains measurement data. Return type: boolean
isNodeLoaded
-
Model.
isNodeLoaded
(nodeId) Arguments: - nodeId (
number()
) – The node to query.
Queries if a node is fully loaded or not.
Returns: True if the node is fully loaded; false otherwise. Return type: boolean - nodeId (
isWithinExternalModel
-
Model.
isWithinExternalModel
(nodeId) Arguments: - nodeId (
number()
) – None
Returns true if the node is within an external model.
Return type: boolean - nodeId (
loadMeasurementFromFile
-
Model.
loadMeasurementFromFile
(filename) Arguments: - filename (
string()
) – Name of a file containing ZIP measurement data
Loads measurement data from a ZIP file
Return type: Promise <void> - filename (
loadMeasurementFromJson
-
Model.
loadMeasurementFromJson
(json) Arguments: - json (
any()
) – JSON object containing measurement data
Loads measurement data from a JSON object
Return type: Promise <void> - json (
loadMeasurementFromString
-
Model.
loadMeasurementFromString
(str) Arguments: - str (
string()
) – JSON string containing measurement data
Loads measurement data from a JSON string
Return type: Promise <void> - str (
loadSubtreeFromModel
-
Model.
loadSubtreeFromModel
(nodeId, modelName, config) Arguments: - nodeId (
number()
) – 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 (
string()
) – The name of the model to load. - config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
Loads the tree stored in a model file and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromModel
(nodeId, modelName[, additionalMatrix]) Arguments: - nodeId (
number()
) – 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 (
string()
) – The name of the model to load. - additionalMatrix (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix.
Loads the tree stored in a model file and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
loadSubtreeFromScsBuffer
-
Model.
loadSubtreeFromScsBuffer
(nodeId, buffer, config) Arguments: - nodeId (
number()
) – 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 (
Uint8Array()
) – The SCS buffer to load. - config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
Loads the tree stored in a model file and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromScsBuffer
(nodeId, buffer[, additionalMatrix]) Arguments: - nodeId (
number()
) – 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 (
Uint8Array()
) – The SCS buffer to load. - additionalMatrix (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix.
Loads the tree stored in a model file and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
loadSubtreeFromScsFile
-
Model.
loadSubtreeFromScsFile
(nodeId, scsFilename, config) Arguments: - nodeId (
number()
) – 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 (
string()
) – The name of the SCS file to load. - config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
Loads the tree stored in a model file and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromScsFile
(nodeId, scsFilename[, additionalMatrix]) Arguments: - nodeId (
number()
) – 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 (
string()
) – The name of the SCS file to load. - additionalMatrix (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix.
Loads the tree stored in a model file and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
loadSubtreeFromScsXmlBuffer
-
Model.
loadSubtreeFromScsXmlBuffer
(nodeId, xmlData, modelNameToScs, config) Arguments: - nodeId (
number()
) – 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 (
string | Document()
) – XML document or XML document string. - modelNameToScs (
null | ModelNameToScsFileFunc()
) – 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 (
LoadSubtreeConfig()
) – Configuration to control load behavior.
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.
Returns: A Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromScsXmlBuffer
(nodeId, xmlData[, modelNameToScs[, additionalMatrix[, allowMissingExternalModels]]]) Arguments: - nodeId (
number()
) – 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 (
string | Document()
) – XML document or XML document string. - modelNameToScs (
null | ModelNameToScsFileFunc()
) – optional 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 (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix. - allowMissingExternalModels (
boolean()
) – optional Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.
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.
Returns: A Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.Return type: Promise <[number]> - nodeId (
loadSubtreeFromScsXmlFile
-
Model.
loadSubtreeFromScsXmlFile
(nodeId, xmlFilename, modelNameToScs, config) Arguments: - nodeId (
number()
) – 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 (
string()
) – URL of XML file to load. - modelNameToScs (
null | ModelNameToScsFileFunc()
) – 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 (
LoadSubtreeConfig()
) – Configuration to control load behavior.
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.
Returns: A Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromScsXmlFile
(nodeId, xmlFilename[, modelNameToScs[, additionalMatrix[, allowMissingExternalModels]]]) Arguments: - nodeId (
number()
) – 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 (
string()
) – URL of XML file to load. - modelNameToScs (
null | ModelNameToScsFileFunc()
) – optional 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 (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix. - allowMissingExternalModels (
boolean()
) – optional Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.
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.
Returns: A Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.Return type: Promise <[number]> - nodeId (
loadSubtreeFromXmlBuffer
-
Model.
loadSubtreeFromXmlBuffer
(nodeId, xmlData, massageModelName, config) Arguments: - nodeId (
number()
) – 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 (
string | Document()
) – XML document or XML document string. - massageModelName (
null | MassageModelNameFunc()
) – Optional callback to massage model names within the XML file. Return null to skip the model. - config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
Loads the tree stored in the XML and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromXmlBuffer
(nodeId, xmlData[, massageModelName[, additionalMatrix[, allowMissingExternalModels]]]) Arguments: - nodeId (
number()
) – 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 (
string | Document()
) – XML document or XML document string. - massageModelName (
null | MassageModelNameFunc()
) – optional Optional callback to massage model names within the XML file. Return null to skip the model. - additionalMatrix (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix. - allowMissingExternalModels (
boolean()
) – optional Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.
Loads the tree stored in the XML and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
loadSubtreeFromXmlFile
-
Model.
loadSubtreeFromXmlFile
(nodeId, xmlFilename, massageModelName, config) Arguments: - nodeId (
number()
) – 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 (
string()
) – URL of XML file to load. - massageModelName (
null | MassageModelNameFunc()
) – Optional callback to massage model names within the XML file. Return null to skip the model. - config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
Loads the tree stored in the XML and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
-
Model.
loadSubtreeFromXmlFile
(nodeId, xmlFilename[, massageModelName[, additionalMatrix[, allowMissingExternalModels]]]) Arguments: - nodeId (
number()
) – 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 (
string()
) – URL of XML file to load. - massageModelName (
null | MassageModelNameFunc()
) – optional Optional callback to massage model names within the XML file. Return null to skip the model. - additionalMatrix (
null | Matrix()
) – optional Optional matrix to get multiplied into the net attachment matrix. - allowMissingExternalModels (
boolean()
) – optional Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.
Loads the tree stored in the XML and query loading of required meshes
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - nodeId (
registerBimNodes
-
Model.
registerBimNodes
(startNodeId, attributeToMask, legacy_useAttributeTitle) Arguments: - startNodeId (
number()
) – The root of the subtree to walk for registration. - attributeToMask (
function()
) – The callback used to obtain a node’s [[BimMask]] from its attributes. - legacy_useAttributeTitle (
null | string | boolean()
) – None
This function recursively discovers BIM nodes in the supplied subtree and registers them.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> -
Model.
attributeToMask
(value) Arguments: - value (
string()
) – None
Return type: BimMask
- value (
- startNodeId (
registerIfcNodes
-
Model.
registerIfcNodes
(startNodeId, legacy_useAttributeTitle) Arguments: - startNodeId (
number()
) – The root of the subtree to walk for registration. - legacy_useAttributeTitle (
null | string | boolean()
) – None
This function recursively discovers IFC nodes in the supplied subtree and registers them.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> - startNodeId (
replaceMesh
-
Model.
replaceMesh
(id, data) Arguments: - id (
MeshId()
) – None - data (
MeshData()
) – the new data
Replace a mesh’s data. This will affect all instances of that mesh.
Return type: Promise <void> - id (
requestNodes
-
Model.
requestNodes
(nodeIds) Arguments: - nodeIds (
[number]()
) – array of unique IDs for the system to load
Specifies nodes for the system to load. This method is useful when the viewer was created with the <code>streamOnDemand</code> option set to true.
Return type: Promise <void> - nodeIds (
reset
-
Model.
reset
() Resets the state of the model to its default
Returns: Promise that resolves when the operation has completed. Return type: Promise <void>
resetModelHighlight
-
Model.
resetModelHighlight
() Resets highlight for all nodes in the model.
Returns: Promise that resolves when this operation has completed. Return type: Promise <void>
resetModelOpacity
-
Model.
resetModelOpacity
() Resets opacity for all nodes in the model.
Returns: Promise that resolves when this operation has completed. Return type: void
resetNodeMatrixToInitial
-
Model.
resetNodeMatrixToInitial
(nodeId) Arguments: - nodeId (
number()
) – None
Reset node matrix to the one set as the initial one
Return type: Promise <void> - nodeId (
resetNodesColor
-
Model.
resetNodesColor
() Resets color for all nodes in the model.
Returns: Promise that resolves when this operation has completed. Return type: Promise <void>
resetNodesOpacity
-
Model.
resetNodesOpacity
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes whose opacity will be reset to their default values
Resets opacity for a given list of nodes.
Return type: void - nodeIds (
resetNodesTransform
-
Model.
resetNodesTransform
() Resets transform for all nodes in the model.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void>
resetNodesVisibility
-
Model.
resetNodesVisibility
() Resets visibility for all nodes in the model.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void>
setBodyNodesVisibility
-
Model.
setBodyNodesVisibility
(startNodeId, visibility) Arguments: - startNodeId (
number()
) – The start node to walk when updating body nodes visibility. - visibility (
boolean()
) – If true, nodes will be shown. If false, they will be hidden.
Sets the visibility of all body nodes starting from a given node.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> - startNodeId (
-
Model.
setBodyNodesVisibility
(startNodeId, visibilityFormatter) Arguments: - startNodeId (
number()
) – The start node to walk when updating body nodes visibility. - visibilityFormatter (
function()
) – A function that returns the visibility for a given node id
Sets the visibility of all body nodes starting from a given node.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> -
Model.
visibilityFormatter
(node) Arguments: - node (
number()
) – None
Return type: undefined | boolean
- node (
- startNodeId (
setDepthRange
-
Model.
setDepthRange
(nodeIds, min, max) Arguments: - nodeIds (
[number]()
) – the node IDs to operate on - min (
number()
) – the depth value at the near plane - max (
number()
) – the depth value at the far plane
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 (normally0
) is mapped tomin
and the value at the far plane (normally1
) is mapped tomax
.The smaller the range, the more z-fighting you will see among objects set to that range.
Return type: Promise <void> - nodeIds (
setEdgeProperty
-
Model.
setEdgeProperty
(nodeId, edgeId, prop) Arguments: - nodeId (
number()
) – None - edgeId (
number()
) – None - prop (
Base()
) – property (CircleElement, LineElement…)
Set edge property for a node of the given node and edge.
Return type: void - nodeId (
setEnableAutomaticUnitScaling
-
Model.
setEnableAutomaticUnitScaling
(enabled) Arguments: - enabled (
boolean()
) – value indicating if automatic unit scaling will be active
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.
Return type: void - enabled (
setFaceProperty
-
Model.
setFaceProperty
(nodeId, faceId, prop) Arguments: - nodeId (
number()
) – None - faceId (
number()
) – None - prop (
Base()
) – property (CylinderElement, PlaneElement…)
Set face property for a node of the given node and face.
Return type: void - nodeId (
setInstanceModifier
-
Model.
setInstanceModifier
(instanceModifier, nodeIds, value) Arguments: - instanceModifier (
InstanceModifier()
) – InstanceModifier - nodeIds (
[number]()
) – Array of node ids - value (
boolean()
) – boolean
Allows changing the behavior in the viewer
Return type: Promise <void> - instanceModifier (
setMeshLevel
-
Model.
setMeshLevel
(nodeIds, meshLevel) Arguments: - nodeIds (
[number]()
) – IDs of nodes in the assembly on which mesh level will be set - meshLevel (
number()
) – 0 standard, 1 low, 2 extra low
Sets the desired mesh level
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> - nodeIds (
setMetallicRoughness
-
Model.
setMetallicRoughness
(nodeIds, metallicFactor, roughnessFactor) Arguments: - nodeIds (
[number]()
) – List of nodes to set material properties for - metallicFactor (
number()
) – The metalness of the material - roughnessFactor (
number()
) – The roughness of the material
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.
Return type: void - nodeIds (
setNodeFaceColor
-
Model.
setNodeFaceColor
(partId, faceId, color) Arguments: - partId (
number()
) – None - faceId (
number()
) – the Id of the face in the node that will have its color set - color (
Color()
) – the color to set
Sets the color for a face element. This color will take precedence over any currently set color on the node
Return type: Promise <void> - partId (
setNodeFaceHighlighted
-
Model.
setNodeFaceHighlighted
(nodeId, faceId, highlighted) Arguments: - nodeId (
number()
) – 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.
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.
Return type: Promise <void> - nodeId (
setNodeFaceVisibility
-
Model.
setNodeFaceVisibility
(partId, faceId, visibility) Arguments: - partId (
number()
) – 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
Sets the visibility for a face element. This visibility setting will take precedence over other element visibility settings
Return type: void - partId (
setNodeLineColor
setNodeLineHighlighted
-
Model.
setNodeLineHighlighted
(partId, lineId, highlighted) Arguments: - partId (
number()
) – None - lineId (
number()
) – the line Id that is the target of this operation. - highlighted (
boolean()
) – value indicating whether the supplied line element should be 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.
Return type: Promise <void> - partId (
setNodeLineVisibility
-
Model.
setNodeLineVisibility
(partId, lineId, visibility) Arguments: - partId (
number()
) – 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
Sets the visibility for a line element. This visibility setting will take precedence over other element visibility settings
Return type: void - partId (
setNodeMatrix
setNodePointColor
setNodePointHighlighted
-
Model.
setNodePointHighlighted
(partId, pointId, highlighted) Arguments: - partId (
number()
) – None - pointId (
number()
) – the point Id that is the target of this operation. - highlighted (
boolean()
) – value indicating whether the supplied point element should be 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.
Return type: Promise <void> - partId (
setNodePointVisibility
-
Model.
setNodePointVisibility
(partId, pointId, visibility) Arguments: - partId (
number()
) – 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
Sets the visibility for a point element. This visibility setting will take precedence over other element visibility settings
Return type: void - partId (
setNodesAmbientColor
setNodesAmbientMix
-
Model.
setNodesAmbientMix
(nodeIds, value) Arguments: - nodeIds (
[number]()
) – IDs of nodes whose color to set - value (
number()
) – the decimal value to set, between 0 and 1
Sets the ambient mix on the faces for a given list of nodes. The mix is between the material ambient light and the global ambient light, with 1.0 representing full material ambient mix and 0.0 representing full global ambient light.
Return type: void - nodeIds (
setNodesColors
-
Model.
setNodesColors
(colorMap, alsoApplyToWireframe, alsoApplyToPoints) Arguments: - colorMap (
Map <number, Color> | IdColorMap()
) – None - alsoApplyToWireframe (
boolean()
) – change or not lines color - alsoApplyToPoints (
boolean()
) – change or not points color
Sets colors for a given set of nodes.
Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - colorMap (
setNodesCullingVector
-
Model.
setNodesCullingVector
(nodeIds, space, vector, toleranceDegrees) Arguments: - nodeIds (
[number]()
) – None - space (
CullingVectorSpace()
) – The space in which the culling vector is defined. - vector (
Point3()
) – A vector that will be compared with the view vector. - toleranceDegrees (
number()
) – The maximum angle between the culling vector and the view vector within which the object will be visible.
Sets a vector and angle used to determine an object’s visibility based on camera orientation.
Return type: Promise <void> - nodeIds (
setNodesFaceColor
setNodesFaceEmissiveColor
setNodesFaceSpecularColor
setNodesFaceSpecularIntensity
-
Model.
setNodesFaceSpecularIntensity
(nodeIds, value) Arguments: - nodeIds (
[number]()
) – IDs of nodes whose color to set - value (
number()
) – the value to set
Sets the specular intensity on the faces for a given list of nodes.
Return type: void - nodeIds (
setNodesHighlighted
-
Model.
setNodesHighlighted
(partIds, highlighted) Arguments: - partIds (
[number]()
) – None - highlighted (
boolean()
) – value indicating whether the supplied nodes should be 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.
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]].)Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - partIds (
setNodesLineColor
setNodesLinePattern
-
Model.
setNodesLinePattern
(nodeIds, pattern, patternLength, patternLengthUnit) Arguments: - nodeIds (
[number]()
) – The IDs of the nodes. - pattern (
LinePattern()
) – The line pattern. See [[LinePattern]] for details. - patternLength (
number()
) – The length of a single repetition of the line pattern. - patternLengthUnit (
LinePatternLengthUnit()
) – The unit in which the length of the pattern is measured. See [[LinePatternLengthUnit]] for details.
Applies the given line pattern to the specified nodes. See also [[unsetNodesLinePattern]].
Return type: void - nodeIds (
setNodesOpacities
-
Model.
setNodesOpacities
(params) Arguments: - params (
Map <number, number> | IdNumberMap()
) – 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.
Sets opacity for a given set of nodes.
Return type: void - params (
setNodesOpacity
-
Model.
setNodesOpacity
(nodeIds, opacity) Arguments: - nodeIds (
[number]()
) – 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.
Sets opacity for a given list of nodes.
Return type: void - nodeIds (
setNodesPointColor
setNodesTexture
-
Model.
setNodesTexture
(nodeIds, options) Arguments: - nodeIds (
[number]()
) – The nodes on which to apply the texture - options (
TextureOptions()
) – Options specifying how the texture is applied
Apply an image to a node as a texture map. See [[createImage]] and [[unsetNodesTexture]].
Return type: Promise <void> - nodeIds (
setNodesVisibilities
-
Model.
setNodesVisibilities
(mapping, initiallyHiddenStayHidden) Arguments: - mapping (
Map <number, boolean> | IdBooleanMap()
) – The mapping of node IDs to boolean value indicating the visibility setting for that node. - initiallyHiddenStayHidden (
null | boolean()
) – Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].
Sets the visibility for a given set of nodes.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> - mapping (
setNodesVisibility
-
Model.
setNodesVisibility
(nodeIds, visibility, initiallyHiddenStayHidden) Arguments: - nodeIds (
[number]()
) – The node IDs whose visibilities will be set. - visibility (
boolean()
) – If true, nodes will be shown. If false, they will be hidden. - initiallyHiddenStayHidden (
null | boolean()
) – Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].
Sets visibility for a given list of nodes.
Returns: Promise that resolves when the operation has completed. Return type: Promise <void> - nodeIds (
setPart
-
Model.
setPart
(assemblyNodeId, partNodeId) Arguments: - assemblyNodeId (
undefined | null | number()
) – None - partNodeId (
undefined | null | number()
) – None
Set a part on an assembly node
Returns: true if all went right, false otherwise Return type: boolean - assemblyNodeId (
setPhysicalProperties
-
Model.
setPhysicalProperties
(nodeId, gravityCenter, surfaceArea, volume) Arguments: - nodeId (
number()
) – None - gravityCenter (
Point3()
) – None - surfaceArea (
number()
) – None - volume (
number()
) – None
Purpose: Sets physical properties
Param: nodeId node id to set the property on, the node id has to be a body node Param: gravityCenter gravity center in local coordinates Param: surfaceArea surface area, in squared current unit Param: volume volume, in cubed current unit Returns: true if all went right, false otherwise Return type: boolean - nodeId (
setPmiColor
setPmiColorOverride
-
Model.
setPmiColorOverride
(enableOverride[, rootId]) Arguments: - enableOverride (
boolean()
) – None - rootId (
number()
) – optional None
Takes a boolean value and either enables the set PMI override color or resets all PMI colors to their default
Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - enableOverride (
setViewAxes
switchToModel
-
Model.
switchToModel
(newModelFilename) Arguments: - newModelFilename (
string()
) – Name of the model file to load after the existing scene gets deleted
Delete all the current scene and load the specified model instead. Also triggers a “modelSwitched” when finished.
Returns: A Promise
of the newly loaded model’s root nodes IDs.Return type: Promise <[number]> - newModelFilename (
triangulatePolygon
-
Model.
triangulatePolygon
(polygonPoints, normal) Arguments: - polygonPoints (
Float32Array | [number]()
) – An array of point data for the polygon. Points are stored [XYZXYZXYZ…] format. - normal (
Point3()
) – The normal of the polygon to triangulate.
Triangulates the supplied polygon.
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). Return type: Float32Array - polygonPoints (
unsetDepthRange
-
Model.
unsetDepthRange
(nodeIds) Arguments: - nodeIds (
[number]()
) – the node IDs to operate on
Unsets the depth range set by [[setDepthRange]].
Return type: void - nodeIds (
unsetMetallicRoughness
-
Model.
unsetMetallicRoughness
(nodeIds) Arguments: - nodeIds (
[number]()
) – List of nodes to unset material properties for
Unsets the metallic and roughness values set with [[setMetallicRoughness]] These materials will no longer use the Metallic Roughness shading model.
Return type: void - nodeIds (
unsetNodeFaceColor
-
Model.
unsetNodeFaceColor
(partId, faceId) Arguments: - partId (
number()
) – None - faceId (
number()
) – the Id of the face in the node that will have its color unset
Unsets the color for a face element. This will return the face’s color to its default state.
Return type: Promise <void> - partId (
unsetNodeLineColor
-
Model.
unsetNodeLineColor
(partId, lineId) Arguments: - partId (
number()
) – None - lineId (
number()
) – the Id of the line in the node that will have its color unset
Unsets the color for a line element. This will return the line’s color to its default state.
Return type: Promise <void> - partId (
unsetNodePointColor
-
Model.
unsetNodePointColor
(partId, pointId) Arguments: - partId (
number()
) – the Id of the node containing the point - pointId (
number()
) – the Id of the point in the node that will have its color unset
Unsets the color for a point element. This will return the point’s color to its default state.
Return type: void - partId (
unsetNodesCullingVectors
-
Model.
unsetNodesCullingVectors
(nodeIds) Arguments: - nodeIds (
[number]()
) – The nodes to unset culling vectors on.
Unsets the vector and angle used to determine an object’s visibility based on camera orientation.
Return type: Promise <void> - nodeIds (
unsetNodesFaceColor
-
Model.
unsetNodesFaceColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes to modify
Unsets the color on the faces for a given list of nodes.
Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - nodeIds (
unsetNodesFaceEmissiveColor
-
Model.
unsetNodesFaceEmissiveColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes whose color to reset
Resets the emissive color on the faces for a given list of nodes.
Return type: void - nodeIds (
unsetNodesFaceSpecularColor
-
Model.
unsetNodesFaceSpecularColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes whose color to reset
Resets the specular color on the faces for a given list of nodes.
Return type: void - nodeIds (
unsetNodesFaceSpecularIntensity
-
Model.
unsetNodesFaceSpecularIntensity
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes whose color to set
Resets the specular intensity on the faces for a given list of nodes.
Return type: void - nodeIds (
unsetNodesLineColor
-
Model.
unsetNodesLineColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes to modify
Unsets the color on the lines for a given list of nodes.
Returns: Promise that resolves when this operation has completed. Return type: Promise <void> - nodeIds (
unsetNodesLinePattern
-
Model.
unsetNodesLinePattern
(nodeIds) Arguments: - nodeIds (
[number]()
) – The IDs of the nodes.
Removes the line pattern applied by [[setNodesLinePattern]].
Return type: void - nodeIds (
unsetNodesPointColor
-
Model.
unsetNodesPointColor
(nodeIds) Arguments: - nodeIds (
[number]()
) – IDs of nodes to modify
Unsets the color on the points for a given list of nodes.
Return type: void - nodeIds (