Should be considered private, only the Viewer3d will create an instance
Whether the levels and grid lines are shown
Whether the magnifier is on: while a point tool aims with a mouse or pen, a round loupe beside the cursor shows the area under it enlarged, with the snap target. The session's choice, set with setMagnifier; on unless switched off
Whether the point tools (point, length, area, angle) snap to vertices and edges, the session's choice set with setSnapping. Holding left Shift suspends it
Add an angle measurement programmatically, for example a measurement that was stored in a database earlier
A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique
Exactly 3 coordinates in 3D space: the end of the first arm, the vertex, the end of the second arm
The AngleMeasurement object
Add an area measurement programmatically, for example a measurement that was stored in a database earlier
A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique
An array of coordinates in 3D space forming the polygon. The closing edge is implied, the first coordinate should not be repeated at the end
Optionalholes: vec3[][]Optional openings of the face this measurement was taken from, each a closed ring with the same convention as coordinates
Optionalmode: boolean | AreaModeWhich figure the measurement reports, see AreaMeasurement.areaMode. Defaults to "net" when holes are given, "gross" otherwise; the boolean that predates the third mode is still accepted, true meaning "net". Both this and the holes are needed for a faithful round trip: the mode is a per-measurement choice, so the presence of openings does not by itself say which was in force
The AreaMeasurement object
Add a distance measurement programmatically, for example a measurement that was stored in a database earlier
A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique
The first coordinate in 3D space
The second coordinate in 3D space
Optionalnormal: vec3The normal that was used on the first coordinate, this is not really used anywhere and can be left empty
Optionalconstrain: falseWhether the original measurement was constrained, also not used anywhere to optional
The DistanceMeasurement object
Place a laser again where one stood (LaserMeasurement.placement): its beams are cast again against the geometry loaded now, so they end where the objects are now
A unique id, see addDistanceMeasurement
Where it stands, viewer measurement coordinates
The normal of the face it stands on
Optionaloptions: { onlyZ?: boolean; qid?: string | null; toReference?: boolean }qid: the object of that face; onlyZ: a vertical laser; toReference: the beams end on references (see LaserMeasurement.toReference)
The finished LaserMeasurement, or null when its beams could not be cast (nothing is left behind then)
Add a new listener, a listener can have many methods implemented, but none of them are required
Add a finished object distance measurement programmatically (e.g. restored from a database), without recomputing it
A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique
The result as measureObjectDistance returned it: the distance in mm, the two closest points and the qids
The ObjectDistanceMeasurement object
Add a path measurement programmatically, for example a measurement that was stored in a database earlier
A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique
An array of coordinates in 3D space
Optionalnormal: vec3The normal that was used on the first coordinate, this is not really used anywhere and can be left empty
Optionalconstrain: booleanWhether the original measurement was constrained, also not used anywhere to optional
The PathMeasurement object
Add a point measurement programmatically, for example a measurement that was stored in a database earlier
A unique id, see addDistanceMeasurement
The point, viewer measurement coordinates
The PointMeasurement object
Ends a point drag and puts the point back, as Escape does; false when no drag was active
Whether the active touch measurement has enough points to finish (a path two, an area three)
Whether the running tool can use the magnifier: a point tool (point, length, area, angle) on a device with a mouse or pen. The Magnifier toggle is offered only then
Whether the running tool can snap: to vertices and edges for the point tools, to 100 mm and 15° steps for move/rotate
Remove all existing measurement listeners
Finish the active measurement the way Enter or a double-click does: a length needs two points, an area three corners and an angle its three points; with fewer the measurement stays active. For the move/rotate tool this applies the change
A fresh id for the add…Measurement methods, unique among the measurements of every viewer
What the active measurement measures (see kindOf), null when none runs or the move/rotate tool runs
The running tool, for a user interface that names it and offers its controls (the BIM.works mode bar), or null when nothing runs. Changes are announced with MeasuringListener.toolChanged
Get the active measurement
The currently active measurement (being constructed), or null when no measurement is active
The measurement whose point is being dragged, or the laser being moved; null when none
The currently hovered Measurement, null if no measurement is being hovered over
Get the Measurement object for the given id
the Id of the measurement, must be a number (int)
The reference geometry of an object from the reference figures the server wrote at check-in, cached; null when the object has none
The storey levels and grid lines setReferenceObjectsVisible loaded (measurement frame, mm), a copy; null before they are loaded
The currently selected Measurement, null if no measurement is selected
Where a touch measurement stands: "aiming" (a finger is down under the loupe), "pending" (a point is previewed and waits for its checkmark) or "idle"
Whether a measurement is currently active (being constructed)
Whether the running tool snaps right now, with Shift taken into account
What the measurement measures: "distance", "length", "point", "area", "angle", "objectDistance" or "laser"; null for anything else
Load the levels (building storeys with an elevation) and grid lines of the loaded models, once per model set
Compute the shortest distance between the surfaces of two objects, without any interaction. The triangles of both objects are read back from the GPU and the closest pair is found in the browser; the result carries the two closest points
The first object
The second object
Optionaloptions: { add?: boolean; mode?: ObjectDistanceMode; references?: ReferenceMode[] }add: also add (and draw) the finished measurement, available as the result's measurement property
The result, or null when either object has no surface geometry (or is the same object)
fn(active) is called whenever a measurement tool becomes active or stops
A function that unsubscribes
Remove all the measurements
Remove a measurement by its id
The unique if of the measurement
Gross, net or hull for the area measurement being taken (kept also where it does not apply yet, it takes effect on the face that is clicked), else for the selected finished one (only when it applies)
Whether the mode was taken
Programmatically set the given measurement to be blurred. This will be reflected in 3D View. Keep in mind that this will trigger any listeners (for blurring measurements)
Programmatically set the given measurement to be the "hovered" measurement. This will be reflected in 3D View and any currently "hovered" measurement will be automatically blurred. Keep in mind that this will trigger any listeners (both for blurring any current measurement and for hovering the new measurement)
Switch the magnifier on or off: the session's choice, for the running measurement and the ones that follow
Show or hide the levels and grid lines on the overlay (loading them first). While shown, the vertical laser stops at the levels and an object distance that is picking takes a clicked level or grid line as one of its sides
Programmatically set the given measurement to be the selected measurement. This will be reflected in 3D View and any currently selected measurement will be automatically unselected. Keep in mind that this will trigger any listeners (both for unselecting any current measurement and for selecting the new measurement), depending on the triggerListeners parameter.
Optionalmeasurement: MeasurementThe measurement that you want to select. You can also pass null to unselect the currently selected measurement
OptionaltriggerListeners: booleanIndicate whether listeners should be called, the default value for this optional parameter = true. Regardless of the setting, listeners are only ever called when there is an actual change in selection
Switch snapping on or off. For the point tools this is the session's choice: it also holds for the measurements that follow, and left Shift keeps suspending it while held. For move/rotate it is the tool's step snapping, which Shift inverts
Start a new angle measurement. The user clicks exactly 3 points: the end of the first arm, the vertex (from where the angle bow is shown), and the end of the second arm. The measurement finishes immediately when the third point is committed, Escape cancels it
A reference to the started AngleMeasurement
Start a new area measurement. The user clicks a sequence of points forming a closed polygon, the enclosed area is shown at the centroid. Clicking the first point again (or pressing Enter, with at least 3 points) closes the polygon and finishes the measurement, Escape cancels it. In 3D the first 3 (non-collinear) points define a plane, any further points are constrained to that plane
A reference to the started AreaMeasurement
Start a new distance measurement
Optionalconstrain: booleanWhether this measurement should be constrained (perpendiculair to the starting face)
A reference to the started DistanceMeasurement
Start a new 3-axis laser measurement. Keep in mind that this method is async, when first using the LaserMeasurement, the initial setup time can be longer
A reference to the started LaserMeasurement
Start a new object distance measurement: the user clicks two objects and the shortest distance between their surfaces is drawn as a dimension between the two closest points. When exactly two objects are selected the measurement is computed at once, without further clicks. It finishes by itself once the distance is known, Escape cancels it. Not editable, static afterwards. Objects that touch or intersect report 0
Optionaloptions: {sids or qids: measure these two objects instead of picking; useSelection: false ignores the current selection
A reference to the started ObjectDistanceMeasurement
Start a new point measurement. A point measurement add's a label to a vertex
A reference to the started PointMeasurement
Start a new 1-axis (vertical) laser measurement. Keep in mind that this method is async, when first using the LaserMeasurement, the initial setup time can be longer
A reference to the started LaserMeasurement
Stops the currently active measurement and removes it. Clicks go back to the viewer's selection mode (rectangle selection included), also when no measurement was active
The O key ("toggleAreaHoles" key binding): cycle an area measurement through its modes gross, net and hull (see AreaMeasurement.cycleAreaMode), skipping the modes that would not change anything. The target is the measurement being created, else the selected one; a target that is not an area measurement, or has neither openings nor a concave ring, is passed over
The measurement whose mode changed, or null when there was nothing to cycle
Measure to the references (centre lines, axis planes) of the objects instead of their surfaces, or back: a choice for an object distance before its second object is picked, a switch for a finished one or a laser (the O key). With a slot (0 the first object, 1 the second) an object distance's Centre line toggle of that one object (setReferenceMode)
Optionalslot: 0 | 1The O key: cycle the reference modes of the active or selected object distance measurement (surface / centre line per object). The area measurement's own O behaviour (toggleAreaHoles) takes precedence when it applies
The measurement being cycled (its recomputation is asynchronous), or null when there was none
Take back the last point of the running length, area, distance, angle or object distance measurement. Taking back the first point returns the tool to where it started
Whether a point was taken back
All measuring related methods are available on this class. Generally the Viewer3d has a reference to an instance of this class. There can only be one measurement "active" at a time. A measurement that is "active" is still being constructed by the user. When an active measurement is being "finished" it will stop being editable.