How to use the @bentley/imodeljs-frontend.IModelApp.tools function in @bentley/imodeljs-frontend

To help you get started, we’ve selected a few @bentley/imodeljs-frontend 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 / ui-test-app / src / frontend / plugins / MeasurePoints.ts View on Github external
this._measureNamespace!.readFinished.then(() => {
      // restart the tool.
      console.log("MeasurePoints onExecute called, args", args);
      IModelApp.tools.run("Measure.Points");
    })
      .catch((err) => { console.log(err); });
github imodeljs / imodeljs / test-apps / ui-test-app / src / frontend / appui / tooluiproviders / MeasurePoints.tsx View on Github external
public static executeCommand = () => {
    // first load the plugin
    IModelApp.tools.run("Plugin", ["MeasurePoints.js"]);
  }
github imodeljs / imodeljs / core / markup / src / Markup.ts View on Github external
public static async initialize(): Promise {
    if (undefined === this.namespace) {     // only need to do this once
      this.namespace = IModelApp.i18n.registerNamespace("MarkupTools");
      IModelApp.tools.register(SelectTool, this.namespace);
      IModelApp.tools.registerModule(redlineTool, this.namespace);
      IModelApp.tools.registerModule(textTool, this.namespace);
    }
    return this.namespace.readFinished; // so caller can make sure localized messages are ready.
  }
github imodeljs / imodeljs / ui / framework / src / ui-framework / keyinbrowser / KeyinBrowser.tsx View on Github external
private _processInputValue(inputValue: string): boolean {
    let currentKeyin = "";
    let foundTool: typeof Tool | undefined;

    if (this.state.currentToolId && this.state.currentToolId.length > 0) {
      foundTool = IModelApp.tools.find(this.state.currentToolId);
      // istanbul ignore else
      if (foundTool)
        currentKeyin = foundTool.keyin;
    }

    // istanbul ignore next
    if (inputValue !== currentKeyin) {
      const inputValueLower = inputValue.trim().toLowerCase();
      foundTool = IModelApp.tools.getToolList()
        .find((tool: typeof Tool) => tool.keyin.toLowerCase() === inputValueLower || tool.englishKeyin.toLowerCase() === inputValueLower);

      if (!foundTool) {
        this._outputMessage(UiFramework.translate("keyinbrowser.couldNotFindTool"));
        return false;
      } else {
        const currentToolId = foundTool.toolId;
        // istanbul ignore else
        if (this._isMounted)
          this.setState({ currentToolId });
      }
    }

    return true;
  }
github imodeljs / imodeljs / ui / framework / src / ui-framework / toolbar / ToolButton.tsx View on Github external
private _execute = () => {
    if (this.props.execute) {
      this.props.execute();
    } else {
      const thisTool: typeof Tool | undefined = IModelApp.tools.find(this.props.toolId);
      // istanbul ignore else
      if (thisTool)
        (new thisTool()).run();
    }
  }
github imodeljs / imodeljs / test-apps / display-test-app / src / frontend / SectionTools.ts View on Github external
      handler: () => { IModelApp.tools.run(this._toolName, ViewClipDecorationProvider.create()); setFocusToHome(); },
      parent: div,
github imodeljs / imodeljs / test-apps / display-test-app / src / frontend / Viewer.ts View on Github external
      click: () => IModelApp.tools.run("SVTSelect"),
      tooltip: "Element selection",
github imodeljs / imodeljs / test-apps / display-test-app / src / frontend / StandardRotations.ts View on Github external
        click: () => IModelApp.tools.run("View.Standard", IModelApp.viewManager.selectedView, i),
      }));
github imodeljs / imodeljs / test-apps / display-test-app / src / frontend / SectionTools.ts View on Github external
      handler: () => IModelApp.tools.run("ViewClip.Clear", ViewClipDecorationProvider.create()),
      parent: div,
github imodeljs / imodeljs / ui / framework / src / ui-framework / statusfields / SectionsField.tsx View on Github external
const handleClear = () => {
    IModelApp.tools.run(ViewClipClearTool.toolId, ViewClipDecorationProvider.create());
    setPopupOpen(false);
  };