ng2-adsk-forge-viewer icon indicating copy to clipboard operation
ng2-adsk-forge-viewer copied to clipboard

Seeking a way to get instance of `Autodesk` for ToolInterface implmentation

Open sonrisacc opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. I'm trying to create a tool class which extends Autodesk.Viewing.ToolInterface like this:

export class MyTool extends Autodesk.Viewing.ToolInterface {
}

then register/wrap it by an extension like this:

export class MyToolExtension extends Extension {
      private tool = new MyTool();
      
    load() {
         (this.viewer as Autodesk.Viewing.GuiViewer3D).toolController.registerTool(this.tool);
    }
}

Because I have only installed ng2-adsk-forge-viewer and "@types/forge-viewer": "^7.48.0",, it's complaining that Autodesk is undefined.

Describe the solution you'd like

I was wondering if there's a way to directly export Autodesk from ng2-adsk-forge-viewer like I do this import { Extension } from 'ng2-adsk-forge-viewer';?

Describe alternatives you've considered If there's no way to re-export Autodesk from 'ng2-adsk-forge-viewer', I might need to include a copy of Autodesk in my main repo. Any concerns/comments there?

Additional context Really appreciate your work here! Everything looks amazing so far.
Do have a non-blocker question, is the viewer in Extension class actually a GuiViewer3D(that has toolController), not just Viewer3D(that doesn't have toolController)?

Thank you tons!

FYI: I can help to contribute! But I can't find README_dev.md in this Repo, did I miss something?

sonrisacc avatar Sep 17 '21 19:09 sonrisacc