How to use the @bentley/imodeljs-markup.MarkupApp.markupSelectToolId function in @bentley/imodeljs-markup

To help you get started, we’ve selected a few @bentley/imodeljs-markup examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imodeljs / imodeljs / test-apps / display-test-app / src / frontend / Viewer.ts View on Github external
if (MarkupApp.isActive) {
      // NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
      const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
      if (startMarkupSelect) {
        IModelApp.toolAdmin.startDefaultTool();
        return true;
      }
      MarkupApp.props.result.maxWidth = 1500;
      MarkupApp.stop().then((markupData) => {
        if (undefined !== markupData.image)
          openImageDataUrlInNewWindow(markupData.image, "Markup");
      }).catch((_) => { });
    } else {
      MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
      MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
      MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
    }

    return true;
  }
}
github imodeljs / imodeljs / test-apps / display-test-app / src / frontend / Viewer.ts View on Github external
public run(_args: any[]): boolean {
    const vp = IModelApp.viewManager.selectedView;
    if (undefined === vp)
      return true;

    if (MarkupApp.isActive) {
      // NOTE: Because we don't have separate START and STOP buttons in the test app, exit markup mode only when the Markup Select tool is active, otherwise start the Markup Select tool...
      const startMarkupSelect = IModelApp.toolAdmin.defaultToolId === MarkupApp.markupSelectToolId && (undefined === IModelApp.toolAdmin.activeTool || MarkupApp.markupSelectToolId !== IModelApp.toolAdmin.activeTool.toolId);
      if (startMarkupSelect) {
        IModelApp.toolAdmin.startDefaultTool();
        return true;
      }
      MarkupApp.props.result.maxWidth = 1500;
      MarkupApp.stop().then((markupData) => {
        if (undefined !== markupData.image)
          openImageDataUrlInNewWindow(markupData.image, "Markup");
      }).catch((_) => { });
    } else {
      MarkupApp.props.active.element.stroke = "white"; // as an example, set default color for elements
      MarkupApp.markupSelectToolId = "Markup.TestSelect"; // as an example override the default markup select tool to launch redline tools using key events
      MarkupApp.start(vp); // tslint:disable-line:no-floating-promises
    }

    return true;