These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Select node

ekschperte
ekschperte's picture
Registered: Jun 12 2010
Posts: 29
Answered

Hello,
 
is there a way to select / highlight a node in a 3d annotation with JS?
I have a node with the name "testnode" and I tried it that way:
 
var selection = "testnode";
c3d().scene.selectedNode = c3d().scene.nodes.getByName(selection);
 
function c3d(){
return getAnnots3D(0)[0].context3D;
}
 
This code highlights my node, BUT just for a millisecond. The bounding box around the node is been displayed very short and then it disappears. :-(
What is the problem here? If I select the node manually in the Adobe menu, everything is fine...
 
Please help me! :-)
Steven

My Product Information:
Acrobat Standard 9.3.1, Windows
UVSAR
UVSAR's picture
Expert
Registered: Oct 29 2008
Posts: 1357
Are you disabling the default selection handler? If not, it will fight your code for control and win.

runtime.overrideSelection = true;


ekschperte
ekschperte's picture
Registered: Jun 12 2010
Posts: 29
Hi,

yes I am disabling the default selection event handler with:
c3d().runtime.overrideSelection = true;
But that has no effect! :-( Again the bounding box flashes shortly and disappears afterwards... Very strange...

console.println(c3d().scene.selectedNode); tells me, that a node is selected (Console output: [object Mesh]). But the node is NOT selected...
ekschperte
ekschperte's picture
Registered: Jun 12 2010
Posts: 29
OK, I found my solution.
I had a Flash button which fires the Acrobat 3D-selection event.
It was just a timing issue. I changed the Actionscript-code from
doSelection(); to
setTimeout(doSelection, 150);

Now everything works and the object is selected. :-)