Model
Methods
Methods
activateCADConfiguration
activateCADDefaultConfiguration
- Model.activateCADDefaultConfiguration()
- Deprecated
Use
activateDefaultCadConfiguration
instead.- Return type
Promise <void>
activateCADView
activateCadConfiguration
activateCadView
- Model.activateCadView(nodeId[, duration[, massageCamera]])
Activates a CAD View
- Arguments
nodeId (NodeId) –
duration (
number()
) – optional camera transition time in milliseconds.massageCamera (
boolean()
) – optional If true, undesirable authored cameras may be modified into a camera with more reasonable values
- Return type
Promise <void>
- Returns
None.
activateDefaultCadConfiguration
- Model.activateDefaultCadConfiguration([fitNodes])
Activates Default CAD configuration
- Arguments
fitNodes (
boolean()
) – optional Fit view to visible nodes if possible (default true)
- Return type
Promise <void>
- Returns
None.
activateDefaultCadView
- Model.activateDefaultCadView([duration[, massageCamera]])
Activate the default CAD view
- Arguments
duration (
number()
) – optional Duration of the camera animationmassageCamera (
boolean()
) – optional If true, undesirable authored cameras may be modified into a camera with more reasonable values
- Return type
Promise <void>
- Returns
None.
addPropertyToNode
- Model.addPropertyToNode(nodeId, propertyName, propertyValue, propertyUnit)
Purpose: Adds a property to the node
- Arguments
nodeId (NodeId) – node id to set the property on
propertyName (
string()
) –propertyValue (
string()
) –propertyUnit ([
UnitElement()
]) –
- Return type
boolean
- Returns
true if all went right, false otherwise
cadConfigurationsEnabled
- Model.cadConfigurationsEnabled()
Gets whether or not cad configurations are enabled
- Return type
Promise <boolean>
- Returns
Boolean indicating whether or not cad configurations are enabled
clear
- 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>
If you intend to load additional models via the
loadSubtree
family of methods, you should wait on the resolution of this promise before doing so.
clearNodeFaceVisibility
clearNodeLineVisibility
clearNodePointVisibility
computeMinimumBodyBodyDistance
- Model.computeMinimumBodyBodyDistance(partId1, partId2)
Computes the distance between two bodies
- Arguments
- Return type
Promise <
FaceFaceDistanceItem()
>- Returns
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
computeMinimumFaceFaceDistance
- Model.computeMinimumFaceFaceDistance(partId1, faceId1, partId2, faceId2)
Computes the distance between two faces
- Arguments
- Return type
Promise <
FaceFaceDistanceItem()
>- Returns
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
computeMinimumFaceLineDistance
- Model.computeMinimumFaceLineDistance(partId, faceId, ray)
Computers the minimum distance between a face and an infinite line.
- Arguments
- Return type
Promise <
FaceFaceDistanceItem()
>- Returns
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
computeMinimumFaceRayDistance
- Model.computeMinimumFaceRayDistance(partId, faceId, ray)
Computers the minimum distance between a face and a ray.
- Arguments
- Return type
Promise <
FaceFaceDistanceItem()
>- Returns
a promise that resolves with a Markup.Measure.FaceFaceDistanceItem when the operation completes
createAndAddBody
createAndAddRepresentationItem
- Model.createAndAddRepresentationItem(partNodeId[, repItemId])
Creates a representation item on a part
- Arguments
partNodeId (PartId | undefined | null) – ID of the part node
repItemId (NodeId | null) – 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.
- Return type
NodeId | null
- Returns
node ID to access the created representation item, null is returned if something went wrong
createCADView
createCadView
- Model.createCadView(nodeId, viewName, camera[, pmiIds[, nodesToShow[, nodesToHide[, nodeIdsAndLocalTransforms[, cuttingPlane[, meshInstanceData]]]]]])
Creates a CAD view. This method will trigger a “cadViewCreated” callback if the creation is successful.
- Arguments
nodeId (NodeId) –
viewName (
string()
) – Name of the viewcamera (
Camera()
) – Camera that will be set when the view gets activatedpmiIds ([PmiId] | null) – optional (optional, pass null or empty array if none to send) Node IDs of the PMI to show for the view
nodesToShow ([NodeId] | null) – optional (optional, pass null or empty array if none to send) Node IDs of the elements to force visibility on
nodesToHide ([NodeId] | null) – optional (optional, pass null or empty array if none to send) Node IDs of the elements to force visibility off
nodeIdsAndLocalTransforms ([(NodeId,
Matrix()
)] | null) – optional (optional, pass null or empty array if none to send) array of node ID and matrix pair, defining specific local transform to applycuttingPlane (
Plane()
| null) – 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 (
MeshInstanceData()
| null) – 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)
- Return type
CadViewId | null
- Returns
id of the view, null is returned if the function fails
createImage
- Model.createImage(primaryImage[, thumbnailImage])
Creates an image that can be applied as a texture via
setNodesTexture
SeedeleteImages
- Arguments
primaryImage (
ImageOptions()
) – The image data and associated optionsthumbnailImage (
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.
- Return type
Promise <ImageId>
createMesh
- Model.createMesh(meshData[, config])
- Arguments
meshData (
MeshData()
) –MeshData
object containing data to insert into the scene.config (
function()
) – optional
- Return type
Promise <MeshId>
- Returns
Promise that resolves with a
MeshId
when the mesh has been created. TheMeshId
can be used to create instances of the mesh usingcreateMeshInstance
createMeshInstance
- Model.createMeshInstance(data[, parentNodeId[, preventFromResetting[, isOutOfHierarchy]]])
Creates an instance of a mesh that has been created using
createMesh
or retrieved usinggetMeshIds
- Arguments
data (
MeshInstanceData()
) – object that specifies the data for this mesh instanceparentNodeId (NodeId | null) – optional the ID of the desired parent node
preventFromResetting (
boolean | null()
) – optional if set to true, then the visibility and positioning won’t be reset when resetxxx() functions gets called.isOutOfHierarchy (
boolean | null()
) – optional True if the node created shouldn’t appear in the model structure.
- Return type
Promise <NodeId>
- Returns
Promise that resolves with a node ID that can be used to perform operations on this instance.
createNode
- Model.createNode(parentNodeId, nodeName[, nodeId[, localMatrix[, visibility[, measurementUnit]]]])
Creates a node
- Arguments
parentNodeId (NodeId | undefined | null) – ID of the node to link the child node to. This ID should not have a type of Body or BodyInstance. If this parameter is
undefined
, the child node will be linked to the root.nodeName (
string()
) –nodeId (NodeId | null) – optional
localMatrix (
Matrix()
| null) – optional (optional) Initial local matrix of the node (identity if none set)visibility (
boolean | null()
) – optional (optional) Initial visibility of the node (visible if nothing set)measurementUnit (
number | null()
) – optional
- Return type
- Returns
child node ID
createPMIInstance
- Model.createPMIInstance(data, pmiType, pmiSubType, refOnTopoItems[, parentNodeId])
- Deprecated
Use
createPmiInstance
instead.- Arguments
data (
MeshInstanceData()
) –pmiType (PmiType) –
pmiSubType (PmiSubType) –
refOnTopoItems ([
RefOnTopoItem()
]) –parentNodeId (NodeId) – optional
- Return type
Promise <PmiId>
createPart
createPmiInstance
- Model.createPmiInstance(data, pmiType, pmiSubType, refOnTopoItems[, parentNodeId])
Creates a PMI Instance from a mesh that has been created using the createMesh method.
- Arguments
data (
MeshInstanceData()
) – object that specifies the data for the PMI graphic representationpmiType (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 edgeparentNodeId (NodeId | null) – optional the ID of the desired parent node
- Return type
Promise <PmiId>
- Returns
Promise that resolves with a node ID that can be used to perform operations on this instance. You can use deleteMeshInstances() to delete the PMI
deleteImages
deleteMeshInstances
deleteMeshes
- Model.deleteMeshes(ids)
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
- Arguments
ids ([MeshId]) –
- Return type
Promise <void>
- Returns
Promise that resolves when this operation has completed.
In order for this method to succeed, all mesh instances created for the given IDs must have also been destroyed with
deleteMeshInstances
deleteNode
getAbsoluteRootNode
getActiveCadConfiguration
getAssociatedModelKey
getBimIdConnectedElements
- Model.getBimIdConnectedElements(node, bimId, type)
Retrieve all relationships that a bim id have, sorted in 2 arrays (relateds and relatings)
- Arguments
node (NodeId) – any known node id of the working model.
bimId (BimId) – bim id for which you want its relationships.
type (RelationshipType) –
- Return type
function
- Returns
double array of bim id of relationship of the BimId sorted by its relateds and its relatings.
getBimIdFromNode
getBimIdRelatingElements
- Model.getBimIdRelatingElements(node, bimId, type)
Retrieve all relating relationships that a bim id have.
- Arguments
node (NodeId) – any known node id of the working model.
bimId (BimId) – bim id for which you want its relating relationships.
type (RelationshipType) –
- Return type
[BimId]
- Returns
array of bim id which are the relating relationship of the BimId.
getBimIdsFromGenericId
getBimInfoFromBimId
- Model.getBimInfoFromBimId(node, bimId)
Retrieve the name of the bim element
getBranchVisibility
getCADActiveConfiguration
getCADConfigurations
- Model.getCADConfigurations()
- Deprecated
Use
getCadConfigurations
instead.- Return type
getCADDefaultConfiguration
getCADViewPMIs
getCADViews
- Model.getCADViews()
- Deprecated
Use
getCadViews
instead.- Return type
getCadConfigurations
- Model.getCadConfigurations()
Gets CAD configurations
- Return type
- Returns
an object mapping CAD configuration ID to config name
getCadViewConfiguration
getCadViewMap
getCadViewPmis
getCadViews
- Model.getCadViews()
- Deprecated
Use
getCadViewMap
instead.- Return type
getClientDimensions
- Model.getClientDimensions()
Returns the dimensions of the viewer container in pixels.
- Deprecated
use
View.getCanvasSize
- Return type
(number, number)
- Returns
a pair of numbers, [width, height].
getDataFromIds
- Model.getDataFromIds(ids)
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
{@link https://docs.techsoft3d.com/communicator/latest/api_ref/data_import/libsc/classSC_1_1Store_1_1Model.html#_CPPv4N2SC5Store5Model6InsertE8uint32_tPK7uint8_t8uint32_t Model::Insert}
- Arguments
ids (
SC.DataIds()
) –
- Return type
Promise <[Uint8Array]>
- Returns
promise that resolves when this operation has completed returning an array of 8bits int arrays for each ModelKey-DataKey pairs
getDataFromKeys
- Model.getDataFromKeys(ids)
- Deprecated
Use
getDataFromIds
instead.- Arguments
ids (
SC.DataIds()
) –
- Return type
Promise <[Uint8Array]>
getDefaultCadConfiguration
getDefaultCadView
getEdgeAttributes
- Model.getEdgeAttributes(nodeId, edgeIndex)
Returns edge attributes for a node of the given node and edge.
- Arguments
nodeId (NodeId) – Node to retrieve edge properties from
edgeIndex (
number()
) – Index of edge for which to retrieve edge attributes
- Return type
Promise <
SubentityAttributes()
| null>- Returns
Promise for the requested edge attributes. Properties returned will be null if none associated with the edge.
getEdgeCount
getEdgeProperty
- Model.getEdgeProperty(nodeId, edgeId)
Returns edge properties for a node of the given node and edge.
getFaceAttributes
- Model.getFaceAttributes(nodeId, faceIndex)
Returns face attributes for a node of the given node and face.
- Arguments
nodeId (NodeId) – Node to retrieve edge properties from
faceIndex (
number()
) – Index of face for which to retrieve face attributes
- Return type
Promise <
SubentityAttributes()
| null>- Returns
Promise for the requested face attributes. Properties returned will be null if none associated with the edge.
getFaceCount
getFaceProperty
- Model.getFaceProperty(nodeId, faceId)
Returns Face properties for a node of the given node and face.
getFilterName
- Model.getFilterName(filterId)
- Arguments
filterId (FilterId) –
- Return type
FilterName | null
- Returns
The name of a filter for the given filter ID index or null if filter was not found
getFilters
- Model.getFilters()
Returns names and ids of all filters available in the scene
- Return type
Map <FilterId, FilterName>
- Returns
a map associating Filter IDs to filter names
getFiltersWithNode
getGenericIdFromBimId
- Model.getGenericIdFromBimId(node, bimId)
Retrieves the generic id of the corresponding bim id.
getGenericTypeIdMap
- Model.getGenericTypeIdMap()
Gets all generic types and NodeIds with that type.
- Return type
Map <GenericType, Set <NodeId>>
- Returns
Map containing generic types and NodeIds
getGenericTypes
- Model.getGenericTypes()
This function gets all generic types contained in the model.
- Return type
- Returns
All generic types.
getIfcNodeIds
- Model.getIfcNodeIds()
- Deprecated
Use
getGenericTypeIdMap
instead.- Return type
Map <GenericType, Set <NodeId>>
getIfcTypeByNodeId
- Model.getIfcTypeByNodeId(id)
- Deprecated
Use
getGenericTypeIdMap
instead.- Arguments
id (NodeId) –
- Return type
GenericType | null
getIfcTypes
- Model.getIfcTypes()
- Deprecated
Use
getGenericTypes
instead.- Return type
getLayerIdsFromName
getLayerName
getLayers
getLooseBounding
getLowestAvailableNodeID
getLowestAvailableNodeId
getMeshIds
getMetallicRoughness
- Model.getMetallicRoughness(nodeIds)
Gets the metallic and roughness factors for the supplied nodes materials. Materials that are not currently set to use the Metallic Roughness shading model will have a null entry
- Arguments
nodeIds ([NodeId]) – List of nodes to get material properties for
- Return type
Promise <[null |
MetallicRoughnessValue()
]>
getModelBounding
- Model.getModelBounding(ignoreInvisible, includeExcluded[, tightBounding])
Gets the world space bounding box for the model.
- Arguments
ignoreInvisible (
boolean()
) –includeExcluded (
boolean()
) –tightBounding (
boolean()
) – optional
- Return type
Promise <
Box()
>- Returns
Promise that resolves with a Box representing the world space bounding box of the model.
getModelFileNameFromNode
getModelFileTypeFromNode
getNodeCappingMeshData
- Model.getNodeCappingMeshData(nodeId)
Fetch the mesh data for any capping geometry on a particular node
- Arguments
nodeId (NodeId) –
- Return type
Promise <
MeshDataCopy()
| null>
getNodeChildren
- Model.getNodeChildren(nodeId[, includeOutOfHierarchy])
Returns IDs for child nodes for the given Id.
getNodeColorMap
- Model.getNodeColorMap(startNodeId, elementType)
Gets a map associating NodeIds to colors that are set on those nodes. Only NodeIds of nodes that have a color set will be included.
- Arguments
startNodeId (NodeId) – The start node to walk when building the color map.
elementType (ElementType) – Returned colors are of this element type.
- Return type
getNodeEffectiveFaceColor
- Model.getNodeEffectiveFaceColor(partId, faceIndex)
Gets the color set via
setNodeFaceColor
on a face element. If no color has been set, the node’s face color will be returned. If the node’s face color has not been set, the color specified when the model was authored will be returned.
getNodeEffectiveLineColor
- Model.getNodeEffectiveLineColor(partId, lineIndex)
Gets the color set via
setNodeLineColor
on a line element. If no color has been set, the node’s line color will be returned. If the node’s line color has not been set, the color specified when the model was authored will be returned.
getNodeEffectivePointColor
- Model.getNodeEffectivePointColor(partId, pointIndex)
Gets the color set via
setNodePointColor
on a point element. If no color has been set, the node’s point color will be returned. If the node’s point color has not been set, the color specified when the model was authored will be returned.
getNodeExchangeId
- Model.getNodeExchangeId(nodeId)
Returns the Exchange ID of a node in the assembly tree.
- Arguments
nodeId (NodeId) – The node ID to get the Exchange ID from.
- Return type
ExchangeId | null
- Returns
The Exchange ID of the node with the given nodeId or null if no Exchange ID is found.
getNodeFaceColor
- Model.getNodeFaceColor(partId, faceIndex)
Gets the color set via
setNodeFaceColor
on a face element. If no color has been set,null
will be returned. See also:getNodeEffectiveFaceColor
getNodeFaceHighlighted
- Model.getNodeFaceHighlighted(nodeId, faceIndex)
Returns whether the supplied face element has been highlighted with
setNodeFaceHighlighted
- Arguments
nodeId (NodeId) – the ID of the node containing the face element
faceIndex (
number()
) – the index of the face within the node
- Return type
Promise <boolean>
getNodeGenericId
getNodeGenericType
- Model.getNodeGenericType(nodeId)
- Arguments
nodeId (NodeId) –
- Return type
GenericType | null
- Returns
the generic type of the given node or null if the node is not found.
getNodeIDFromSCInstanceKey
getNodeIdFromBimId
- Model.getNodeIdFromBimId(node, bimID)
Retrieves the node id of the corresponding bim id.
getNodeIdOffset
getNodeIdsByGenericIds
- Model.getNodeIdsByGenericIds(genericIds)
Returns a list of node IDs given a list of generic IDs. Note that the returned list of node IDs may be longer than the provided list of generic IDs since one ID can be used by more than one node.
getNodeIdsByIfcGuids
getNodeLayerId
getNodeLineColor
getNodeLineHighlighted
- Model.getNodeLineHighlighted(nodeId, lineIndex)
Returns whether the supplied line element has been highlighted with
setNodeLineHighlighted
- Arguments
nodeId (NodeId) – the ID of the node containing the line element
lineIndex (
number()
) – the index of the line within the node
- Return type
Promise <boolean>
getNodeMatrix
getNodeMeshData
- Model.getNodeMeshData(nodeId)
Fetch the mesh data for a particular node
- Arguments
nodeId (NodeId) – the node’s ID
- Return type
Promise <
MeshDataCopy()
>
getNodeName
getNodeNetMatrix
getNodeParent
getNodePointColor
- Model.getNodePointColor(partId, pointIndex)
Gets the color set via
setNodePointColor
on a point element. If no color has been set,null
will be returned. See also:getNodeEffectivePointColor
getNodePointHighlighted
- Model.getNodePointHighlighted(nodeId, pointIndex)
Returns whether the supplied point element has been highlighted with
setNodePointHighlighted
- Arguments
nodeId (NodeId) – the ID of the node containing the point element
pointIndex (
number()
) – the index of the point within the node
- Return type
Promise <boolean>
getNodeProperties
- Model.getNodeProperties(nodeId[, computeFromChildren])
Returns the properties for the given node ID.
- Arguments
nodeId (NodeId) –
computeFromChildren (
boolean()
) – optional If true physical properties will be computed from child nodes.
- Return type
Promise <
StringStringMap()
| null>- Returns
object properties for the supplied ID, or null if the ID was invalid
getNodeRealBounding
- Model.getNodeRealBounding(nodeId)
Gets the world space bounding box for a node including any effects (explosion, camera suppression, etc). Note: This function can have performance implications when used on nodes with many children.
getNodeType
getNodeUnitMultiplier
getNodeUserData
- Model.getNodeUserData(nodeId, index)
Returns the user data for a given node and index.
- Throws
InvalidNodeIdError
InvalidIndexError
- Arguments
nodeId (NodeId) – The ID of the node to query.
index (UserDataIndex) – The index of the data.
- Return type
Uint8Array
- Returns
The user data.
getNodeUserDataIndices
getNodeVisibility
getNodesBounding
- Model.getNodesBounding(nodeIds[, config])
Gets the world space bounding box for a list of nodes.
- Arguments
nodeIds ([NodeId]) – 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.
- Return type
Promise <
Box()
>- Returns
Promise that resolves with the world space bounding box for the given IDs.
getNodesByGenericType
- Model.getNodesByGenericType(genericType)
This function returns all NodeIds with an IFC type.
- Arguments
genericType (GenericType) –
- Return type
Set <NodeId> | null
- Returns
All NodeIds with an IFC type
getNodesByIfcType
getNodesCappingMeshData
- Model.getNodesCappingMeshData(nodeIds)
Fetch the mesh data for any capping geometry on a list of nodes and their children
- Arguments
nodeIds ([NodeId]) – the node IDs to get capping data from.
- Return type
Promise <[
MeshDataCopy()
]>
getNodesCullingVectors
- Model.getNodesCullingVectors(nodeIds)
Retrieves the vector and angle used to determine an object’s visibility based on camera orientation. If unset,
null
will appear at the corresponding array index.- Arguments
nodeIds ([NodeId]) – The nodes to query culling vectors from.
- Return type
Promise <[null |
CullingVector()
]>- Returns
A promise of culling vectors.
getNodesEffectiveFaceColor
getNodesEffectiveLineColor
getNodesEffectiveOpacity
- Model.getNodesEffectiveOpacity(leafNodes, elementType)
Gets the opacity set on a list of leaf nodes multiplied by the opacity specified when the model was authored. If no opacity has been set, the opacity specified when the model was authored will be returned directly.
- Arguments
leafNodes ([NodeId]) –
elementType (ElementType) – the type of element (faces, lines or points) to query
- Return type
Promise <[number]>
getNodesEffectivePointColor
getNodesEffectiveTransparency
- Model.getNodesEffectiveTransparency(leafNodes, elementType)
- Deprecated
use
getNodesEffectiveOpacity
instead.- Arguments
leafNodes ([NodeId]) –
elementType (ElementType) –
- Return type
Promise <[number]>
getNodesFaceColor
- Model.getNodesFaceColor(nodeIds)
Gets the color set via
setNodesFaceColor
on the faces of a list of leaf nodes. If no color has been explicitly set for a particular node,null
will appear at the corresponding position in the returned array. See also:getNodesEffectiveFaceColor
getNodesFromFiltersId
- Model.getNodesFromFiltersId(filtersId)
- Arguments
filtersId ([FilterId]) – array of filters indexes to take in account
- Return type
FilteredNodes()
| null- Returns
nodesId of nodes retained by the given filter indices and the type of filter (inclusive or not). Returns null if no filter is found.
getNodesFromLayer
- Model.getNodesFromLayer(layerId[, onlyTreeNodes])
Returns IDs of nodes in the given layer.
getNodesFromLayerName
- Model.getNodesFromLayerName(layerName[, onlyTreeNodes])
Returns IDs of nodes in the given layer.
getNodesFromLayers
- Model.getNodesFromLayers(layersId[, onlyTreeNodes])
Returns IDs of nodes in given layers.
getNodesHaveTransparency
- Model.getNodesHaveTransparency(nodeIds)
Returns whether nodes with the given NodeIds have an opacity value that is not fully opaque.
- Arguments
nodeIds ([NodeId]) – IDs of nodes to query.
- Return type
Promise <[boolean]>
- Returns
array of boolean values corresponding to the id array passed into the function. A value of true indicates that the node contains transparency and is not fully opaque.
getNodesHighlighted
getNodesInstancingSamePart
- Model.getNodesInstancingSamePart(nodeId)
Returns IDs of nodes who instance the same part as the supplied node. This method should be called on nodes whose type is
PartInstance
.
getNodesLineColor
- Model.getNodesLineColor(nodeIds)
Gets the color set via
setNodesLineColor
on the lines of a list of leaf nodes. If no color has been set for a particular node,null
will appear at the corresponding position in the returned array.
getNodesOpacity
getNodesPointColor
- Model.getNodesPointColor(nodeIds)
Gets the color set via
setNodesPointColor
on the points of a list of leaf nodes. If no color has been explicitly set for a particular node,null
will appear at the corresponding position in the returned array. See also:getNodesEffectivePointColor
getNodesTransparency
getOutOfHierarchy
getPMIColor
getPMIColorOverride
- Model.getPMIColorOverride()
- Deprecated
Use
getPmiColorOverride
instead.- Return type
boolean
getPMISubtype
getPMIType
getPMIs
- Model.getPMIs()
- Deprecated
Use
getPmis
instead.- Return type
getPmiColor
getPmiColorOverride
- Model.getPmiColorOverride()
- Return type
boolean
- Returns
a boolean value indicating the status of the PMI override color.
getPmiSubtype
getPmiTopologyReferences
- Model.getPmiTopologyReferences(pmiNodeId)
Gets an array of PMI topology references linking a PMI node to a body element, like a face or an edge.
- Arguments
pmiNodeId (NodeId) – the ID of the PMI node.
- Return type
[
RefOnTopoItem()
] | null
getPmiType
getPmis
- Model.getPmis()
Returns names and ids of all the PMIs available in the scene
- Return type
- Returns
a map associating PMI IDs to PMI names
getPointAttributes
- Model.getPointAttributes(nodeId, pointIndex)
Returns point attributes for a node of the given node and point.
- Arguments
nodeId (NodeId) – Node to retrieve point properties from
pointIndex (
number()
) – Index of point for which to retrieve point attributes
- Return type
Promise <
SubentityAttributes()
| null>- Returns
Promise for the requested point attributes. Properties returned will be null if none associated with the point.
getPrimaryModelId
- Model.getPrimaryModelId()
- Deprecated
- Return type
Promise <SC.ModelKey>
getPrimaryModelKey
- Model.getPrimaryModelKey()
- Deprecated
- Return type
Promise <SC.ModelKey>
getRelationshipTypesFromBimId
- Model.getRelationshipTypesFromBimId(node, bimId)
Retrieves all type of relationships that a bim id has.
- Arguments
- Return type
- Returns
array of type of relationship corresponding to the BimId.
getRootNode
getSCInstanceKey
getUniqueLayerNames
getUnitMultiplier
- Model.getUnitMultiplier()
Returns the unit multiplier affecting the root of the first loaded model. This number is a multiplier of millimeters (for example inches will be
25.4
). The default value is1.0
.- Deprecated
Use
getNodeUnitMultiplier
instead.- Return type
number
- Returns
The unit multiplier for the model (in mm)
getViewAxes
- Model.getViewAxes()
- Return type
- Returns
the up and front vectors for the model coordinate system.
getVisibilityState
- Model.getVisibilityState(startNodeId)
Returns a defaultVisibility boolean value and a visibilityException set of NodeIds. defaultVisibility will be true if there are more nodes visible than hidden, and false otherwise. If defaultVisibility is true, set of nodes that are hidden, if false, nodes that are visible.
- Arguments
startNodeId (NodeId) –
- Return type
Promise <
VisibilityState()
>
hasDepthRange
hasEffectiveGenericType
- Model.hasEffectiveGenericType(nodeId, genericType)
Checks if a
NodeId
is a generic type.- Arguments
nodeId (NodeId) –
genericType (GenericType) –
- Return type
boolean
isAnnotationView
isCombineStateView
isDrawing
- Model.isDrawing()
Tells if the model is a CAD drawing or not
- Return type
boolean
- Returns
true if the model is a CAD drawing
isFaceMeasurable
isLineMeasurable
isMeasurable
- Model.isMeasurable()
- Return type
boolean
- Returns
true if the model contains measurement data.
isNodeLoaded
isWithinExternalModel
loadMeasurementFromFile
- Model.loadMeasurementFromFile(filename)
Loads measurement data from a ZIP file
- Arguments
filename (
string()
) – Name of a file containing ZIP measurement data
- Return type
Promise <void>
loadMeasurementFromJson
- Model.loadMeasurementFromJson(json)
Loads measurement data from a JSON object
- Arguments
json (
any()
) – JSON object containing measurement data
- Return type
Promise <void>
loadMeasurementFromString
- Model.loadMeasurementFromString(str)
Loads measurement data from a JSON string
- Arguments
str (
string()
) – JSON string containing measurement data
- Return type
Promise <void>
loadSubtreeFromModel
- Model.loadSubtreeFromModel(nodeId, modelName, config)
Loads the tree stored in a model file and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
modelName (ScModelName) – The name of the model to load.
config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
- Model.loadSubtreeFromModel(nodeId, modelName[, additionalMatrix])
Loads the tree stored in a model file and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
modelName (ScModelName) – The name of the model to load.
additionalMatrix (
Matrix()
| null) – optional Optional matrix to get multiplied into the net attachment matrix.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
loadSubtreeFromScsBuffer
- Model.loadSubtreeFromScsBuffer(nodeId, buffer, config)
Loads the tree stored in a model file and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
buffer (ScsBuffer) – The SCS buffer to load.
config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
- Model.loadSubtreeFromScsBuffer(nodeId, buffer[, additionalMatrix])
Loads the tree stored in a model file and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
buffer (ScsBuffer) – The SCS buffer to load.
additionalMatrix (
Matrix()
| null) – optional Optional matrix to get multiplied into the net attachment matrix.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
loadSubtreeFromScsFile
- Model.loadSubtreeFromScsFile(nodeId, scsFilename, config)
Loads the tree stored in a model file and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
scsFilename (ScsUri) – The name of the SCS file to load.
config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
- Model.loadSubtreeFromScsFile(nodeId, scsFilename[, additionalMatrix])
Loads the tree stored in a model file and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the subtree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
scsFilename (ScsUri) – The name of the SCS file to load.
additionalMatrix (
Matrix()
| null) – optional Optional matrix to get multiplied into the net attachment matrix.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
loadSubtreeFromScsXmlBuffer
- Model.loadSubtreeFromScsXmlBuffer(nodeId, xmlData, modelNameToScs, config)
Loads the tree stored in the XML and query loading of required meshes Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlData (
string | Document()
) – XML document or XML document string.modelNameToScs (ModelNameToScsFileFunc | null) – 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.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.
- Model.loadSubtreeFromScsXmlBuffer(nodeId, xmlData[, modelNameToScs[, additionalMatrix[, allowMissingExternalModels]]])
Loads the tree stored in the XML and query loading of required meshes. Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlData (
string | Document()
) – XML document or XML document string.modelNameToScs (ModelNameToScsFileFunc | null) – 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 (
Matrix()
| null) – 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.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.
loadSubtreeFromScsXmlFile
- Model.loadSubtreeFromScsXmlFile(nodeId, xmlFilename, modelNameToScs, config)
Loads the tree stored in the XML and query loading of required meshes Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlFilename (XmlFilename) – URL of XML file to load.
modelNameToScs (ModelNameToScsFileFunc | null) – 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.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.
- Model.loadSubtreeFromScsXmlFile(nodeId, xmlFilename[, modelNameToScs[, additionalMatrix[, allowMissingExternalModels]]])
Loads the tree stored in the XML and query loading of required meshes Load order is determined by the projected size of bounding information present in the XML. If streamCutoffScale is set to a non zero value, a file whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlFilename (XmlFilename) – URL of XML file to load.
modelNameToScs (ModelNameToScsFileFunc | null) – 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 (
Matrix()
| null) – 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.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs that will resolve when all files have been loaded.
loadSubtreeFromUrl
- Model.loadSubtreeFromUrl(nodeId, xmlFilename)
- Deprecated
Use
loadSubtreeFromXmlFile
instead.- Arguments
nodeId (NodeId) –
xmlFilename (XmlFilename) –
- Return type
Promise <[NodeId]>
loadSubtreeFromXML
loadSubtreeFromXmlBuffer
- Model.loadSubtreeFromXmlBuffer(nodeId, xmlData, massageModelName, config)
Loads the tree stored in the XML and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlData (
string | Document()
) – XML document or XML document string.massageModelName (MassageModelNameFunc | null) – Optional callback to massage model names within the XML file. Return null to skip the model.
config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
- Model.loadSubtreeFromXmlBuffer(nodeId, xmlData[, massageModelName[, additionalMatrix[, allowMissingExternalModels]]])
Loads the tree stored in the XML and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlData (
string | Document()
) – XML document or XML document string.massageModelName (MassageModelNameFunc | null) – optional Optional callback to massage model names within the XML file. Return null to skip the model.
additionalMatrix (
Matrix()
| null) – 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.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
loadSubtreeFromXmlFile
- Model.loadSubtreeFromXmlFile(nodeId, xmlFilename, massageModelName, config)
Loads the tree stored in the XML and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlFilename (XmlFilename) – URL of XML file to load.
massageModelName (MassageModelNameFunc | null) – Optional callback to massage model names within the XML file. Return null to skip the model.
config (
LoadSubtreeConfig()
) – Configuration to control load behavior.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
- Model.loadSubtreeFromXmlFile(nodeId, xmlFilename[, massageModelName[, additionalMatrix[, allowMissingExternalModels]]])
Loads the tree stored in the XML and query loading of required meshes
- Arguments
nodeId (NodeId) – ID of the node to link the sub tree with. This ID should not have a type of Body or BodyInstance. If this parameter is null, the sub tree will be linked to the root. This method will trigger a subtreeLoaded event.
xmlFilename (XmlFilename) – URL of XML file to load.
massageModelName (MassageModelNameFunc | null) – optional Optional callback to massage model names within the XML file. Return null to skip the model.
additionalMatrix (
Matrix()
| null) – 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.
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
registerBimNodes
- Model.registerBimNodes(startNodeId, attributeToMask[, legacy_useAttributeTitle])
This function recursively discovers BIM nodes in the supplied subtree and registers them.
- Arguments
startNodeId (NodeId) – The root of the subtree to walk for registration.
attributeToMask (
function()
) – The callback used to obtain a node’sBimMask
from its attributes.legacy_useAttributeTitle (
string | boolean | null()
) – optional
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
- Model.attributeToMask(value)
- Arguments
value (
string()
) –
- Return type
registerIfcNodes
- Model.registerIfcNodes(startNodeId[, legacy_useAttributeTitle])
This function recursively discovers IFC nodes in the supplied subtree and registers them.
- Arguments
startNodeId (NodeId) – The root of the subtree to walk for registration.
legacy_useAttributeTitle (
string | boolean | null()
) – optional
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
replaceMesh
- Model.replaceMesh(id, data)
Replace a mesh’s data. This will affect all instances of that mesh.
- Arguments
id (MeshId) –
data (
MeshData()
) – the new data
- Return type
Promise <void>
requestNodes
reset
- Model.reset()
Resets the state of the model to its default
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
resetModelHighlight
- Model.resetModelHighlight()
Resets highlight for all nodes in the model.
- Return type
- Returns
Promise that resolves when this operation has completed.
resetModelOpacity
- Model.resetModelOpacity()
Resets opacity for all nodes in the model.
- Return type
void
- Returns
Promise that resolves when this operation has completed.
resetModelTransparency
- Model.resetModelTransparency()
- Deprecated
Use
resetModelOpacity
instead.- Return type
resetNodeMatrixToInitial
resetNodesColor
- Model.resetNodesColor()
Resets color for all nodes in the model.
- Return type
- Returns
Promise that resolves when this operation has completed.
resetNodesOpacity
resetNodesTransform
- Model.resetNodesTransform()
Resets transform for all nodes in the model.
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
resetNodesTransparency
resetNodesVisibility
- Model.resetNodesVisibility()
Resets visibility for all nodes in the model.
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
setBodyNodesVisibility
- Model.setBodyNodesVisibility(startNodeId, visibility)
Sets the visibility of all body nodes starting from a given node.
- Arguments
startNodeId (NodeId) – The start node to walk when updating body nodes visibility.
visibility (
boolean()
) – If true, nodes will be shown. If false, they will be hidden.
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
- Model.setBodyNodesVisibility(startNodeId, visibilityFormatter)
Sets the visibility of all body nodes starting from a given node.
- Arguments
startNodeId (NodeId) – The start node to walk when updating body nodes visibility.
visibilityFormatter (
function()
) – A function that returns the visibility for a given node id
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
- Model.visibilityFormatter(node)
- Arguments
node (NodeId) –
- Return type
boolean | undefined
setDepthRange
- Model.setDepthRange(nodeIds, min, max)
Remaps the depth values used for z-ordering of pixels to the given range, which must be a subset of
[0,1]
. The depth value at the near plane (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.
- Arguments
nodeIds ([NodeId]) – the node IDs to operate on
min (
number()
) – the depth value at the near planemax (
number()
) – the depth value at the far plane
- Return type
The smaller the range, the more z-fighting you will see among objects set to that range.
setEdgeProperty
setEnableAutomaticUnitScaling
- Model.setEnableAutomaticUnitScaling(enabled)
If enabled then models loaded into an existing scene with a different unit value will be scaled to the unit value of the current scene.
- Arguments
enabled (
boolean()
) – value indicating if automatic unit scaling will be active
- Return type
void
setFaceProperty
setInstanceModifier
- Model.setInstanceModifier(instanceModifier, nodeIds, value)
Allows changing the behavior in the viewer
- Arguments
instanceModifier (InstanceModifier) – InstanceModifier
nodeIds ([NodeId]) – Array of node ids
value (
boolean()
) – boolean
- Return type
setMeshLevel
setMetallicRoughness
- Model.setMetallicRoughness(nodeIds, metallicFactor, roughnessFactor)
Sets the metallic and roughness factors for the supplied nodes materials. Materials that are not currently set to use the Metallic Roughness shading model will be upgraded to use this mode.
- Arguments
nodeIds ([NodeId]) – List of nodes to set material properties for
metallicFactor (
number()
) – The metalness of the materialroughnessFactor (
number()
) – The roughness of the material
- Return type
void
setNodeFaceColor
- Model.setNodeFaceColor(partId, faceId, color)
Sets the color for a face element. This color will take precedence over any currently set color on the node
- Arguments
- Return type
setNodeFaceHighlighted
- Model.setNodeFaceHighlighted(nodeId, faceId, highlighted)
Sets whether the face element for a given node should appear highlighted. When a face element is highlighted, the highlight color will override any color previously set on the element.
- Arguments
nodeId (NodeId) – the id for the node containing the face element.
faceId (
number()
) – the face Id that is the target of this operation.highlighted (
boolean()
) – value indicating whether the supplied face element should be highlighted.
- Return type
setNodeFaceVisibility
- Model.setNodeFaceVisibility(partId, faceId, visibility)
Sets the visibility for a face element. This visibility setting will take precedence over other element visibility settings
- Arguments
partId (PartId) – the Id of the part containing the face
faceId (
number()
) – the Id of the face in the node that will have its visibility setvisibility (
boolean()
) – visibility state to be set
- Return type
void
setNodeLineColor
- Model.setNodeLineColor(partId, lineId, color)
Sets the color for a line element.
- Arguments
- Return type
setNodeLineHighlighted
- Model.setNodeLineHighlighted(partId, lineId, highlighted)
Sets whether the line element for a given node should appear highlighted. When a line element is highlighted, the highlight color will override any color previously set on the element.
- Arguments
partId (PartId) –
lineId (
number()
) – the line Id that is the target of this operation.highlighted (
boolean()
) – value indicating whether the supplied line element should be highlighted.
- Return type
setNodeLineVisibility
- Model.setNodeLineVisibility(partId, lineId, visibility)
Sets the visibility for a line element. This visibility setting will take precedence over other element visibility settings
- Arguments
partId (PartId) – the Id of the part containing the line
lineId (
number()
) – the Id of the line in the node that will have its visibility setvisibility (
boolean()
) – visibility state to be set
- Return type
void
setNodeMatrix
setNodePointColor
setNodePointHighlighted
- Model.setNodePointHighlighted(partId, pointId, highlighted)
Sets whether the point element for a given node should appear highlighted. When a point element is highlighted, the highlight color will override any color previously set on the element.
- Arguments
partId (NodeId) –
pointId (
number()
) – the point Id that is the target of this operation.highlighted (
boolean()
) – value indicating whether the supplied point element should be highlighted.
- Return type
setNodePointVisibility
- Model.setNodePointVisibility(partId, pointId, visibility)
Sets the visibility for a point element. This visibility setting will take precedence over other element visibility settings
- Arguments
partId (PartId) – the Id of the part containing the point
pointId (
number()
) – the Id of the point in the node that will have its visibility setvisibility (
boolean()
) – visibility state to be set
- Return type
void
setNodesAmbientColor
setNodesAmbientMix
- Model.setNodesAmbientMix(nodeIds, value)
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.
- Arguments
nodeIds ([NodeId]) – IDs of nodes whose color to set
value (
number()
) – the decimal value to set, between 0 and 1
- Return type
void
setNodesColors
- Model.setNodesColors(colorMap[, alsoApplyToWireframe[, alsoApplyToPoints]])
Sets colors for a given set of nodes.
- Arguments
colorMap (Map <NodeId,
Color()
> |IdColorMap()
) –alsoApplyToWireframe (
boolean()
) – optional change or not lines coloralsoApplyToPoints (
boolean()
) – optional change or not points color
- Return type
- Returns
Promise that resolves when this operation has completed.
setNodesCullingVector
- Model.setNodesCullingVector(nodeIds, space, vector, toleranceDegrees)
Sets a vector and angle used to determine an object’s visibility based on camera orientation.
- Arguments
nodeIds ([NodeId]) –
space (CullingVectorSpace) – The space in which the culling vector is defined.
vector (
Point3()
) – A vector that will be compared with the view vector.toleranceDegrees (Degrees) – The maximum angle between the culling vector and the view vector within which the object will be visible.
- Return type
setNodesFaceColor
- Model.setNodesFaceColor(nodeIds, color)
Sets the color on the faces for a given list of nodes.
- Arguments
- Return type
- Returns
Promise that resolves when this operation has completed.
setNodesFaceEmissiveColor
setNodesFaceSpecularColor
setNodesFaceSpecularIntensity
setNodesHighlighted
- Model.setNodesHighlighted(partIds, highlighted)
Sets whether the supplied nodes should appear highlighted. When a node is highlighted, the highlight color will override any color previously set on the model.
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 ofWebViewer
- Arguments
partIds ([PartId]) –
highlighted (
boolean()
) – value indicating whether the supplied nodes should be highlighted.
- Return type
- Returns
Promise that resolves when this operation has completed.
Tip: An easy way to unhighlight the entire model is to call
setNodesHighlighted
on the root node of the model:hwv.model.setNodesHighlighted([hwv.model.getAbsoluteRootNode()], false);
(In this case,
hwv
is your instance ofWebViewer
setNodesLineColor
- Model.setNodesLineColor(nodeIds, color)
Sets the color on the lines/edges for a given list of nodes.
- Arguments
- Return type
- Returns
Promise that resolves when this operation has completed.
setNodesLinePattern
- Model.setNodesLinePattern(nodeIds, pattern, patternLength, patternLengthUnit)
Applies the given line pattern to the specified nodes. See also
unsetNodesLinePattern
- Arguments
nodeIds ([NodeId]) – 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.
- Return type
void
setNodesOpacities
- Model.setNodesOpacities(params)
Sets opacity for a given set of nodes.
- Arguments
params (Map <NodeId, 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.
- Return type
void
setNodesOpacity
- Model.setNodesOpacity(nodeIds, opacity)
Sets opacity for a given list of nodes.
- Arguments
nodeIds ([NodeId]) – IDs of nodes whose opacity will be set
opacity (
number()
) – opacity value to apply to each node. The value should be between the range of 0.0 and 1.0. 0.0 indicates fully transparent, while 1.0 is fully opaque.
- Return type
void
setNodesPointColor
setNodesTexture
- Model.setNodesTexture(nodeIds, options)
Apply an image to a node as a texture map. See
createImage
andunsetNodesTexture
- Arguments
nodeIds ([NodeId]) – The nodes on which to apply the texture
options (
TextureOptions()
) – Options specifying how the texture is applied
- Return type
Promise <void>
setNodesTransparencies
- Model.setNodesTransparencies(params)
- Deprecated
use
setNodesOpacities
instead.- Arguments
params (Map <NodeId, number> |
IdNumberMap()
) –
- Return type
setNodesTransparency
setNodesVisibilities
- Model.setNodesVisibilities(mapping[, initiallyHiddenStayHidden])
Sets the visibility for a given set of nodes.
- Arguments
mapping (Map <NodeId, boolean> |
IdBooleanMap()
) – The mapping of node IDs to boolean value indicating the visibility setting for that node.initiallyHiddenStayHidden (
boolean | null()
) – optional Controls whether or not initially hidden geometries stay hidden. Default behavior is driven bysetBehaviorInitiallyHidden
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
setNodesVisibility
- Model.setNodesVisibility(nodeIds, visibility[, initiallyHiddenStayHidden])
Sets visibility for a given list of nodes.
- Arguments
nodeIds ([NodeId]) – The node IDs whose visibilities will be set.
visibility (
boolean()
) – If true, nodes will be shown. If false, they will be hidden.initiallyHiddenStayHidden (
boolean | null()
) – optional Controls whether or not initially hidden geometries stay hidden. Default behavior is driven bysetBehaviorInitiallyHidden
- Return type
Promise <void>
- Returns
Promise that resolves when the operation has completed.
setPMIColor
setPMIColorOverride
- Model.setPMIColorOverride(enableOverride)
- Deprecated
Use
setPmiColorOverride
instead.- Arguments
enableOverride (
boolean()
) –
- Return type
setPart
setPhysicalProperties
- Model.setPhysicalProperties(nodeId, gravityCenter, surfaceArea, volume)
Purpose: Sets physical properties
- Arguments
- Return type
boolean
- Returns
true if all went right, false otherwise
setPmiColor
setPmiColorOverride
- Model.setPmiColorOverride(enableOverride[, rootId])
Takes a boolean value and either enables the set PMI override color or resets all PMI colors to their default
- Arguments
enableOverride (
boolean()
) –rootId (NodeId) – optional
- Return type
- Returns
Promise that resolves when this operation has completed.
setViewAxes
switchToModel
- Model.switchToModel(newModelFilename)
Delete all the current scene and load the specified model instead. Also triggers a “modelSwitched” when finished.
- Arguments
newModelFilename (ScModelName) – Name of the model file to load after the existing scene gets deleted
- Return type
Promise <[NodeId]>
- Returns
A
Promise
of the newly loaded model’s root nodes IDs.
triangulatePolygon
- Model.triangulatePolygon(polygonPoints, normal)
Triangulates the supplied polygon.
- 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.
- Return type
Float32Array
- Returns
An array containing the point data for the generated triangles. Points are stored [XYZXYZXYZ…] format. This returned list is always divisible by 9 (3 points per triangle; 3 floats per point).
unsetDepthRange
unsetMetallicRoughness
unsetNodeFaceColor
unsetNodeLineColor
unsetNodePointColor
- Model.unsetNodePointColor(partId, pointId)
Unsets the color for a point element. This will return the point’s color to its default state.
- Arguments
partId (PartId) – the Id of the node containing the point
pointId (
number()
) – the Id of the point in the node that will have its color unset
- Return type
void
unsetNodesCullingVectors
unsetNodesFaceColor
unsetNodesFaceEmissiveColor
unsetNodesFaceSpecularColor
unsetNodesFaceSpecularIntensity
unsetNodesLineColor
unsetNodesLinePattern
unsetNodesPointColor
unsetNodesTexture
viewAxesHaveBeenSet
- Model.viewAxesHaveBeenSet()
Gets whether there has been a successful call to setViewAxes.
- Return type
boolean