Oleg
Oleg

Reputation: 1

Failed calling executeUserFunction with error {"instanceTree":null,"maxTreeDepth":0}

After upgrading of Autodesk Forge Viewer from v6.5 to v7.11 new console error start to appear every time when DWG loaded:

Failed calling executeUserFunction with error {"instanceTree":null,"maxTreeDepth":0}

LMV../src/logger/Logger.js.Logger._reportError  @   viewer3D.js:75372
(anonymous) @   Hyperlink.js:857
Promise.catch (async)       
HyperlinkTool.loadHyperlinksF2d @   Hyperlink.js:854
HyperlinkTool.loadHyperlinks    @   Hyperlink.js:805
HyperlinkTool.activate  @   Hyperlink.js:622
ToolController.activateTool @   viewer3D.js:83795
Autodesk.Extensions.Hyperlink../extensions/Hyperlink/Hyperlink.js.HyperlinkExtension.load   @   Hyperlink.js:192
loadExtensionLocal  @   viewer3D.js:26330
(anonymous) @   viewer3D.js:26245
Promise.then (async)        
loadExtension   @   viewer3D.js:26228
(anonymous) @   viewer3D.js:62886
setTimeout (async)      
LMV../src/gui/GuiViewer3D.js.GuiViewer3D.createUI   @   viewer3D.js:62874
createUI    @   viewer3D.js:62737
(anonymous) @   viewer3D.js:62749
setTimeout (async)      
onSuccessChained    @   viewer3D.js:62744
_ref2   @   viewer3D.js:33850
onParse @   viewer3D.js:49394

According to stacktrace it fails to execute function specified in a string variable:

function userFunction(pdb) { 
                var hyperlinkExists = false;
                pdb.enumAttributes(function(i, attrDef, attrRaw) {
                    var name = attrRaw[0];
                    if (name === 'hyperlink') {
                        hyperlinkExists = true;
                        return true;
                    }
                });
                return hyperlinkExists;
            }

With disabled Autodesk.Hyperlink extension it works well without any errors. Is it a bug that is not fixed yet? It would be good to have a sample DWG with hyperlinks, because it's not clear how to test hyperlinks as well.

Upvotes: 0

Views: 319

Answers (1)

Bryan Huang
Bryan Huang

Reputation: 5342

With disabled Autodesk.Hyperlink extension it works well without any errors. Is it a bug that is not fixed yet?

Yes it's a known issue - before that's fixed be sure to have the Hyperlink switched off with:

 new Autodesk.Viewing.GuiViewer3D(container, {disabledExtensions:{hyperlink:true}})

Stay tuned to our official blog for release notes of upcoming versions - this should get fixed soon...

Upvotes: 0

Related Questions