autodesk-forgeautodesk-viewerautodesk-model-derivative

Autodesk DataVisualisation API error when adding viewableData


Autodesk.Datavisualisation examples gives me error at:

        dataVizExtn.addViewables(viewableData);

It says that "addViewables" does not exist for type 'Extension' I've declared dataVizExtn as

const dataVizExtn = await this.viewer.loadExtension("Autodesk.DataVisualization");

Using the latest forge viewer 7.9*


Solution

  • I solved by type casting the extension like so:

    viewer.loadExtension('Autodesk.DataVisualization').then((dataVizExtn: any) => {
        dataVizExtn.addViewables(viewableData);
    });