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

Toggle visibility of parts

tony manhattan
tony manhattan's picture
Registered: Jan 19 2010
Posts: 8

Hello!

So far I have always produced new views to set the visibility of parts in an assembly. But with many parts I have to create a great number of views to show for examples different configurations of an assembly.
Is there a way to toggle part visibility? I would love to creat a button where I can turn parts on/off!
Thanks a lot for any help!

UVSAR
UVSAR's picture
Expert
Registered: Oct 29 2008
Posts: 1357
You can do it with JavaScript, provided the name of the part is unique. We have some tutorials in the Learning Center that introduce the concepts of JS communication to 3D scenes:

http://www.acrobatusers.com/tech-talks

As a very basic example, if you have a single 3D viewport on a page, and in that scene there's a part named "elbow", then assigning this code to a button on your page will make it invisible:

var c3D = getAnnots3D(this.pageNum)[0].context3D;var meshNode = c3d.scene.meshes.getByName("elbow");meshNode.visible = false;

There's no tree-level wildcard option in JS, so if you want to make an entire branch invisible you have to go through the meshes in the scene and check the name of the node's ".parent" object to find which ones to change. In the download pack for our tech talk there are some utility functions to make that kind of thing simpler.
tony manhattan
tony manhattan's picture
Registered: Jan 19 2010
Posts: 8
UVSAR, thank you very much! I was hoping there was a simpler method, since sadly, I don't know JavaScript. But I will try to find people who do! Somehow I will crack this!
thanks again!