Autodesk.Viewing.Extensions
Version 8 preview
This page documents a preview of the Viewer SDK v8. APIs and content can still change before the final release.
ViewCubeUi
Create the UI for the view cube.
The extension id is: Autodesk.ViewCubeUi
Examples
viewer.loadExtension('Autodesk.ViewCubeUi');
Methods
Show or hide the view cube element. This also applies to the home button.
Parameters
| show* boolean | If set to false, the view cube and the home button will become invisible. |
* Required
setViewType(viewType)
Set the viewCube view type.
Parameters
| viewType* number | One of VIEW_TYPES. |
* Required
showTriad(show)
Show the x,y,z axes of the view cube.
Parameters
| show* boolean | if set to true, the view cube axes will be shown. |
* Required
setViewCube(face)
Set the face of ViewCube and apply camera transformation according to it.
Parameters
| face* string | The face name of ViewCube. The name can contain multiple face names, the format should be "[front/back], [top/bottom], [left/right]". |
* Required
Examples
viewer.setViewCube('front top right');
viewer.setViewCube('bottom left');
viewer.setViewCube('back');
Parameters
| show* boolean |
* Required
displayViewCube(display, updatePrefs)
Display the view cube. This will not effect the home button.
Parameters
| display* boolean | if set to false the view cube element will be invisible |
| updatePrefs* boolean | update the view cube preference |
* Required
localize()
Localize the view cube
showCompass(show)
Shows or hides the view cube compass.
Parameters
| show boolean | Whether to show the compass. |
setCompassRotation(radians)
Sets the rotation of the view cube compass.
Parameters
| radians number | Angle of north in radians, relative to the front. |
refreshCube()
Refresh the view cube