Autodesk.Viewing.Extensions
SectionExtension
new SectionExtension()
The SectionExtension provides ways to cut the geometry using planes or a cube. The extension adds a toolbar button to access the feature.
The extension id is: Autodesk.Section
Examples
viewer.loadExtension('Autodesk.Section')
Methods
toggle()
Toggles activeness of section planes.
Returns
type | description |
---|---|
boolean | Whether the section plane is active or not. |
getSectionStyle()
Returns the current type of plane that will cut-though the geometry.
Returns
setSectionStyle(style, preserveSection)
Sets the Section plane style.
Parameters
style* String | Accepted values are ‘X’, ‘Y’, ‘Z’ and ‘BOX’ (in Caps) |
preserveSection Boolean | Whether sending the current style value resets the cut planes. |
* Required
getState(viewerState)
Gets the extension state as a plain object. Invoked automatically by viewer.getState()
Parameters
viewerState* object | Object to inject extension values. |
* Required
restoreState(viewerState, immediate)
Restores the extension state from a given object. Invoked automatically by viewer.restoreState()
Parameters
viewerState* object | Viewer state. |
immediate* boolean | Whether the new view is applied with (true) or without transition (false). |
* Required
Returns
type | description |
---|---|
boolean | True if restore operation was successful. |
activate(mode)
Activates a section plane for user to interact with. It performs the same action as the UI button.
Parameters
mode* string | Accepted values are ‘x’, ‘y’, ‘z’ and ‘box’ (in lowercase) |
* Required
Returns
type | description |
---|---|
boolean | true if the activation was successful. |
deactivate()
Removes the section plane/box from the 3D canvas.