Skip to main content
mohammada51870037
Participant
Jul 27, 2017 9:10 AM UTC
Question

open an attahced pdf on click of a part in 3d model

I want to open an attached pdf when i click on a part of 3d model.

when i try host.exportDataObject({ cName: "MindSphere_GettingStarted.pdf", nLaunch: 2 }); it throws an error

this is my complete code:

//start

var myMouseHandler = function( event ) {

if ( event.isMouseUp ) {

var myMesh = null;

if ( event.hits.length > 0 ) {

myMesh = event.hits[0].target;

}

if ( myMesh != null ) {

host.exportDataObject({ cName: "MindSphere_GettingStarted.pdf", nLaunch: 2 });

}

}

}

var mouseEventHandler = new MouseEventHandler();

mouseEventHandler.onMouseDown = false;

mouseEventHandler.onMouseMove = false;

mouseEventHandler.onMouseUp = true;

mouseEventHandler.onEvent = myMouseHandler;

runtime.addEventHandler( mouseEventHandler );

This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

try67
Community Expert
Community Expert
Jul 27, 2017 9:25 AM UTC

What does the error message say?

Translate
mohammada51870037
Participant
Jul 27, 2017 10:18 AM UTC

TypeError: Invalid argument type.

Doc.exportDataObject:0:Doc undefined:Exec

===> Parameter cName.Line: 20: Code: -36(0xffffffdc): Not implemented

Translate
try67
Community Expert
Community Expert
Jul 27, 2017 11:46 AM UTC

Are you sure the name you specified is correct?

Open the file in Acrobat and execute this code from the JS-Console:

this.dataObjects

What is the output?

Translate