This is a continuation of my CATIA macro exercise where you previously searched for a specific piece of geometry by name. Now we are going to use selection and search to hide or unhide geometry. When a user runs the program, they will type a name of some piece of geometry into the input box that pops up, such as “Hole Center.” The code will select all geometry named “Hole Center.” The program will thenun hide all the hole centers.

1. Use the code from the previous Search By Name exercise

2. Declare a visPropertySet

3. Set the visPropertySet as the properties of the selection

4. Show (or unhide) the selected geometry

5. Clear the selection

To see the complete code and compare it to what you’ve come up with, download the CATIA CATScript from the free downloads page. If you are unable to get the CATScript to work, read my article on what to do when you get stuck. Once you get the CATIA macro to work change it to hide the selected geometry. How do we know what the syntax is? Use the object browser and help files.  For more exercises and examples download VB Scripting for CATIA V5 today.