Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ViewerActions aims to document the viewer actions that can be triggered using the Viewer3DM.doAction() function. Availability of these actions might change over time. All actions described here can be triggered by passing a single string argument.

Start a measurement

To start measurement, you must first know the code of the measurement mode you want to start.

Use these steps to determine the code of a measurement mode :

  1. Attach a listener to the Viewer3DM.onMeasureStateChanged signal.
  2. Start a measurement in the viewer (interactively).
  3. Look at the mode property of the MeasureState instance provided as payload to the Viewer3DM.onMeasureStateChanged signal handler.

Pass this string as first argument : startMeasure:<mode> where <code> is the measurement mode.

Clear a measurement

Pass this string : clearMeasure.

Stop current measurement

Pass this string : stopMeasure.

Set the measurement technique

Pass this string : setSetting:measureTechnique:<technique>.
Replace <technique> by one of the constants starting with MEASURE_TECHNIQUE_.
Example : doAction("setSetting:measureTechnique:4") will set the measure technique to forward intersection.

Start the overlay object select function

Pass this string : startOverlayObjectSelect

Hide visibility of the sidebar

Pass this string : setSetting:sidebarVisible:false

Set position of the main sidebar

Pass this string : setSetting:sidebarPosition:right
Possible values are 'left' or 'right'.

Toggle fullscreen

Pass this string : toggleFullscreen
Enter or exit fullscreen mode.

ContextShare Reality Data : Setup connection parameters

Using actions, ContextShare reality data resources can also be opened or closed in an open workspace.
Before opening, connection parameters need to be set :

Pass this string : setContextShareService

Provide the following arguments :

  1. The service URL. For example "https://qa-connect-realitydataservices.bentley.com/"
  2. The token provider. This value can be either a real token (type string) or a function with signature () => Promise<string>.

When providing a token string, and the token has a short life-span, this action should be repeated before the token expires.

Example: doAction("setContextShareService",AList.fromArray([serviceURL,token])) (where both serviceURL and token are strings).
Example2: doAction("setContextShareService",AList.fromArray([serviceURL,getAccessToken])) (where getAccessToken is a function returning a Promise to a string).

ContextShare Reality Data : Open a Resource

Pass this string : openContextShareResource

Provide the following arguments :

  1. projectId (can be null, but not recommended)
  2. instanceId

ContextShare Reality Data : Close a Resource

Pass this string : closeContextShareResource

Provide the following arguments :

  1. projectId (can be null, but not recommended)
  2. instanceId

Hierarchy

  • ViewerActions

Index

Constructors

Properties

MEASURE_TECHNIQUE_3D_MEASUREMENT: string = "9"

Identifies the "3D Measurement" measure technique.

MEASURE_TECHNIQUE_DEM_INTERSECTION: string = "3"

Identifies the "DEM Intersection" measure technique.

MEASURE_TECHNIQUE_FLOATING_MARK: string = "8"

Identifies the "Floating Mark" measure technique.

MEASURE_TECHNIQUE_FORWARD_INTERSECTION: string = "4"

Identifies the "Forward Intersection" measure technique.

MEASURE_TECHNIQUE_GROUND_SURFACE_INTERSECTION: string = "6"

Identifies the "Ground Surface Initersection" measure technique.

MEASURE_TECHNIQUE_MESH_INTERSECTION: string = "7"

Identifies the "Mesh Intersection" measure technique.

MEASURE_TECHNIQUE_POINT_CLOUD_CLOSEST_POINT: string = "0"

Identifies the "Closest point" measure technique.

MEASURE_TECHNIQUE_POINT_CLOUD_FLAT_SURFACE_INTERSECTION: string = "1"

Identifies the "Flat Surface Intersection" measure technique.

MEASURE_TECHNIQUE_POINT_CLOUD_RIDGES_AND_CORNERS_INTERSECTION: string = "2"

Identifies the "Ridges & Corners Intersection" measure technique.

MEASURE_TECHNIQUE_REFERENCE_PLANES_INTERSECTION: string = "5"

Identifies the "Reference Planes Intersection" measure technique.