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
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
| type | description |
|---|---|
| null, string | Either “X” or “Y” or “Z” or “BOX” or null. |
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. |
getState(viewerState)
Gets the extension state as a plain object. Invoked automatically by viewer.getState()
Parameters
| viewerState* object | Object to inject extension values. |
restoreState(viewerState)
Restores the extension state from a given object. Invoked automatically by viewer.restoreState()
Parameters
| viewerState* object | Viewer state. |
Returns
| type | description |
|---|---|
| boolean | True if restore operation was successful. |
setSectionBox(box)
Set a section box around the passed in box. This method will also enable the section tool.
Parameters
| box* | used to set the section box. |
setSectionPlane(normal, point, enableRotationGizmo)
Place a section plane on the Intersection. This method will also enable the section tool.
Parameters
| normal* | plane normal. |
| point* | position to place the plane. |
| enableRotationGizmo* |
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) |
Returns
| type | description |
|---|---|
| boolean |
|
deactivate(keepCutPlanes)
Removes the section plane/box from the 3D canvas.
Parameters
| keepCutPlanes* | keep existing cut planes when deactivating the tool. Default is false. |
Returns
| type | description |
|---|---|
| boolean |
|