Constructors
Properties
Methods
- close
Connection - delay
Capping - export
ToSvg - fit
World - focus
Input - get
Allow High Dpi - get
Context Menu Status - get
Creation Parameters - get
Format Version String - get
Minimum Framerate - get
Renderer Type - get
Statistics - get
Stream Cutoff Scale - get
Streaming Mode - get
View Element - get
Viewer Version String - move
ToWindow - pause
Rendering - redraw
- register
Custom Operator - reset
- reset
Client Timeout - resize
Canvas - resume
Rendering - select
Part - set
Allow High Dpi - set
Callbacks - set
Client Timeout - set
Context Menu Status - set
Minimum Framerate - set
Server Render Quality - set
Stream Cutoff Scale - set
View Orientation - shutdown
- start
- take
Snapshot - trigger
- unregister
Custom Operator - unset
Callbacks - wait
For Idle
Constructors
constructor
-
Parameters
-
inputParams: WebViewerConfig
object containing key-value pairs for viewer to set
Returns WebViewer
-
Properties
BCFManager
animationManager
cuttingManager
explodeManager
floorplanManager
lineManager
markupManager
measureManager
model
noteTextManager
operatorManager
overlayManager
selectionManager
sheetManager
view
Methods
closeConnection
-
Disconnects the network connection when in CSR mode.
Returns void
deactivateSheets
[deprecated]
-
Deactivate sheets and only display 3D content
Returns Promise<void>
promise that resolves when the operation has completed
delayCapping
-
Delays capping processing by a fixed time interval.
Returns void
endSheetComparison
[deprecated]
-
Disables a visual comparison of two drawing sheets enabled by startSheetComparison. The
Promise
returned by that function should be waited upon before calling endSheetComparison.Returns Promise<void>
exportToSvg
-
Exports the current scene to a two-dimensional SVG representation.
Parameters
-
Optional config: SvgConfig
Allows customization of the resultant SVG.
Returns Promise<string>
A promise that resolves to the created SVG string.
-
fitWorld
-
Parameters
-
Optional duration: number
Returns Promise<void>
-
focusInput
-
Sets whether keyboard input should be directed to this Web Viewer.
Parameters
-
focus: boolean
if true, the Web Viewer will be focused and accept keyboard input, otherwise it will be blurred and not accept keyboard input
Returns void
-
getActiveSheetId
[deprecated]
-
Returns SheetId | null
gets the id of the current active sheet. null if none has been set.
getAllowHighDPI
[deprecated]
-
Returns boolean
getAllowHighDpi
-
Gets the current value for high DPI rendering
Returns boolean
current high DPI setting
getBackgroundSelectionEnabled
[deprecated]
-
Gets the current state of the background sheet.
Returns boolean
true
if enabled andfalse
otherwise.
getBackgroundSheetEnabled
[deprecated]
-
Gets the current state of the background sheet.
Returns boolean
true
if enabled andfalse
otherwise.
getContextMenuStatus
-
Returns boolean
boolean true if the context menu is active, false otherwise
getCreationParameters
-
Gets the parameters that were used to initialize this instance of the WebViewer
Returns WebViewerConfig
initial creation parameters
getCuttingManager
[deprecated]
-
Returns CuttingManager
Interface containing cutting-related methods.
getExplodeManager
[deprecated]
-
Returns ExplodeManager
Interface containing model explode-related functionality
getFormatVersionString
-
Returns the format version string.
Returns string
string containing version information for the format.
getLineManager
[deprecated]
-
Returns LineManager
Interface containing line-related methods.
getMarkupManager
[deprecated]
-
Returns MarkupManager
Interface containing markup-related methods.
getMeasureManager
[deprecated]
-
Returns MeasureManager
Interface containing measure-related methods.
getMinimumFramerate
-
Gets the minimum framerate that will be maintained by the viewer. The viewer will use various culling techniques in order to maintain the value returned.
Returns Promise<number>
Promise that is resolved when the operation has completed.
getModel
[deprecated]
-
Returns Model
Interface containing model-related methods.
getOperatorManager
[deprecated]
-
Returns OperatorManager
getOverlayManager
[deprecated]
-
Returns OverlayManager
Interface containting overlay-related methods
getRendererType
-
Gets the RendererType this viewer was created with.
Returns RendererType
the render mode.
getSelectionManager
[deprecated]
-
Returns SelectionManager
Interface containing selection-related methods.
getSheetBackgroundColor
[deprecated]
-
Gets the sheet Background Color.
Returns Color
getSheetColor
[deprecated]
-
Gets the Sheet Color.
Returns Color
getSheetIds
[deprecated]
-
Returns SheetId[]
an array of 2D SheetIds.
getSheetShadowColor
[deprecated]
-
Gets the Sheet Shadow Color.
Returns Color
getStatistics
-
Gets viewer statistics for the current rendered frame. Statistics marked with a (*) below must be calculated and will not be included in the results unless the calculateTotals parameter is true. The values of these items will be cached and only updated during the next call to this method with calculateTotals set to true.
Parameters
-
Optional calculateTotals: boolean
Forces an update of the total count elements. Please note that repeatedly calculating these items can cause a performance impact.
Returns Promise<Object>
an object containing informational key/value pairs
Statistic Name Description draw_call_count number of draw calls made when rendering the frame frames_per_second frames per second estimation triangle_count the number of triangles rendered line_segment_count the number of line segments rendered point_count the number of points rendered total_element_count(*) the total number of elements in the scene total_triangle_count(*) the total number of triangles in the scene -
getStreamCutoffScale
-
Returns the scale factor that will be applied to the streaming size cutoff. An object whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff. A value of 0 disables the cutoff.
Returns number
getStreamingMode
-
Gets the streaming mode this viewer was created with.
Returns StreamingMode
the streaming mode.
getView
[deprecated]
-
Returns View
Interface containing view-related methods.
getViewElement
-
Gets the view element for this viewer. This element contains the canvas
Returns HTMLDivElement
the view element
getViewerVersionString
-
Returns the viewer version string.
Returns string
string containing version information for the viewer.
isDrawingSheetActive
[deprecated]
-
Returns boolean
true if a drawing sheet is activated, false otherwise
moveToWindow
-
This method should be called when the viewer is being moved to a new window. An example use case would be opening a new pop up window.
Parameters
-
win: Window
the new document that this viewer will be associated with.
Returns void
-
pauseRendering
-
Pauses rendering updates for the viewer. This function is useful when performing large batches of updates and you would like the result to appear all at once.
Parameters
-
Optional callback: function
If provided, rendering will be paused, the callback will be called, and then rendering will be resumed once the callback returns or throws an exception.
-
-
Returns void
-
-
Returns DeprecatedPromise
-
redraw
-
Forces the viewer to perform a full redraw.
Parameters
-
Optional callback: function
A function to be called once the draw is complete. This is provided instead of a
Promise
to ensure the callback is called before the start of another redraw.-
-
Returns void
-
-
Returns void
-
registerCustomOperator
-
Associates a custom operator object with a system generated operatorId.
Parameters
-
operator: Operator
Returns OperatorId
an operatorId to be used for this operator.
-
reset
-
Reset the camera, visibility, and transforms to their default state
Parameters
-
Optional durationCameraTransition: number
Returns Promise<void>
Promise that resolves when the operation has completed.
-
resetClientTimeout
-
Resets the client timeout to the duration set with setClientTimeout.
Returns void
resizeCanvas
-
This method should be called after the container element is moved or resized.
Returns void
resumeRendering
-
Resumes rendering in the viewer.
Returns DeprecatedPromise
selectPart
-
Selects a part with the given Id.
Parameters
-
nodeId: PartId | null
nodeId of the part to select. Pass null to clear the selection.
-
Optional selectionMode: SelectionMode
Returns SelectionType
-
setActiveSheetId
[deprecated]
-
Sets the id of the current active sheet. This method will also isolate and fit the nodes contained in the sheet.
Parameters
-
activeSheetId: SheetId
id of the sheet which will be activated.
Returns Promise<void>
promise that resolves when the operation has completed
-
setAllowHighDPI
[deprecated]
-
Parameters
-
allow: boolean
Returns void
-
setAllowHighDpi
-
Controls rendering on high DPI displays. If true, the image will be rendered at full resolution when a high-DPI display is detected. If false, the image may be rendered at a lower resolution. The default value is false. This method may be called any time during or after the sceneReady callback has triggered.
Parameters
-
allow: boolean
controls the high DPI Setting.
Returns void
-
setBackgroundSelectionEnabled
[deprecated]
-
Sets whether the background for 2D drawings is selectable. By default it is not. 2D drawings have an invisible selection plane with a single face. Note that this setting is unaffected by the background-sheet enable setting.
Parameters
-
enabled: boolean
Returns Promise<void>
-
setBackgroundSheetEnabled
[deprecated]
-
Parameters
-
enabled: boolean
Returns Promise<void>
-
setCallbacks
-
Registers callbacks that will be called when their corresponding events occur.
Parameters
-
callbacks: CallbackMap
object with property names set to corresponding functions to be called when the event occurs.
Returns void
-
setClientTimeout
-
Sets the parameters for client driven timeout monitoring. If no input is recorded for the the duration, the viewer will disconnect and free server resources. Calling this method will reset any pending timeout duration. No timeout will occur when viewing SCS Files. The default value is to disconnect after 15 minutes, with a warning issued after 14 minutes of inactivity.
Please note: Both parameters are required.Parameters
-
timeoutDuration: number
the total time in minutes of inactivity that is allowed before a timeout event occurs
-
warningTime: number
the number of minutes before issuing a timeoutWarning event
Returns boolean
boolean value indicating whether the timeout values were sucessfully updated
-
setContextMenuStatus
-
Sets a boolean with the status of the context menu
Parameters
-
isActive: boolean
Returns void
-
setMinimumFramerate
-
Sets a minimum frame rate that will be maintained by the viewer. The viewer will use various culling techniques in order to maintain the value passed in.
Passing
0
will cause the entire scene to be drawn for every frame.Parameters
-
value: number
The frame rate for the viewer to maintain.
Returns DeprecatedPromise
Promise that is resolved when the operation has completed.
-
setServerRenderQuality
-
Sets the image quality settings for the high quality and low quality server side render. The low quality settings will be applied during model interaction (camera changes, selection, etc)
Parameters
-
jpegQualityLow: number
The JPEG quality of the low quality render frame
-
jpegQualityHigh: number
The JPEG quality of the high quality render frame
-
scaleLow: number
The scale factor for the low quality render frame
-
scaleHigh: number
The scale factor for the high quality render frame
Returns void
-
setSheetColors
[deprecated]
setStreamCutoffScale
-
Specifies a scale factor that will be applied to the streaming size cutoff. An object whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.
This value may also be set for file-based sessions. In that case, when loading an SCS file based assembly via XML, projected size will be calculated on a per-file basis using the bounding information provided in the XML. For additional information, refer to Model.loadSubtreeFromXmlBuffer.
A value of 0 will disable the cutoff. The value should be in the interval of [0.0, 2.0].
Parameters
-
value: number
Returns DeprecatedPromise
-
setViewOrientation
-
Sets the orientation of the current model view.
Parameters
-
orientation: ViewOrientation
a ViewOrientation object specifying back, front, top, etc.
-
Optional duration: number
the time in milliseconds for the model to transition to the new view orientation.
Returns Promise<void>
-
shutdown
-
Releases the resources used by the viewer. This method should be called when the viewer is no longer needed but the page is not being reloaded.
Returns void
start
-
Starts the viewer and begins the loading process
Returns boolean
startSheetComparison
[deprecated]
-
Enables a visual comparison of two drawing sheets. The nodes specified by
sheetId1
are filled with one color, the nodes specified bysheetId2
with another color, and overlapping areas are filled with a third color.Parameters
-
sheetId1: SheetId
the drawing sheet to compare against
sheetId2
-
sheetId2: SheetId
the drawing sheet to compare against
sheetId1
-
Optional config: ComparisonConfig
settings controlling the behavior of the comparison
Returns Promise<void>
-
takeSnapshot
-
Creates an Image of the current canvas
Parameters
-
Optional config: SnapshotConfig
Returns Promise<HTMLImageElement>
-
trigger
-
Parameters
-
name: "bcfLoaded"
-
id: number
-
filename: BCFName
Returns void
-
-
Parameters
-
name: "bcfRemoved"
-
id: number
Returns void
-
-
Parameters
-
name: "handleEvent"
-
eventType: HandleEventType
-
nodeIds: NodeId[]
-
initialMatrices: Matrix[]
-
newMatrices: Matrix[]
Returns void
-
-
Parameters
-
name: "handleEventEnd"
-
eventType: HandleEventType
-
nodeIds: NodeId[]
-
initialMatrices: Matrix[]
-
newMatrices: Matrix[]
Returns void
-
-
Parameters
-
name: "handleEventStart"
-
eventType: HandleEventType
-
nodeIds: NodeId[]
-
initialMatrices: Matrix[]
Returns void
-
-
Parameters
-
name: "cuttingPlaneDragStart"
-
cuttingSection: CuttingSection
-
planeIndex: number
Returns void
-
-
Parameters
-
name: "cuttingPlaneDrag"
-
cuttingSection: CuttingSection
-
planeIndex: number
Returns void
-
-
Parameters
-
name: "cuttingPlaneDragEnd"
-
cuttingSection: CuttingSection
-
planeIndex: number
Returns void
-
-
Parameters
-
name: "cuttingSectionsLoaded"
Returns void
-
-
Parameters
-
name: "redlineCreated"
-
redlineMarkup: RedlineItem
Returns void
-
-
Parameters
-
name: "redlineDeleted"
-
redlineMarkup: RedlineItem
Returns void
-
-
Parameters
-
name: "redlineUpdated"
-
redlineMarkup: RedlineItem
Returns void
-
-
Parameters
-
name: "measurementBegin"
Returns void
-
-
Parameters
-
name: "measurementCreated"
-
measurement: MeasureMarkup
Returns void
-
-
Parameters
-
name: "measurementDeleted"
-
measurement: MeasureMarkup
Returns void
-
-
Parameters
-
name: "measurementValueSet"
-
measurement: MeasureMarkup
Returns void
-
-
Parameters
-
name: "measurementShown"
-
measurement: MeasureMarkup
Returns void
-
-
Parameters
-
name: "measurementHidden"
-
measurement: MeasureMarkup
Returns void
-
-
Parameters
-
name: "noteTextCreated"
-
noteText: NoteText
Returns void
-
-
Parameters
-
name: "noteTextHidden"
-
noteText: NoteText
Returns void
-
-
Parameters
-
name: "noteTextShown"
-
noteText: NoteText
Returns void
-
-
Parameters
-
name: "walkOperatorActivated"
Returns void
-
-
Parameters
-
name: "walkOperatorDeactivated"
Returns void
-
-
Parameters
-
name: "viewCreated"
-
view: MarkupView
Returns void
-
-
Parameters
-
name: "viewDeleted"
-
view: MarkupView
Returns void
-
-
Parameters
-
name: "viewLoaded"
-
view: MarkupView
Returns void
-
-
Parameters
-
name: "contextMenu"
-
position: Point2
-
modifiers: KeyModifiers
Returns void
-
-
Parameters
-
name: "beginInteraction"
Returns void
-
-
Parameters
-
name: "endInteraction"
Returns void
-
triggerEvent
[deprecated]
-
Triggers a web viewer event
Parameters
-
eventName: string
the name of the event to trigger
-
Optional args: any[]
Returns void
-
unregisterCustomOperator
-
Removes a previously registered custom operator from the system.
Parameters
-
operatorId: OperatorId
the ID of the operator that is to be unregistered
Returns void
-
unsetCallbacks
-
Unregisters callbacks from the system. Note the actual function object passed in must be the same as the one that was registered using setCallbacks.
Parameters
-
callbacks: CallbackMap
object with property names set to corresponding functions to be unregistered.
Returns void
-
waitForIdle
-
Returns a Promise that will resolve after streaming and associated asynchronous operations complete and the scene is fully drawn.
Parameters
-
Optional config: object
-
Optional redraw?: boolean
If
false
, do not wait for rendering to finish.
-
Returns Promise<void>
-
Creates a new Web Viewer instance. You must pass in a containerId key with the ID of an element or a container element to use for your viewer. The system will create any required elements inside the supplied container.