Skip navigation
Currently Being Moderated

Link Tool in 3D PDF - possible?

Dec 3, 2010 6:17 AM

I think I already have this question answered for myself (I think the answer is no), but I wanted confirmation from more experienced users than myself.

 

Is it possible to use the link tool in a 3D pdf?  I have successfully linked to a 3D pdf, but I would like the ability to link from the 3D pdf to elsewhere in the document - or possible to activate a javascript command.

 

Here's what I have - screenshot below - a 3D pdf of a machine.  I would like the ability to have the end-users of this machine, look at this PDF, click on a specific part (either in the model or from the tree on the left) and either take them to a detail drawing of the part - or initiate a "mailto".  The goal here is to make it easier for customers to identify and order replacement parts.

screenshot-3D.jpg

BTW, I am running Windows 7 64-bit, and Adobe Acrobat 9 Pro Extended Version 9.4.1

 
Replies
  • Currently Being Moderated
    Oct 23, 2011 9:48 AM   in reply to andspence

    You must use mouse_event_handler.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 5:56 AM   in reply to andspence

    Hi,

     

    i have the same problem.

    Did you solve it ?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 6:10 AM   in reply to andspence

    I do not have a solution. But i´m working on. I want to have a online documentation for the endusers as well as a online ordering system. But i´m a mechanical designer, not a software developer.

    I also tried some professional help, but they don´t want or have no time. Now my daughter, which is a software developer, will support me. But she is young and just finished her study.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 9:24 AM   in reply to andspence

    To detect a selection in the 3D scene itself you must capture the mouse click and analyze if there is anything underneath it (there may be nothing, there may be a stack of meshes).

     

    Foe example, add this JS code to your 3D scene (place it in a .js file and add it using the Advanced Properties panel for the 3D annotation) - it pops an alert with the name of the mesh, but you can easily change it to open a URL by calling host.app.launchURL() instead.

     

     

    runtime.overrideSelection = true; // optional line to disable the default red highlight
    
    var myMouseHandler = function( event ) {
        if ( event.isMouseUp ) {
            var myMesh = null;
            if ( event.hits.length > 0 ) myMesh = event.hits[0].target;
            if ( myMesh != null ) {
                host.app.alert("You clicked on " + myMesh.name);
                }
        }
    }
    var mouseEventHandler = new MouseEventHandler();
    mouseEventHandler.onMouseDown = false;
    mouseEventHandler.onMouseMove = false;
    mouseEventHandler.onMouseUp = true;
    mouseEventHandler.onEvent = myMouseHandler;
    runtime.addEventHandler( mouseEventHandler );
    

     

    Note that you can check for a double-click via the event.isDoubleClick property.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2012 8:15 AM   in reply to Dave Merchant

    thanks a lot. I have added this JavaScript with rigthclick -> Properties -> 3D -> Script and it works.

     

    But running this with doubleClick does not work:

     

     

    runtime.overrideSelection = false; // optional line to disable the default red highlight

     

    var myMouseHandler = function( event ) {

        if ( event.isDoubleClick ) {

            var myMesh = null;

            if ( event.hits.length > 0 ) myMesh = event.hits[0].target;

            if ( myMesh != null ) {

                host.app.alert("You clicked on " + myMesh.name);

                }

        }

    }

    var mouseEventHandler = new MouseEventHandler();

    mouseEventHandler.onMouseDown = false;

    mouseEventHandler.onMouseMove = false;

    mouseEventHandler.onMouseDoubleClick = true;

    mouseEventHandler.onEvent = myMouseHandler;

    runtime.addEventHandler( mouseEventHandler );

     

     

    And is it possible to access from this JavaScript a function of the document-JavaScript?

    I tried to call the function like:

     

     

    runtime.overrideSelection = true; // optional line to disable the default red highlight

     

    var myMouseHandler = function( event ) {

        if ( event.isMouseUp ) {

            var myMesh = null;

            if ( event.hits.length > 0 ) myMesh = event.hits[0].target;

            if ( myMesh != null ) {

                host.app.alert("You clicked on " + myMesh.name);

                mydocumentFunction();

                }

        }

    }

    var mouseEventHandler = new MouseEventHandler();

    mouseEventHandler.onMouseDown = false;

    mouseEventHandler.onMouseMove = false;

    mouseEventHandler.onMouseUp = true;

    mouseEventHandler.onEvent = myMouseHandler;

    runtime.addEventHandler( mouseEventHandler );

     

    but this does not work.

     

    Calling a document-JavaScript function from a button works with mydocumentFunction(); but not

    out of the JavaScript from the 3D scene.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 1:53 PM   in reply to PeterKorz

    You need to use host.mydocumentFunction()

     

    The double-click mouse event handler doesn't work, sorry.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points