Skip to main content
mohammada51870037
Participant
July 27, 2017
Question

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

  • July 27, 2017
  • 1 reply
  • 470 views

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 has been closed for replies.

1 reply

try67
Community Expert
Community Expert
July 27, 2017

What does the error message say?

mohammada51870037
Participant
July 27, 2017

TypeError: Invalid argument type.

Doc.exportDataObject:0:Doc undefined:Exec

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

try67
Community Expert
Community Expert
July 27, 2017

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?