7 Replies Latest reply on Jul 27, 2017 5:42 AM by try67

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

    mohammada51870037

      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 );