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.
Index
Methods
activateCadConfigurationactivateCadViewactivateDefaultCadConfigurationactivateDefaultCadViewaddPropertyToNodecadConfigurationsEnabledclearclearNodeFaceVisibilityclearNodeLineVisibilityclearNodePointVisibilitycomputeMinimumBodyBodyDistancecomputeMinimumFaceFaceDistancecomputeMinimumFaceLineDistancecomputeMinimumFaceRayDistancecreateAndAddRepresentationItemcreateCadViewcreateImagecreateMeshcreateMeshInstancecreateNodecreatePartcreatePmiInstancedeleteImagesdeleteMeshesdeleteMeshInstancesdeleteNodegetAbsoluteRootNodegetActiveCadConfigurationgetAssociatedModelKeygetBimIdConnectedElementsgetBimIdFromNodegetBimIdRelatedElementsgetBimIdRelatingElementsgetBimIdsFromGenericIdgetBimInfoFromBimIdgetBranchVisibilitygetCadConfigurationsgetCadViewConfigurationgetCadViewMapgetCadViewPmisgetDataFromIdsgetDefaultCadConfigurationgetDefaultCadViewgetEdgeAttributesgetEdgeCountgetEdgePropertygetFaceAttributesgetFaceCountgetFacePropertygetFilterNamegetFiltersgetFiltersWithNodegetGenericIdFromBimIdgetGenericTypeIdMapgetGenericTypesgetLayerIdsFromNamegetLayerNamegetLayersgetLooseBoundinggetLowestAvailableNodeIdgetMeshIdsgetMetallicRoughnessgetModelBoundinggetModelFileNameFromNodegetModelFileTypeFromNodegetNodeCappingMeshDatagetNodeChildrengetNodeColorMapgetNodeEffectiveFaceColorgetNodeEffectiveLineColorgetNodeEffectivePointColorgetNodeExchangeIdgetNodeFaceColorgetNodeFaceHighlightedgetNodeGenericIdgetNodeGenericTypegetNodeIdFromBimIdgetNodeIdFromScInstanceKeygetNodeIdOffsetgetNodeIdsByGenericIdsgetNodeLayerIdgetNodeLineColorgetNodeLineHighlightedgetNodeMatrixgetNodeMeshDatagetNodeNamegetNodeNetMatrixgetNodeParentgetNodePointColorgetNodePointHighlightedgetNodePropertiesgetNodeRealBoundinggetNodesAmbientColorgetNodesBoundinggetNodesByGenericTypegetNodesCappingMeshDatagetNodesCullingVectorsgetNodesDrawModegetNodesEffectiveAmbientColorgetNodesEffectiveEmissiveColorgetNodesEffectiveFaceColorgetNodesEffectiveLineColorgetNodesEffectiveOpacitygetNodesEffectivePointColorgetNodesEffectiveSpecularColorgetNodesFaceColorgetNodesFaceEmissiveColorgetNodesFaceSpecularColorgetNodesFromFiltersIdgetNodesFromLayergetNodesFromLayerNamegetNodesFromLayersgetNodesHaveTransparencygetNodesHighlightedgetNodesInstancingSamePartgetNodesLineColorgetNodesMaterialgetNodesOpacitygetNodesPointColorgetNodeTypegetNodeUnitMultipliergetNodeUserDatagetNodeUserDataIndicesgetNodeVisibilitygetOutOfHierarchygetPmiColorgetPmiColorOverridegetPmisgetPmiSubtypegetPmiTopologyReferencesgetPmiTypegetPointAttributesgetRelationshipTypesFromBimIdgetScInstanceKeygetUniqueLayerNamesgetViewAxesgetVisibilityStatehasDepthRangehasEffectiveGenericTypeisAnnotationViewisCombineStateViewisDrawingisFaceMeasurableisLineMeasurableisMeasurableisNodeLoadedisWithinExternalModelloadMeasurementFromFileloadMeasurementFromJsonloadMeasurementFromStringloadSubtreeFromModelloadSubtreeFromScsBufferloadSubtreeFromScsFileloadSubtreeFromScsXmlBufferloadSubtreeFromScsXmlFileloadSubtreeFromXmlBufferloadSubtreeFromXmlFileregisterBimNodesregisterIfcNodesreplaceMeshrequestNodesresetresetModelHighlightresetModelOpacityresetNodeMatrixToInitialresetNodesColorresetNodesMaterialresetNodesOpacityresetNodesTransformresetNodesVisibilitysetBehaviorInitiallyHiddensetBodyNodesVisibilitysetDepthRangesetEdgePropertysetEnableAutomaticUnitScalingsetFacePropertysetInstanceModifiersetMeshLevelsetMetallicRoughnesssetNodeFaceColorsetNodeFaceHighlightedsetNodeFaceVisibilitysetNodeLineColorsetNodeLineHighlightedsetNodeLineVisibilitysetNodeMatrixsetNodePointColorsetNodePointHighlightedsetNodePointVisibilitysetNodesAmbientColorsetNodesAmbientMixsetNodesColorssetNodesCullingVectorsetNodesDrawModessetNodesFaceColorsetNodesFaceEmissiveColorsetNodesFaceSpecularColorsetNodesFaceSpecularIntensitysetNodesHighlightedsetNodesLineColorsetNodesLinePatternsetNodesMaterialsetNodesOpacitiessetNodesOpacitysetNodesPointColorsetNodesTexturesetNodesVisibilitiessetNodesVisibilitysetPartsetPhysicalPropertiessetPmiColorsetPmiColorOverridesetViewAxesswitchToModeltriangulatePolygonunsetDepthRangeunsetMetallicRoughnessunsetNodeFaceColorunsetNodeLineColorunsetNodePointColorunsetNodesAmbientColorunsetNodesCullingVectorsunsetNodesFaceColorunsetNodesFaceEmissiveColorunsetNodesFaceSpecularColorunsetNodesFaceSpecularIntensityunsetNodesLineColorunsetNodesLinePatternunsetNodesPointColorunsetNodesTextureviewAxesHaveBeenSet
Methods
-
Model.activateCadConfiguration() - activateCadConfiguration(nodeId: number, view:
IView?): PromiseActivates a CAD configuration
Parameters
nodeId: number
view:
IView= …View to set the CAD Configuration in. Visibility will be applied to all views. Uses default view if not specified.Returns: Promise
None.
-
Model.activateCadView() - activateCadView(nodeId: number, duration: number?, massageCamera: boolean?, view:
IView?): PromiseActivates a CAD View
Parameters
nodeId: number
duration: number = DefaultTransitionDuration
camera transition time in milliseconds.massageCamera: boolean = true
If true, undesirable authored cameras may be modified into a camera with more reasonable valuesview:
IView= …View to activate the CAD View in. Visibility will be applied to all views. Uses default view if not specified.Returns: Promise
None.
-
Model.activateDefaultCadConfiguration() - activateDefaultCadConfiguration(fitNodes: boolean?, view:
IView?): PromiseActivates Default CAD configuration
Parameters
fitNodes: boolean = true
Fit view to visible nodes if possible (default true)view:
IView= …View to set the CAD Configuration in. Visibility will be applied to all views. Uses default view if not specified.Returns: Promise
None.
-
Model.activateDefaultCadView() - activateDefaultCadView(duration: number?, massageCamera: boolean?, view:
IView?): PromiseActivate the default CAD view
Parameters
duration: number = DefaultTransitionDuration
Duration of the camera animationmassageCamera: boolean = true
If true, undesirable authored cameras may be modified into a camera with more reasonable valuesview:
IView= …View to set the CAD View in. Visibility will be applied to all views. Uses default view if not specified.Returns: Promise
None.
-
Model.addPropertyToNode() - addPropertyToNode(nodeId: number, propertyName: string, propertyValue: string, propertyUnit:
UnitElement[]): booleanPurpose: Adds a property to the node
Parameters
Returns: boolean
true if all went right, false otherwise
-
Model.cadConfigurationsEnabled() - cadConfigurationsEnabled(): Promise
Gets whether or not cad configurations are enabled
Returns: Promise
Boolean indicating whether or not cad configurations are enabled
-
Model.clear() - clear(): Promise
Remove all nodes, CAD views, configurations, and sheets from the model.
If you intend to load additional models via the
loadSubtreefamily of methods, you should wait on the resolution of this promise before doing so.Returns: Promise
-
Model.clearNodeFaceVisibility() - clearNodeFaceVisibility(partId: number): void
Clears the visibility for a node’s face elements, resetting them to default.
Parameters
partId: number
the Id of the part to be resetReturns: void
-
Model.clearNodeLineVisibility() - clearNodeLineVisibility(partId: number): void
Clears the visibility for a node’s line elements, resetting them to default.
Parameters
partId: number
the Id of the part to clear visibilities fromReturns: void
-
Model.clearNodePointVisibility() - clearNodePointVisibility(partId: number): void
Clears the visibility for a node’s point elements, resetting it to default.
Parameters
partId: number
the Id of the part to clear visibilities fromReturns: void
-
Model.computeMinimumBodyBodyDistance() - computeMinimumBodyBodyDistance(partId1: number, partId2: number): Promise
Computes the distance between two bodies
Parameters
partId1: number
id for the part which the first face belongs topartId2: number
id for the part which the second face belongs toReturns: Promise
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
-
Model.computeMinimumFaceFaceDistance() - computeMinimumFaceFaceDistance(partId1: number, faceId1: number, partId2: number, faceId2: number): Promise
Computes the distance between two faces
Parameters
partId1: number
id for the part which the first face belongs tofaceId1: number
id for the face in the first partpartId2: number
id for the part which the second face belongs tofaceId2: number
id for the face in the second partReturns: Promise
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
-
Model.computeMinimumFaceLineDistance() - computeMinimumFaceLineDistance(partId: number, faceId: number, ray:
Ray): PromiseComputers the minimum distance between a face and an infinite line.
Parameters
partId: number
faceId: number
id of the face in the noderay:
Raythe line (in the form of a ray) to test againstReturns: Promise
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
-
Model.computeMinimumFaceRayDistance() - computeMinimumFaceRayDistance(partId: number, faceId: number, ray:
Ray): PromiseComputers the minimum distance between a face and a ray.
Parameters
Returns: Promise
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
-
Model.createAndAddRepresentationItem() - createAndAddRepresentationItem(partNodeId: (undefined | None | number), repItemId: (None | number)): (None | number)
Creates a representation item on a part
Parameters
partNodeId: (undefined | None | number)
ID of the part noderepItemId: (None | number)
(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.Returns: (None | number)
node ID to access the created representation item, null is returned if something went wrong
-
Model.createCadView() - createCadView(nodeId: number, viewName: string, camera:
Camera, pmiIds: (None | number[]), nodesToShow: (None | number[]), nodesToHide: (None | number[]), nodeIdsAndLocalTransforms: (None | [number,Matrix][]), cuttingPlane: (None |Plane), meshInstanceData: (None |MeshInstanceData)): (None | number)Creates a CAD view. This method will trigger a “cadViewCreated” callback if the creation is successful.
Parameters
nodeId: number
viewName: string
Name of the viewcamera:
CameraCamera that will be set when the view gets activatedpmiIds: (None | number[])
(optional, if undefined or null no change applied to pmis) Node IDs of the PMI to show for the view others will be hiddennodesToShow: (None | number[])
(optional, pass null or empty array if none to send) Node IDs of the elements to force visibility onnodesToHide: (None | number[])
(optional, pass null or empty array if none to send) Node IDs of the elements to force visibility offnodeIdsAndLocalTransforms: (None | [number,
Matrix][])(optional, pass null or empty array if none to send) array of node ID and matrix pair, defining specific local transform to applycuttingPlane: (None |
Plane)(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: (None |
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)Returns: (None | number)
id of the view, null is returned if the function fails
-
Model.createImage() - createImage(primaryImage:
ImageOptions, thumbnailImage:ImageOptions): PromiseCreates an image that can be applied as a texture via [[setNodesTexture]]. See [[deleteImages]].
Parameters
primaryImage:
ImageOptionsThe image data and associated optionsthumbnailImage:
ImageOptionsIf specified, an uncompressed image that will be used as a placeholder for the primary image until it is fully loaded. Only useful whenprimaryImageis a compressed image.Returns: Promise
-
Model.createMesh() - createMesh(meshData:
MeshData, config: { doNotDelete: boolean }): PromiseParameters
meshData:
MeshData[[MeshData]] object containing data to insert into the scene.config: { doNotDelete: boolean }
Returns: Promise
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]].
-
Model.createMeshInstance() - createMeshInstance(data:
MeshInstanceData, parentNodeId: (None | number), preventFromResetting: (None | boolean), isOutOfHierarchy: (None | boolean)): PromiseCreates an instance of a mesh that has been created using [[createMesh]] or retrieved using [[getMeshIds]].
Parameters
data:
MeshInstanceDataobject that specifies the data for this mesh instanceparentNodeId: (None | number)
the ID of the desired parent nodepreventFromResetting: (None | boolean)
if set to true, then the visibility and positioning won’t be reset when resetxxx() functions gets called.isOutOfHierarchy: (None | boolean)
True if the node created shouldn’t appear in the model structure.Returns: Promise
Promise that resolves with a node ID that can be used to perform operations on this instance.
-
Model.createNode() - createNode(parentNodeId: (undefined | None | number), nodeName: string, nodeId: (None | number), localMatrix: (None |
Matrix), visibility: (None | boolean), measurementUnit: (None | number)): numberCreates a node
Parameters
parentNodeId: (undefined | None | 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
nodeId: (None | number)
localMatrix: (None |
Matrix)(optional) Initial local matrix of the node (identity if none set)visibility: (None | boolean)
(optional) Initial visibility of the node (visible if nothing set)measurementUnit: (None | number)
Returns: number
child node ID
-
Model.createPart() - createPart(nodeId: (None | number)): number
Creates an part node
Parameters
nodeId: (None | number)Returns: number
a node ID to access the created part node
-
Model.createPmiInstance() - createPmiInstance(data:
MeshInstanceData, pmiType:PmiType, pmiSubType:PmiSubType, refOnTopoItems:RefOnTopoItem[], parentNodeId: (None | number)): PromiseCreates a PMI Instance from a mesh that has been created using the createMesh method.
Parameters
data:
MeshInstanceDataobject that specifies the data for the PMI graphic representationpmiType:
PmiTypesee PmiType enum (Datum, Gdt, Dimension…)pmiSubType:
PmiSubTypesee PmiSubType enum (DatumTarget, GdtFcf, DimensionDistance…)refOnTopoItems:
RefOnTopoItem[]see RefOnTopoItem. It defines the PMI links to a body element, like a face or an edgeparentNodeId: (None | number)
the ID of the desired parent nodeReturns: Promise
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
-
Model.deleteImages() - deleteImages(imageIds:
ImageId[]): PromiseDeletes images created with [[createImage]].
Parameters
imageIds:
ImageId[]The IDs of the images to be deletedReturns: Promise
-
Model.deleteMeshes() - deleteMeshes(ids:
MeshId[]): PromiseDeletes 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]].
Parameters
ids:MeshId[]Returns: Promise
Promise that resolves when this operation has completed.
-
Model.deleteMeshInstances() - deleteMeshInstances(nodeIds: number[]): Promise
Deletes mesh instances that have been created at run time
Parameters
nodeIds: number[]
array of IDs for mesh instances created at run time that should be destroyedReturns: Promise
Promise that resolves when this operation has completed.
-
Model.deleteNode() - deleteNode(nodeId: number): Promise
Delete a node and all its children
Parameters
nodeId: numberReturns: Promise
-
Model.getAbsoluteRootNode() - getAbsoluteRootNode(): number
Returns the absolute root node of the assembly tree.
Returns: number
Id for the model tree root node or null if the model structure is not loaded.
-
Model.getActiveCadConfiguration() - getActiveCadConfiguration(): (None | number)
Gets Active CAD configuration
Returns: (None | number)
ID of activated CAD Configuration
-
Model.getAssociatedModelKey() - getAssociatedModelKey(nodeId: number): Promise
Parameters
nodeId: numberReturns: Promise
-
Model.getBimIdConnectedElements() - getBimIdConnectedElements(node: number, bimId: string, type:
RelationshipType): { relateds: string[], relatings: string[] }Retrieve all relationships that a bim id have, sorted in 2 arrays (relateds and relatings)
Parameters
node: number
any known node id of the working model.bimId: string
bim id for which you want its relationships.type:
RelationshipTypeReturns: { relateds: string[], relatings: string[] }
double array of bim id of relationship of the BimId sorted by its relateds and its relatings.
-
Model.getBimIdFromNode() - getBimIdFromNode(node: number): (None | string)
Retrieves the bim id of the corresponding node id.
Parameters
node: number
the id of the node for which you want its bim id.Returns: (None | string)
the bim id corresponding to the node or null if none.
-
Model.getBimIdRelatedElements() - getBimIdRelatedElements(node: number, bimId: string, type:
RelationshipType): string[]Retrieve all related relationships that a bim id have.
Parameters
node: number
any known node id of the working model.bimId: string
bim id for which you want its related relationships.type:
RelationshipTypeReturns: string[]
array of bim id which are the related relationship of the BimId.
-
Model.getBimIdRelatingElements() - getBimIdRelatingElements(node: number, bimId: string, type:
RelationshipType): string[]Retrieve all relating relationships that a bim id have.
Parameters
node: number
any known node id of the working model.bimId: string
bim id for which you want its relating relationships.type:
RelationshipTypeReturns: string[]
array of bim id which are the relating relationship of the BimId.
-
Model.getBimIdsFromGenericId() - getBimIdsFromGenericId(ifcGuid: string): string[]
Retrieves the bim ids of the corresponding generic id.
Parameters
ifcGuid: string
the generic id for which you want its bim id.Returns: string[]
the bim id corresponding to the ifcGuid or null if none.
-
Model.getBimInfoFromBimId() - getBimInfoFromBimId(node: number, bimId: string): { connected: boolean, name: string }
Retrieve the name of the bim element
Parameters
node: number
any known node id of the working model.bimId: string
bim id for which you want the bim element name.Returns: { connected: boolean, name: string }
the name and the info regarding the connection to a node of the bim element.
-
Model.getBranchVisibility() - getBranchVisibility(nodeId: number):
BranchVisibilityBranch visibility indicates the visibility state for all of a node’s children.
Parameters
nodeId: number
ID of the node at the root of the branch.Returns:
BranchVisibilityShown/Hidden if all children have the same visibility state, Mixed otherwise.
-
Model.getCadConfigurations() - getCadConfigurations():
IdStringMapGets CAD configurations
Returns:
IdStringMapan object mapping CAD configuration ID to config name
-
Model.getCadViewConfiguration() - getCadViewConfiguration(cadViewNodeId: number): (None | number)
Get the configuration in which the view is defined
Parameters
cadViewNodeId: numberReturns: (None | number)
ID of CAD Configuration of the view
-
Model.getCadViewMap() - getCadViewMap(): Map
Gets CAD View information for this model.
Returns: Map
a map mapping associating CAD View ID to name
-
Model.getCadViewPmis() - getCadViewPmis(nodeId: number): number[]
Get PMI IDs for a CAD View
Parameters
nodeId: numberReturns: number[]
IDs of visible PMIs for the view
-
Model.getDataFromIds() - getDataFromIds(ids:
DataIds): PromiseReturns 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.
Parameters
ids:DataIdsReturns: Promise
promise that resolves when this operation has completed returning an array of 8bits int arrays for each ModelKey-DataKey pairs
-
Model.getDefaultCadConfiguration() - getDefaultCadConfiguration(): (None | number)
Gets CAD default configuration
Returns: (None | number)
ID of default CAD Configuration
-
Model.getDefaultCadView() - getDefaultCadView(): (None | number)
Gets CAD default view
Returns: (None | number)
ID of default CAD Configuration
-
Model.getEdgeAttributes() - getEdgeAttributes(nodeId: number, edgeIndex: number): Promise
Returns edge attributes for a node of the given node and edge.
Parameters
nodeId: number
Node to retrieve edge properties fromedgeIndex: number
Index of edge for which to retrieve edge attributesReturns: Promise
Promise for the requested edge attributes. Properties returned will be null if none associated with the edge.
-
Model.getEdgeCount() - getEdgeCount(nodeId: number): Promise
Returns edge count for a node of the given node.
Parameters
nodeId: number
Node to retrieve edge count fromReturns: Promise
Promise providing the number of edges
-
Model.getEdgeProperty() - getEdgeProperty(nodeId: number, edgeId: number): Promise
Returns edge properties for a node of the given node and edge.
Parameters
nodeId: number
Node to retrieve edge properties fromedgeId: number
Returns: Promise
Promise for the requested edge properties. Properties returned will be null if none associated with the edge.
-
Model.getFaceAttributes() - getFaceAttributes(nodeId: number, faceIndex: number): Promise
Returns face attributes for a node of the given node and face.
Parameters
nodeId: number
Node to retrieve edge properties fromfaceIndex: number
Index of face for which to retrieve face attributesReturns: Promise
Promise for the requested face attributes. Properties returned will be null if none associated with the edge.
-
Model.getFaceCount() - getFaceCount(nodeId: number): Promise
Returns face count for a node of the given node and face.
Parameters
nodeId: number
Node to retrieve face count fromReturns: Promise
Promise providing the number of faces
-
Model.getFaceProperty() - getFaceProperty(nodeId: number, faceId: number): Promise
Returns Face properties for a node of the given node and face.
Parameters
nodeId: number
Node to retrieve face properties fromfaceId: number
Returns: Promise
Promise for the requested face properties. Properties returned will be null if none associated with the face.
-
Model.getFilterName() - getFilterName(filterId:
FilterId): (None | string)Parameters
filterId:FilterIdReturns: (None | string)
The name of a filter for the given filter ID index or null if filter was not found
-
Model.getFilters() - getFilters(): Map
Returns names and ids of all filters available in the scene
Returns: Map
a map associating Filter IDs to filter names
-
Model.getFiltersWithNode() - getFiltersWithNode(nodeIdSearched: number):
FilterId[]Parameters
nodeIdSearched: numberReturns:
FilterId[]Filters which retain or remove the given node.
-
Model.getGenericIdFromBimId() - getGenericIdFromBimId(node: number, bimId: string): (None | string)
Retrieves the generic id of the corresponding bim id.
Parameters
node: number
any known node id of the working model.bimId: string
bim id for which you want its generic id.Returns: (None | string)
the generic id corresponding to the BimId or null if none.
-
Model.getGenericTypeIdMap() - getGenericTypeIdMap(): Map
Gets all generic types and NodeIds with that type.
Returns: Map
Map containing generic types and NodeIds
-
Model.getGenericTypes() - getGenericTypes(): string[]
This function gets all generic types contained in the model.
Returns: string[]
All generic types.
-
Model.getLayerIdsFromName() - getLayerIdsFromName(name: string): (None |
LayerId[])Parameters
name: stringReturns: (None |
LayerId[])Id of layers for the given filter name or null if no layers are found
-
Model.getLayerName() - getLayerName(layerId:
LayerId): (None | string)Parameters
layerId:LayerIdReturns: (None | string)
The name of a layer for the given filter ID or null if layer was not found
-
Model.getLayers() - getLayers(): Map
Returns names and ids of all layers available in the scene
Returns: Map
a map associating Layer IDs to Layer names
-
Model.getLooseBounding() - getLooseBounding(): Promise
Gets the world space bounding box for the model. This does not take node visibility into account.
Returns: Promise
Promise that resolves with a Box representing the world space bounding box of the model.
-
Model.getLowestAvailableNodeId() - getLowestAvailableNodeId(): number
Returns the lowest available node ID
Returns: number
-
Model.getMeshIds() - getMeshIds(nodeIds: number[]): Promise
Retrieve the [[MeshId]] associated with the mesh data attached to the given nodes.
Parameters
nodeIds: number[]Returns: Promise
-
Model.getMetallicRoughness() - getMetallicRoughness(nodeIds: number[]): Promise
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
Parameters
nodeIds: number[]
List of nodes to get material properties forReturns: Promise
-
Model.getModelBounding() - getModelBounding(ignoreInvisible: boolean, includeExcluded: boolean, tightBounding: boolean?): Promise
Gets the world space bounding box for the model.
Parameters
ignoreInvisible: boolean
includeExcluded: boolean
tightBounding: boolean = false
Returns: Promise
Promise that resolves with a Box representing the world space bounding box of the model.
-
Model.getModelFileNameFromNode() - getModelFileNameFromNode(nodeId: number): (None | string)
Parameters
nodeId: numberReturns: (None | string)
the original file name of the model which contain the given node or null if the node is not found.
-
Model.getModelFileTypeFromNode() - getModelFileTypeFromNode(nodeId: number): (None |
FileType)Parameters
nodeId: numberReturns: (None |
FileType)the original file type of the model which contain the given node or null if the node is not found.
-
Model.getNodeCappingMeshData() - getNodeCappingMeshData(nodeId: number): Promise
Fetch the mesh data for any capping geometry on a particular node
Parameters
nodeId: numberReturns: Promise
-
Model.getNodeChildren() - getNodeChildren(nodeId: number, includeOutOfHierarchy: boolean): number[]
Returns IDs for child nodes for the given Id.
Parameters
nodeId: number
includeOutOfHierarchy: boolean
true to include Out Of Hierarchy node, false or null to exclude themReturns: number[]
ID for the children of this node, or null if the ID is invalid
-
Model.getNodeColorMap() - getNodeColorMap(startNodeId: number, elementType:
ElementType): PromiseGets a map associating NodeIds to colors that are set on those nodes. Only NodeIds of nodes that have a color set will be included.
Parameters
startNodeId: number
The start node to walk when building the color map.elementType:
ElementTypeReturned colors are of this element type.Returns: Promise
-
Model.getNodeEffectiveFaceColor() - getNodeEffectiveFaceColor(partId: number, faceIndex: number, view:
IView): PromiseGets 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.
Parameters
partId: number
faceIndex: number
the index of the face in the nodeview:
IViewthe View to use when calculating view effectsReturns: Promise
-
Model.getNodeEffectiveLineColor() - getNodeEffectiveLineColor(partId: number, lineIndex: number, view:
IView): PromiseGets 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.
Parameters
partId: number
lineIndex: number
the index of the line in the nodeview:
IViewthe View to use when calculating view effectsReturns: Promise
-
Model.getNodeEffectivePointColor() - getNodeEffectivePointColor(partId: number, pointIndex: number, view:
IView): PromiseGets 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.
Parameters
partId: number
pointIndex: number
the index of the point in the nodeview:
IViewthe View to use for calculating view effectsReturns: Promise
-
Model.getNodeExchangeId() - getNodeExchangeId(nodeId: number): (None | string)
Returns the Exchange ID of a node in the assembly tree.
Parameters
nodeId: number
The node ID to get the Exchange ID from.Returns: (None | string)
The Exchange ID of the node with the given nodeId or null if no Exchange ID is found.
-
Model.getNodeFaceColor() - getNodeFaceColor(partId: number, faceIndex: number): Promise
Gets the color set via [[setNodeFaceColor]] on a face element. If no color has been set,
nullwill be returned. <br><br> See also: [[getNodeEffectiveFaceColor]]Parameters
partId: number
faceIndex: number
the index of the face in the nodeReturns: Promise
-
Model.getNodeFaceHighlighted() - getNodeFaceHighlighted(nodeId: number, faceIndex: number): Promise
Returns whether the supplied face element has been highlighted with [[setNodeFaceHighlighted]].
Parameters
nodeId: number
the ID of the node containing the face elementfaceIndex: number
the index of the face within the nodeReturns: Promise
-
Model.getNodeGenericId() - getNodeGenericId(nodeId: number): (None | string)
Parameters
nodeId: numberReturns: (None | string)
the generic id of the given node or null if the node is not found.
-
Model.getNodeGenericType() - getNodeGenericType(nodeId: number): (None | string)
Parameters
nodeId: numberReturns: (None | string)
the generic type of the given node or null if the node is not found.
-
Model.getNodeIdFromBimId() - getNodeIdFromBimId(node: number, bimID: string): (None | number)
Retrieves the node id of the corresponding bim id.
Parameters
node: number
any known node id of the working model.bimID: string
bim id for which you want its node id.Returns: (None | number)
the node id corresponding to the BimId or null if none.
-
Model.getNodeIdFromScInstanceKey() - getNodeIdFromScInstanceKey(inclusionKey:
InclusionKey, instanceKey:InstanceKey): (None | number)Returns the body node instance ID for the given SC instance ID
Parameters
inclusionKey:
InclusionKeyinstanceKey:
InstanceKeyReturns: (None | number)
body node instance ID
-
Model.getNodeIdOffset() - getNodeIdOffset(nodeId: number): number
Retrieves the node ID offset for a given node.
Parameters
nodeId: number
The node to obtain the node ID offset from.Returns: number
The node ID offset for the supplied node.
-
Model.getNodeIdsByGenericIds() - getNodeIdsByGenericIds(genericIds: string[]): number[]
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.
Parameters
genericIds: string[]
Array of generic IDs to find nodes foreReturns: number[]
Array of node ids corresponding to the provided generic IDs
-
Model.getNodeLayerId() - getNodeLayerId(nodeId: number): (None |
LayerId)Returns the layer ID of a node in the assembly tree.
Parameters
nodeId: number
The node ID to get the Exchange ID from.Returns: (None |
LayerId)The layer ID of the node with the given nodeId or null if no layer is found.
-
Model.getNodeLineColor() - getNodeLineColor(partId: number, lineIndex: number): Promise
Gets the color set via [[setNodeLineColor]] on a line element. If no color has been set,
nullwill be returned.Parameters
partId: number
lineIndex: number
the index of the line in the nodeReturns: Promise
-
Model.getNodeLineHighlighted() - getNodeLineHighlighted(nodeId: number, lineIndex: number): Promise
Returns whether the supplied line element has been highlighted with [[setNodeLineHighlighted]].
Parameters
nodeId: number
the ID of the node containing the line elementlineIndex: number
the index of the line within the nodeReturns: Promise
-
Model.getNodeMatrix() - getNodeMatrix(nodeId: number):
MatrixReturns a copy of the Matrix for a node of the given ID
Parameters
nodeId: numberReturns:
MatrixCopy of the Matrix of the node
-
Model.getNodeMeshData() - getNodeMeshData(nodeId: number): Promise
Fetch the mesh data for a particular node
Parameters
nodeId: number
the node’s IDReturns: Promise
-
Model.getNodeName() - getNodeName(nodeId: number): (None | string)
Returns the name for a node in the assembly tree.
Parameters
nodeId: number
The node ID to get the name of.Returns: (None | string)
The name of the node with the given nodeId or null if no name is found.
-
Model.getNodeNetMatrix() - getNodeNetMatrix(nodeId: number):
MatrixReturns net matrix for a node of the given ID
Parameters
nodeId: numberReturns:
MatrixNet Matrix of the Node
-
Model.getNodeParent() - getNodeParent(nodeId: number): (None | number)
Returns the parent Id for the given node id.
Parameters
nodeId: numberReturns: (None | number)
ID of the parent node for the supplied ID. If the ID is invalid or the root ID, null is returned.
-
Model.getNodePointColor() - getNodePointColor(partId: number, pointIndex: number): Promise
Gets the color set via [[setNodePointColor]] on a point element. If no color has been set,
nullwill be returned. <br><br> See also: [[getNodeEffectivePointColor]]Parameters
partId: number
pointIndex: number
the index of the point in the nodeReturns: Promise
-
Model.getNodePointHighlighted() - getNodePointHighlighted(nodeId: number, pointIndex: number): Promise
Returns whether the supplied point element has been highlighted with [[setNodePointHighlighted]].
Parameters
nodeId: number
the ID of the node containing the point elementpointIndex: number
the index of the point within the nodeReturns: Promise
-
Model.getNodeProperties() - getNodeProperties(nodeId: number, computeFromChildren: boolean?): Promise
Returns the properties for the given node ID.
Parameters
nodeId: number
computeFromChildren: boolean = true
If true physical properties will be computed from child nodes.Returns: Promise
object properties for the supplied ID, or null if the ID was invalid
-
Model.getNodeRealBounding() - getNodeRealBounding(nodeId: number, view:
IView): PromiseGets 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.
Parameters
nodeId: number
ID of the node for which you wish to get the bounding box.view:
IViewView to use for determining visibility.Returns: Promise
Promise that resolves with the world space bounding box for the given ID.
-
Model.getNodesAmbientColor() - getNodesAmbientColor(nodeIds: number[]): Promise
Gets the ambient color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to getReturns: Promise
-
Model.getNodesBounding() - getNodesBounding(nodeIds: number[], config:
GetNodesBoundingConfig): PromiseGets the world space bounding box for a list of nodes.
Parameters
nodeIds: number[]
IDs of the nodes for which you wish to get the bounding box.config:
GetNodesBoundingConfigAllows fine control of what body types to compute the bounding against. If not provided, all body types are considered.Returns: Promise
Promise that resolves with the world space bounding box for the given IDs.
-
Model.getNodesByGenericType() - getNodesByGenericType(genericType: string): (None | Set)
This function returns all NodeIds with an IFC type.
Parameters
genericType: stringReturns: (None | Set)
All NodeIds with an IFC type
-
Model.getNodesCappingMeshData() - getNodesCappingMeshData(nodeIds: number[]): Promise
Fetch the mesh data for any capping geometry on a list of nodes and their children
Parameters
nodeIds: number[]
the node IDs to get capping data from.Returns: Promise
-
Model.getNodesCullingVectors() - getNodesCullingVectors(nodeIds: number[]): Promise
Retrieves the vector and angle used to determine an object’s visibility based on camera orientation. If unset,
nullwill appear at the corresponding array index.Parameters
nodeIds: number[]
The nodes to query culling vectors from.Returns: Promise
A promise of culling vectors.
-
Model.getNodesDrawMode() - getNodesDrawMode(nodeIds: number[]): Record
Get overridden draw mode for the given node ids. Only leaf nodes attached to a body are considered. Other wont be in the returned record.
Parameters
nodeIds: number[]
The node ids to get the draw mode from.Returns: Record
A record mapping node ids to their overridden draw modes.
-
Model.getNodesEffectiveAmbientColor() - getNodesEffectiveAmbientColor(nodeIds: number[]): Promise
Gets the ambient 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.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesEffectiveEmissiveColor() - getNodesEffectiveEmissiveColor(nodeIds: number[]): Promise
Gets the emissive 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.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesEffectiveFaceColor() - getNodesEffectiveFaceColor(nodeIds: number[]): Promise
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.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesEffectiveLineColor() - getNodesEffectiveLineColor(nodeIds: number[]): Promise
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.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesEffectiveOpacity() - getNodesEffectiveOpacity(leafNodes: number[], elementType:
ElementType): PromiseGets 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.
Parameters
Returns: Promise
-
Model.getNodesEffectivePointColor() - getNodesEffectivePointColor(nodeIds: number[]): Promise
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.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesEffectiveSpecularColor() - getNodesEffectiveSpecularColor(nodeIds: number[]): Promise
Gets the specular 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.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesFaceColor() - getNodesFaceColor(nodeIds: number[]): Promise
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,
nullwill appear at the corresponding position in the returned array. <br><br> See also: [[getNodesEffectiveFaceColor]]Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesFaceEmissiveColor() - getNodesFaceEmissiveColor(nodeIds: number[]): Promise
Gets the emissive color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to getReturns: Promise
-
Model.getNodesFaceSpecularColor() - getNodesFaceSpecularColor(nodeIds: number[]): Promise
Gets the specular color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to getReturns: Promise
-
Model.getNodesFromFiltersId() - getNodesFromFiltersId(filtersId:
FilterId[]): (None |FilteredNodes)Parameters
filtersId:
FilterId[]array of filters indexes to take in accountReturns: (None |
FilteredNodes)nodesId of nodes retained by the given filter indices and the type of filter (inclusive or not). Returns null if no filter is found.
-
Model.getNodesFromLayer() - getNodesFromLayer(layerId:
LayerId, onlyTreeNodes: boolean): (None | number[])Returns IDs of nodes in the given layer.
Parameters
layerId:
LayerIdThe layer ID to get nodes from.onlyTreeNodes: boolean
if true return only nodes present in model TreeReturns: (None | number[])
An array of nodes Id of nodes with the given layerId or null if no layers are found.
-
Model.getNodesFromLayerName() - getNodesFromLayerName(layerName: string, onlyTreeNodes: boolean): (None | number[])
Returns IDs of nodes in the given layer.
Parameters
layerName: string
onlyTreeNodes: boolean
if true return only nodes present in model TreeReturns: (None | number[])
An array of nodes Id of nodes with the given layerName or null if no layers are found.
-
Model.getNodesFromLayers() - getNodesFromLayers(layersId:
LayerId[], onlyTreeNodes: boolean): (None | number[])Returns IDs of nodes in given layers.
Parameters
layersId:
LayerId[]Array of layers Id to get nodes from.onlyTreeNodes: boolean
if true return only nodes present in model TreeReturns: (None | number[])
An array of nodes Id of nodes with one of the given layerId or null if no layers are found.
-
Model.getNodesHaveTransparency() - getNodesHaveTransparency(nodeIds: number[]): Promise
Returns whether nodes with the given NodeIds have an opacity value that is not fully opaque.
Parameters
nodeIds: number[]
IDs of nodes to query.Returns: Promise
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.
-
Model.getNodesHighlighted() - getNodesHighlighted(partIds: number[]): Promise
Returns whether the supplied nodes have been highlighted with [[setNodesHighlighted]].
Parameters
partIds: number[]Returns: Promise
-
Model.getNodesInstancingSamePart() - getNodesInstancingSamePart(nodeId: number): Promise
Returns IDs of nodes who instance the same part as the supplied node. This method should be called on nodes whose type is
PartInstance.Parameters
nodeId: numberReturns: Promise
Array containingPartInstancenode IDs. These nodes all instance the same part as the supplied node. If this method is called on a node which is not of typePartInstancethennullwill be returned.
-
Model.getNodesLineColor() - getNodesLineColor(nodeIds: number[]): Promise
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,
nullwill appear at the corresponding position in the returned array.Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodesMaterial() - getNodesMaterial(nodeIds: number[]): Promise
Gets the material properties of a node. This will combine material properties set at runtime with authored material properties to return the complete current material.
Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
Promise that resolves with an array of material properties for each node
-
Model.getNodesOpacity() - getNodesOpacity(leafNodes: number[]): Promise
Gets the opacity set via [[setNodesOpacity]] on a list of leaf nodes. If no value has been set for a particular node,
nullwill appear at the corresponding position in the returned array.Parameters
leafNodes: number[]Returns: Promise
-
Model.getNodesPointColor() - getNodesPointColor(nodeIds: number[]): Promise
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,
nullwill appear at the corresponding position in the returned array. <br><br> See also: [[getNodesEffectivePointColor]]Parameters
nodeIds: number[]
IDs of the nodes to be queriedReturns: Promise
-
Model.getNodeType() - getNodeType(nodeId: number):
NodeTypeReturns the type of the node with the given ID.
Parameters
nodeId: numberReturns:
NodeTypeThe type of the node.
-
Model.getNodeUnitMultiplier() - getNodeUnitMultiplier(nodeId: number): number
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.Parameters
nodeId: numberReturns: number
The unit multiplier for the model (in mm)
-
Model.getNodeUserData() - getNodeUserData(nodeId: number, index:
UserDataIndex): Uint8ArrayReturns the user data for a given node and index.
Parameters
Returns: Uint8Array
The user data.
-
Model.getNodeUserDataIndices() - getNodeUserDataIndices(nodeId: number):
UserDataIndex[]Returns all the
UserDataIndexitems associated with the input node.Parameters
nodeId: number
The ID of the node to query.Returns:
UserDataIndex[]A list ofUserDataIndex, possibly empty.
-
Model.getNodeVisibility() - getNodeVisibility(nodeId: number): boolean
Returns the current visibility for a node.
Parameters
nodeId: number
ID of the node to get visibility for.Returns: boolean
true if the current node’s visibility state is on or false if it is not.
-
Model.getOutOfHierarchy() - getOutOfHierarchy(nodeId: number): boolean
Returns “Out Of Hierarchy” status for child node for the given Id.
Parameters
nodeId: numberReturns: boolean
false if node is Out Of Hierarchy, true if it is
-
Model.getPmiColor() - getPmiColor():
ColorReturns the set PMI override color (if none is set, defaults to black)
Returns:
Colorcolor
-
Model.getPmiColorOverride() - getPmiColorOverride(): boolean
Returns: boolean
a boolean value indicating the status of the PMI override color.
-
Model.getPmis() - getPmis():
IdStringMapReturns names and ids of all the PMIs available in the scene
Returns:
IdStringMapa map associating PMI IDs to PMI names
-
Model.getPmiSubtype() - getPmiSubtype(pmiId: number):
PmiSubTypeReturns the subtype of a given PMI
Parameters
pmiId: numberReturns:
PmiSubTypeSubtype of the PMI (Dimension distance, Datum target, GD&T fcf…)
-
Model.getPmiTopologyReferences() - getPmiTopologyReferences(pmiNodeId: number): (None |
RefOnTopoItem[])Gets an array of PMI topology references linking a PMI node to a body element, like a face or an edge.
Parameters
pmiNodeId: number
the ID of the PMI node.Returns: (None |
RefOnTopoItem[])
-
Model.getPmiType() - getPmiType(pmiId: number):
PmiTypeReturns the type of a given PMI
Parameters
pmiId: numberReturns:
PmiTypeType of the PMI (Dimension, Datum, GD&T…)
-
Model.getPointAttributes() - getPointAttributes(nodeId: number, pointIndex: number): Promise
Returns point attributes for a node of the given node and point.
Parameters
nodeId: number
Node to retrieve point properties frompointIndex: number
Index of point for which to retrieve point attributesReturns: Promise
Promise for the requested point attributes. Properties returned will be null if none associated with the point.
-
Model.getRelationshipTypesFromBimId() - getRelationshipTypesFromBimId(node: number, bimId: string):
RelationshipType[]Retrieves all type of relationships that a bim id has.
Parameters
node: number
any known node id of the working model.bimId: string
bim id for which you want its types of relationships.Returns:
RelationshipType[]array of type of relationship corresponding to the BimId.
-
Model.getScInstanceKey() - getScInstanceKey(nodeId: number): (None |
InstanceInc)Returns the SC ID of a body instance
Parameters
nodeId: number
node instance ID. This must be a body nodeReturns: (None |
InstanceInc)SC instance ID, a pair of numbers consisting of the inclusion ID and the instance ID. null is returned if the function fails.
-
Model.getUniqueLayerNames() - getUniqueLayerNames(): string[]
Return names of layers. Different layers can have the same name. Some layers can be unnamed.
Returns: string[]
Names of layers
-
Model.getViewAxes() - getViewAxes():
ViewAxesReturns:
ViewAxesthe up and front vectors for the model coordinate system.
-
Model.getVisibilityState() - getVisibilityState(startNodeId: number): Promise
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.
Parameters
startNodeId: numberReturns: Promise
-
Model.hasDepthRange() - hasDepthRange(nodeIds: number[]): Promise
Parameters
nodeIds: number[]Returns: Promise
-
Model.hasEffectiveGenericType() - hasEffectiveGenericType(nodeId: number, genericType: string): boolean
Checks if a [[NodeId]] is a generic type.
Parameters
nodeId: number
genericType: string
Returns: boolean
-
Model.isAnnotationView() - isAnnotationView(cadViewNodeId: number): boolean
Tells if the view is an annotation view or not
Parameters
cadViewNodeId: number
Node ID of the CAD viewReturns: boolean
true if the view is an annotation view
-
Model.isCombineStateView() - isCombineStateView(cadViewNodeId: number): boolean
Tells if the view is a combine state view or not
Parameters
cadViewNodeId: number
Node ID of the CAD viewReturns: boolean
true if the view is a combine state view
-
Model.isDrawing() - isDrawing(): boolean
Tells if the model is a CAD drawing or not
Returns: boolean
true if the model is a CAD drawing
-
Model.isFaceMeasurable() - isFaceMeasurable(bodyId: number, faceIndex: number): Promise
Parameters
bodyId: number
faceIndex: number
Returns: Promise
-
Model.isLineMeasurable() - isLineMeasurable(bodyId: number, lineIndex: number): Promise
Parameters
bodyId: number
ID of the body node containing the linelineIndex: number
Index of the line ot be checkedReturns: Promise
true if the line has associated measurement data
-
Model.isMeasurable() - isMeasurable(): boolean
Returns: boolean
true if the model contains measurement data.
-
Model.isNodeLoaded() - isNodeLoaded(nodeId: number): boolean
Queries if a node is fully loaded or not.
Parameters
nodeId: number
The node to query.Returns: boolean
True if the node is fully loaded; false otherwise.
-
Model.isWithinExternalModel() - isWithinExternalModel(nodeId: number): boolean
Returns true if the node is within an external model.
Parameters
nodeId: numberReturns: boolean
-
Model.loadMeasurementFromFile() - loadMeasurementFromFile(filename: string): Promise
Loads measurement data from a ZIP file
Parameters
filename: string
Name of a file containing ZIP measurement dataReturns: Promise
-
Model.loadMeasurementFromJson() - loadMeasurementFromJson(json: any): Promise
Loads measurement data from a JSON object
Parameters
json: any
JSON object containing measurement dataReturns: Promise
-
Model.loadMeasurementFromString() - loadMeasurementFromString(str: string): Promise
Loads measurement data from a JSON string
Parameters
str: string
JSON string containing measurement dataReturns: Promise
-
Model.loadSubtreeFromModel() - loadSubtreeFromModel(nodeId: number, modelName: string, config:
LoadSubtreeConfig): PromiseLoads the tree stored in a model file and query loading of required meshes
Parameters
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:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.loadSubtreeFromModel(nodeId: number, modelName: string, additionalMatrix: (None |Matrix)): PromiseLoads the tree stored in a model file and query loading of required meshes
Parameters
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: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.
-
Model.loadSubtreeFromScsBuffer() - loadSubtreeFromScsBuffer(nodeId: number, buffer:
ScsBuffer, config:LoadSubtreeConfig): PromiseLoads the tree stored in a model file and query loading of required meshes
Parameters
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:
ScsBufferThe SCS buffer to load.config:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.Loads the tree stored in a model file and query loading of required meshes
Parameters
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:
ScsBufferThe SCS buffer to load.additionalMatrix: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.
-
Model.loadSubtreeFromScsFile() - loadSubtreeFromScsFile(nodeId: number, scsFilename: string, config:
LoadSubtreeConfig): PromiseLoads the tree stored in a model file and query loading of required meshes
Parameters
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:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.loadSubtreeFromScsFile(nodeId: number, scsFilename: string, additionalMatrix: (None |Matrix)): PromiseLoads the tree stored in a model file and query loading of required meshes
Parameters
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: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.
-
Model.loadSubtreeFromScsXmlBuffer() - loadSubtreeFromScsXmlBuffer(nodeId: number, xmlData: (string | Document), modelNameToScs: (None |
ModelNameToScsFileFunc), config:LoadSubtreeConfig): PromiseLoads 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.
Parameters
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: (None |
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:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.loadSubtreeFromScsXmlBuffer(nodeId: number, xmlData: (string | Document), modelNameToScs: (None |ModelNameToScsFileFunc), additionalMatrix: (None |Matrix), allowMissingExternalModels: boolean): PromiseLoads 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.
Parameters
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: (None |
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.additionalMatrix: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.allowMissingExternalModels: boolean
Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.
-
Model.loadSubtreeFromScsXmlFile() - loadSubtreeFromScsXmlFile(nodeId: number, xmlFilename: string, modelNameToScs: (None |
ModelNameToScsFileFunc), config:LoadSubtreeConfig): PromiseLoads 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.
Parameters
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: (None |
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:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.loadSubtreeFromScsXmlFile(nodeId: number, xmlFilename: string, modelNameToScs: (None |ModelNameToScsFileFunc), additionalMatrix: (None |Matrix), allowMissingExternalModels: boolean): PromiseLoads 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.
Parameters
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: (None |
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.additionalMatrix: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.allowMissingExternalModels: boolean
Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.
-
Model.loadSubtreeFromXmlBuffer() - loadSubtreeFromXmlBuffer(nodeId: number, xmlData: (string | Document), massageModelName: (None |
MassageModelNameFunc), config:LoadSubtreeConfig): PromiseLoads the tree stored in the XML and query loading of required meshes
Parameters
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: (None |
MassageModelNameFunc)Optional callback to massage model names within the XML file. Return null to skip the model.config:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.loadSubtreeFromXmlBuffer(nodeId: number, xmlData: (string | Document), massageModelName: (None |MassageModelNameFunc), additionalMatrix: (None |Matrix), allowMissingExternalModels: boolean): PromiseLoads the tree stored in the XML and query loading of required meshes
Parameters
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: (None |
MassageModelNameFunc)Optional callback to massage model names within the XML file. Return null to skip the model.additionalMatrix: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.allowMissingExternalModels: boolean
Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.
-
Model.loadSubtreeFromXmlFile() - loadSubtreeFromXmlFile(nodeId: number, xmlFilename: string, massageModelName: (None |
MassageModelNameFunc), config:LoadSubtreeConfig): PromiseLoads the tree stored in the XML and query loading of required meshes
Parameters
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: (None |
MassageModelNameFunc)Optional callback to massage model names within the XML file. Return null to skip the model.config:
LoadSubtreeConfigConfiguration to control load behavior.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.loadSubtreeFromXmlFile(nodeId: number, xmlFilename: string, massageModelName: (None |MassageModelNameFunc), additionalMatrix: (None |Matrix), allowMissingExternalModels: boolean): PromiseLoads the tree stored in the XML and query loading of required meshes
Parameters
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: (None |
MassageModelNameFunc)Optional callback to massage model names within the XML file. Return null to skip the model.additionalMatrix: (None |
Matrix)Optional matrix to get multiplied into the net attachment matrix.allowMissingExternalModels: boolean
Optional boolean to control whether or not missing models in the XML file are ignored or cause an error.Returns: Promise
APromiseof the newly loaded model’s root nodes IDs.
-
Model.registerBimNodes() - registerBimNodes(startNodeId: number, attributeToMask: (value: string) =>
BimMask, legacy_useAttributeTitle: (None | string | boolean)?): PromiseThis function recursively discovers BIM nodes in the supplied subtree and registers them.
Parameters
startNodeId: number
The root of the subtree to walk for registration.attributeToMask: (value: string) =>
BimMaskThe callback used to obtain a node’s [[BimMask]] from its attributes.legacy_useAttributeTitle: (None | string | boolean) = null
Returns: Promise
Promise that resolves when the operation has completed.
-
Model.registerIfcNodes() - registerIfcNodes(startNodeId: number, legacy_useAttributeTitle: (None | string | boolean)?): Promise
This function recursively discovers IFC nodes in the supplied subtree and registers them.
Parameters
startNodeId: number
The root of the subtree to walk for registration.legacy_useAttributeTitle: (None | string | boolean) = null
Returns: Promise
Promise that resolves when the operation has completed.
-
Model.replaceMesh() -
Replace a mesh’s data. This will affect all instances of that mesh.
Parameters
Returns: Promise
-
Model.requestNodes() - requestNodes(nodeIds: number[]): Promise
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.
Parameters
nodeIds: number[]
array of unique IDs for the system to loadReturns: Promise
-
Model.reset() - reset(): Promise
Resets the state of the model to its default
Returns: Promise
Promise that resolves when the operation has completed.
-
Model.resetModelHighlight() - resetModelHighlight(): Promise
Resets highlight for all nodes in the model.
Returns: Promise
Promise that resolves when this operation has completed.
-
Model.resetModelOpacity() - resetModelOpacity(): void
Resets opacity for all nodes in the model.
Returns: void
Promise that resolves when this operation has completed.
-
Model.resetNodeMatrixToInitial() - resetNodeMatrixToInitial(nodeId: number): Promise
Reset node matrix to the one set as the initial one
Parameters
nodeId: numberReturns: Promise
-
Model.resetNodesColor() - resetNodesColor(): Promise
Resets color for all nodes in the model.
Returns: Promise
Promise that resolves when this operation has completed.
-
Model.resetNodesMaterial() - resetNodesMaterial(nodeIds: number[], params: keyof
IMaterial[]): voidResets material properties for a given list of nodes to their default values.
Parameters
nodeIds: number[]
IDs of nodes whose material properties to resetparams: keyof
IMaterial[]optional array of specific material parameters to reset. If not provided, all material properties will be reset.Returns: void
-
Model.resetNodesOpacity() - resetNodesOpacity(nodeIds: number[]): void
Resets opacity for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose opacity will be reset to their default valuesReturns: void
-
Model.resetNodesTransform() - resetNodesTransform(): Promise
Resets transform for all nodes in the model.
Returns: Promise
Promise that resolves when the operation has completed.
-
Model.resetNodesVisibility() - resetNodesVisibility(): Promise
Resets visibility for all nodes in the model.
Returns: Promise
Promise that resolves when the operation has completed.
-
Model.setBehaviorInitiallyHidden() - setBehaviorInitiallyHidden(enabled: boolean): void
By default, objects that are initially hidden stays hidden unless specifically set to be shown. This function allows this behavior to be disabled.
Parameters
enabled: boolean
value indicating if initially hidden objects stay hiddenReturns: void
-
Model.setBodyNodesVisibility() - setBodyNodesVisibility(startNodeId: number, visibility: boolean): Promise
Sets the visibility of all body nodes starting from a given node.
Parameters
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.Returns: Promise
Promise that resolves when the operation has completed.setBodyNodesVisibility(startNodeId: number, visibilityFormatter: (node: number) => (undefined | boolean)): PromiseSets the visibility of all body nodes starting from a given node.
Parameters
startNodeId: number
The start node to walk when updating body nodes visibility.visibilityFormatter: (node: number) => (undefined | boolean)
A function that returns the visibility for a given node idReturns: Promise
Promise that resolves when the operation has completed.
-
Model.setDepthRange() - setDepthRange(nodeIds: number[], min: number, max: number): Promise
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 tominand 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.
Parameters
nodeIds: number[]
the node IDs to operate onmin: number
the depth value at the near planemax: number
the depth value at the far planeReturns: Promise
-
Model.setEdgeProperty() - setEdgeProperty(nodeId: number, edgeId: number, prop: Base): void
Set edge property for a node of the given node and edge.
Parameters
nodeId: number
edgeId: number
prop: Base
property (CircleElement, LineElement…)Returns: void
-
Model.setEnableAutomaticUnitScaling() - setEnableAutomaticUnitScaling(enabled: boolean): void
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.
Parameters
enabled: boolean
value indicating if automatic unit scaling will be activeReturns: void
-
Model.setFaceProperty() - setFaceProperty(nodeId: number, faceId: number, prop: Base): void
Set face property for a node of the given node and face.
Parameters
nodeId: number
faceId: number
prop: Base
property (CylinderElement, PlaneElement…)Returns: void
-
Model.setInstanceModifier() - setInstanceModifier(instanceModifier:
InstanceModifier, nodeIds: number[], value: boolean): PromiseAllows changing the behavior in the viewer
Parameters
instanceModifier:
InstanceModifierInstanceModifiernodeIds: number[]
Array of node idsvalue: boolean
booleanReturns: Promise
-
Model.setMeshLevel() - setMeshLevel(nodeIds: number[], meshLevel: number): Promise
Sets the desired mesh level
Parameters
nodeIds: number[]
IDs of nodes in the assembly on which mesh level will be setmeshLevel: number
0 standard, 1 low, 2 extra lowReturns: Promise
Promise that resolves when the operation has completed.
-
Model.setMetallicRoughness() - setMetallicRoughness(nodeIds: number[], metallicFactor: number, roughnessFactor: number): void
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.
Parameters
nodeIds: number[]
List of nodes to set material properties formetallicFactor: number
The metalness of the materialroughnessFactor: number
The roughness of the materialReturns: void
-
Model.setNodeFaceColor() - setNodeFaceColor(partId: number, faceId: number, color:
Color): PromiseSets the color for a face element. This color will take precedence over any currently set color on the node
Parameters
partId: number
faceId: number
the Id of the face in the node that will have its color setcolor:
Colorthe color to setReturns: Promise
-
Model.setNodeFaceHighlighted() - setNodeFaceHighlighted(nodeId: number, faceId: number, highlighted: boolean): Promise
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.
Parameters
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.Returns: Promise
-
Model.setNodeFaceVisibility() - setNodeFaceVisibility(partId: number, faceId: number, visibility: boolean): void
Sets the visibility for a face element. This visibility setting will take precedence over other element visibility settings
Parameters
partId: number
the Id of the part containing the facefaceId: number
the Id of the face in the node that will have its visibility setvisibility: boolean
visibility state to be setReturns: void
-
Model.setNodeLineColor() - setNodeLineColor(partId: number, lineId: number, color:
Color): PromiseSets the color for a line element.
Parameters
partId: number
lineId: number
the Id of the line in the node that will have its color set.color:
Colorthe color to set.Returns: Promise
-
Model.setNodeLineHighlighted() - setNodeLineHighlighted(partId: number, lineId: number, highlighted: boolean): Promise
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.
Parameters
partId: number
lineId: number
the line Id that is the target of this operation.highlighted: boolean
value indicating whether the supplied line element should be highlighted.Returns: Promise
-
Model.setNodeLineVisibility() - setNodeLineVisibility(partId: number, lineId: number, visibility: boolean): void
Sets the visibility for a line element. This visibility setting will take precedence over other element visibility settings
Parameters
partId: number
the Id of the part containing the linelineId: number
the Id of the line in the node that will have its visibility setvisibility: boolean
visibility state to be setReturns: void
-
Model.setNodeMatrix() - setNodeMatrix(nodeId: number, matrix:
Matrix, setAsInitial: boolean?): PromiseSets Matrix for a node of the given ID
Parameters
nodeId: number
matrix:
MatrixsetAsInitial: boolean = false
tells if you want to change the node initial matrix or notReturns: Promise
-
Model.setNodePointColor() - setNodePointColor(partId: number, pointId: number, color:
Color): voidSets the color for a point element.
Parameters
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 set.color:
Colorthe color to set.Returns: void
-
Model.setNodePointHighlighted() - setNodePointHighlighted(partId: number, pointId: number, highlighted: boolean): Promise
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.
Parameters
partId: number
pointId: number
the point Id that is the target of this operation.highlighted: boolean
value indicating whether the supplied point element should be highlighted.Returns: Promise
-
Model.setNodePointVisibility() - setNodePointVisibility(partId: number, pointId: number, visibility: boolean): void
Sets the visibility for a point element. This visibility setting will take precedence over other element visibility settings
Parameters
partId: number
the Id of the part containing the pointpointId: number
the Id of the point in the node that will have its visibility setvisibility: boolean
visibility state to be setReturns: void
-
Model.setNodesAmbientColor() - setNodesAmbientColor(nodeIds: number[], color:
Color): voidSets the ambient color on the faces for a given list of nodes.
Parameters
Returns: void
-
Model.setNodesAmbientMix() - setNodesAmbientMix(nodeIds: number[], value: number): void
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.
Parameters
nodeIds: number[]
IDs of nodes whose color to setvalue: number
the decimal value to set, between 0 and 1Returns: void
-
Model.setNodesColors() - setNodesColors(colorMap: (Map |
IdColorMap), alsoApplyToWireframe: boolean?, alsoApplyToPoints: boolean?): PromiseSets colors for a given set of nodes.
Parameters
colorMap: (Map |
IdColorMap)alsoApplyToWireframe: boolean = false
change or not lines coloralsoApplyToPoints: boolean = false
change or not points colorReturns: Promise
Promise that resolves when this operation has completed.
-
Model.setNodesCullingVector() - setNodesCullingVector(nodeIds: number[], space:
CullingVectorSpace, vector:Point3, toleranceDegrees: number): PromiseSets a vector and angle used to determine an object’s visibility based on camera orientation.
Parameters
nodeIds: number[]
space:
CullingVectorSpaceThe space in which the culling vector is defined.vector:
Point3A 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.Returns: Promise
-
Model.setNodesDrawModes() - setNodesDrawModes(nodesDrawModes: Record): void
Set the draw modes for the given node ids. Given nodes will be drawn according to their specified draw modes, overriding draw mode of the view. Only leaf nodes attached to a body can have overriden draw mode. If other nodes are passed, the draw mode will be applied recursively to the children and grand children which are attached to a body.
Parameters
nodesDrawModes: Record
A record mapping node ids to their desired draw modes.Returns: void
-
Model.setNodesFaceColor() - setNodesFaceColor(nodeIds: number[], color:
Color): PromiseSets the color on the faces for a given list of nodes.
Parameters
Returns: Promise
Promise that resolves when this operation has completed.
-
Model.setNodesFaceEmissiveColor() - setNodesFaceEmissiveColor(nodeIds: number[], color:
Color): voidSets the emissive color on the faces for a given list of nodes.
Parameters
Returns: void
-
Model.setNodesFaceSpecularColor() - setNodesFaceSpecularColor(nodeIds: number[], color:
Color): voidSets the specular color on the faces for a given list of nodes.
Parameters
Returns: void
-
Model.setNodesFaceSpecularIntensity() - setNodesFaceSpecularIntensity(nodeIds: number[], value: number): void
Sets the specular intensity on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to setvalue: number
the value to setReturns: void
-
Model.setNodesHighlighted() - setNodesHighlighted(partIds: number[], highlighted: boolean): Promise
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,
hwvis your instance of [[WebViewer]].)Parameters
partIds: number[]
highlighted: boolean
value indicating whether the supplied nodes should be highlighted.Returns: Promise
Promise that resolves when this operation has completed.
-
Model.setNodesLineColor() - setNodesLineColor(nodeIds: number[], color:
Color): PromiseSets the color on the lines/edges for a given list of nodes.
Parameters
Returns: Promise
Promise that resolves when this operation has completed.
-
Model.setNodesLinePattern() - setNodesLinePattern(nodeIds: number[], pattern:
LinePattern, patternLength: number, patternLengthUnit:LinePatternLengthUnit): voidApplies the given line pattern to the specified nodes. See also [[unsetNodesLinePattern]].
Parameters
nodeIds: number[]
The IDs of the nodes.pattern:
LinePatternThe line pattern. See [[LinePattern]] for details.patternLength: number
The length of a single repetition of the line pattern.patternLengthUnit:
LinePatternLengthUnitThe unit in which the length of the pattern is measured. See [[LinePatternLengthUnit]] for details.Returns: void
-
Model.setNodesMaterial() - setNodesMaterial(nodeIds: number[], material:
IMaterial): voidSets material properties for a given list of nodes. Any properties not defined in the provided material will be left as-is.
Parameters
nodeIds: number[]
IDs of nodes whose material properties to setmaterial:
IMaterialthe material properties to applyReturns: void
-
Model.setNodesOpacities() - setNodesOpacities(params: (Map |
IdNumberMap)): voidSets opacity for a given set of nodes.
Parameters
params: (Map |
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.Returns: void
-
Model.setNodesOpacity() - setNodesOpacity(nodeIds: number[], opacity: number): void
Sets opacity for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose opacity will be setopacity: 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.Returns: void
-
Model.setNodesPointColor() - setNodesPointColor(nodeIds: number[], color:
Color): voidSets the color on the points for a given list of nodes.
Parameters
Returns: void
Promise that resolves when this operation has completed.
-
Model.setNodesTexture() - setNodesTexture(nodeIds: number[], options:
TextureOptions): PromiseApply an image to a node as a texture map. See [[createImage]] and [[unsetNodesTexture]].
Parameters
nodeIds: number[]
The nodes on which to apply the textureoptions:
TextureOptionsOptions specifying how the texture is appliedReturns: Promise
-
Model.setNodesVisibilities() - setNodesVisibilities(mapping: (Map |
IdBooleanMap), initiallyHiddenStayHidden: (None | boolean)?): PromiseSets the visibility for a given set of nodes.
Parameters
mapping: (Map |
IdBooleanMap)The mapping of node IDs to boolean value indicating the visibility setting for that node.initiallyHiddenStayHidden: (None | boolean) = null
Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].Returns: Promise
Promise that resolves when the operation has completed.
-
Model.setNodesVisibility() - setNodesVisibility(nodeIds: number[], visibility: boolean, initiallyHiddenStayHidden: (None | boolean)?): Promise
Sets visibility for a given list of nodes.
Parameters
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: (None | boolean) = null
Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].Returns: Promise
Promise that resolves when the operation has completed.
-
Model.setPart() - setPart(assemblyNodeId: (undefined | None | number), partNodeId: (undefined | None | number)): boolean
Set a part on an assembly node
Parameters
assemblyNodeId: (undefined | None | number)
partNodeId: (undefined | None | number)
Returns: boolean
true if all went right, false otherwise
-
Model.setPhysicalProperties() - setPhysicalProperties(nodeId: number, gravityCenter:
Point3, surfaceArea: number, volume: number): booleanPurpose: Sets physical properties
Parameters
Returns: boolean
true if all went right, false otherwise
-
Model.setPmiColor() - setPmiColor(color:
Color): voidSaves a PMI override color
Parameters
color:
Colorthe override colorReturns: void
-
Model.setPmiColorOverride() - setPmiColorOverride(enableOverride: boolean, rootId: number): Promise
Takes a boolean value and either enables the set PMI override color or resets all PMI colors to their default
Parameters
enableOverride: boolean
rootId: number
Returns: Promise
Promise that resolves when this operation has completed.
-
Model.setViewAxes() -
Sets the up and front vectors for the model coordinate system. Both the upVector and frontVector must be unique, cardinal axes.
Parameters
Returns: void
-
Model.switchToModel() - switchToModel(newModelFilename: string): Promise
Delete all the current scene and load the specified model instead. Also triggers a “modelSwitched” when finished.
Parameters
newModelFilename: string
Name of the model file to load after the existing scene gets deletedReturns: Promise
APromiseof the newly loaded model’s root nodes IDs.
-
Model.triangulatePolygon() - triangulatePolygon(polygonPoints: (number[] | Float32Array), normal:
Point3): Float32ArrayTriangulates the supplied polygon.
Parameters
polygonPoints: (number[] | Float32Array)
An array of point data for the polygon. Points are stored [XYZXYZXYZ…] format.normal:
Point3The normal of the polygon to triangulate.Returns: Float32Array
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).
-
Model.unsetDepthRange() - unsetDepthRange(nodeIds: number[]): void
Unsets the depth range set by [[setDepthRange]].
Parameters
nodeIds: number[]
the node IDs to operate onReturns: void
-
Model.unsetMetallicRoughness() - unsetMetallicRoughness(nodeIds: number[]): void
Unsets the metallic and roughness values set with [[setMetallicRoughness]] These materials will no longer use the Metallic Roughness shading model.
Parameters
nodeIds: number[]
List of nodes to unset material properties forReturns: void
-
Model.unsetNodeFaceColor() - unsetNodeFaceColor(partId: number, faceId: number): Promise
Unsets the color for a face element. This will return the face’s color to its default state.
Parameters
partId: number
faceId: number
the Id of the face in the node that will have its color unsetReturns: Promise
-
Model.unsetNodeLineColor() - unsetNodeLineColor(partId: number, lineId: number): Promise
Unsets the color for a line element. This will return the line’s color to its default state.
Parameters
partId: number
lineId: number
the Id of the line in the node that will have its color unsetReturns: Promise
-
Model.unsetNodePointColor() - unsetNodePointColor(partId: number, pointId: number): void
Unsets the color for a point element. This will return the point’s color to its default state.
Parameters
partId: number
the Id of the node containing the pointpointId: number
the Id of the point in the node that will have its color unsetReturns: void
-
Model.unsetNodesAmbientColor() - unsetNodesAmbientColor(nodeIds: number[]): void
Unsets the ambient color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to unsetReturns: void
-
Model.unsetNodesCullingVectors() - unsetNodesCullingVectors(nodeIds: number[]): Promise
Unsets the vector and angle used to determine an object’s visibility based on camera orientation.
Parameters
nodeIds: number[]
The nodes to unset culling vectors on.Returns: Promise
-
Model.unsetNodesFaceColor() - unsetNodesFaceColor(nodeIds: number[]): Promise
Unsets the color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes to modifyReturns: Promise
Promise that resolves when this operation has completed.
-
Model.unsetNodesFaceEmissiveColor() - unsetNodesFaceEmissiveColor(nodeIds: number[]): void
Resets the emissive color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to resetReturns: void
-
Model.unsetNodesFaceSpecularColor() - unsetNodesFaceSpecularColor(nodeIds: number[]): void
Resets the specular color on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to resetReturns: void
-
Model.unsetNodesFaceSpecularIntensity() - unsetNodesFaceSpecularIntensity(nodeIds: number[]): void
Resets the specular intensity on the faces for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes whose color to setReturns: void
-
Model.unsetNodesLineColor() - unsetNodesLineColor(nodeIds: number[]): Promise
Unsets the color on the lines for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes to modifyReturns: Promise
Promise that resolves when this operation has completed.
-
Model.unsetNodesLinePattern() - unsetNodesLinePattern(nodeIds: number[]): void
Removes the line pattern applied by [[setNodesLinePattern]].
Parameters
nodeIds: number[]
The IDs of the nodes.Returns: void
-
Model.unsetNodesPointColor() - unsetNodesPointColor(nodeIds: number[]): void
Unsets the color on the points for a given list of nodes.
Parameters
nodeIds: number[]
IDs of nodes to modifyReturns: void
-
Model.unsetNodesTexture() - unsetNodesTexture(nodeIds: number[]): void
Remove one or more textures applied via [[setNodesTexture]].
Parameters
nodeIds: number[]
The nodes from which to remove the texture or texturesReturns: void
-
Model.viewAxesHaveBeenSet() - viewAxesHaveBeenSet(): boolean
Gets whether there has been a successful call to setViewAxes.
Returns: boolean