Reputation: 11
I've been playing with Autodesk Viewer API. I've got the Markup-extension loaded and I can draw Arrows with it. But I can't figure out how to change the tool to Rectangle or something else.
I've followed this tutorial but I don't know if that's up to date. There's a releated question saying that the apis have changed somehow.
Any help is appreciated.
Upvotes: 0
Views: 345
Reputation: 11
Well right after asking this I checked the source for the Markup-extension and comment there for changeEditMode says
Applicable only while in [Edit Mode]
My mistake was that I was trying to change tool mode before entering editMode.
So this works.
var markup = _viewer.getExtension("Autodesk.Viewing.MarkupsCore");
var modeRect = new Autodesk.Viewing.Extensions.Markups.Core.EditModeRectangle(markup);
markup.enterEditMode();
markup.changeEditMode(modeRect);
//markup.leaveEditMode();
Upvotes: 1