Skip to content

Seeking a way to get instance of Autodesk for ToolInterface implmentation  #46

Description

@sonrisacc

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions