The Viewer does actually support vertical toolbars - see function ToolBar(id, options)
in viewer3D.js that has option alignVertically
, and if that's true, it simply adds class adsk-toolbar-vertical
to it.
One of the simplest ways to make the toolbar vertical is to create an extension that adds the same class to the toolbar once it has been created:
class VerticalToolbarExtension extends Autodesk.Viewing.Extension {
onToolbarCreated(toolbar) {
toolbar.addClass("adsk-toolbar-vertical");
}
}
Autodesk.Viewing.theExtensionManager.registerExtension('VerticalToolbarExtension', VerticalToolbarExtension);
let viewerDiv = document.getElementById('MyViewerDiv');
viewer = new Autodesk.Viewing.GuiViewer3D(viewerDiv,{extensions: ["VerticalToolbarExtension"]});
viewer.start();
viewer.loadDocumentNode(doc, viewables[0]);

I assume you are having issues because you are recreating the toolbar? In which case you would need to make sure that everything is as the Measure
tool expects it. You can check what it's trying to do when you click the Measure
button by looking at the MeasureExtension.prototype.enterMeasurementMode
function in Measure.js