CATIA macro selection
CATIA macro selection is very important topic and concept to learn when automating CATIA processes.
CATIA macro selection is very important topic to learn when automating processes. It is ground in every macro. Hence for every action in macro you need some kind of selection. There are single and multiple one. There are also two ways to select elements. So those are user selection and search by name. Hence when you have selection you want to use that for loop control. For example if you select 4 bodies you can iterate 4 times. So in this post we will show you more examples of using selection.
Example 1: Change color
Comments are inserted in code. So you will follow and better understand it. Let’s start with simple selection code so you understand it first.
Example 2: Single selection for new add
In example 2 we want to use CATIA selection for selecting body. We want to add it to other body. For this we will use simple selection. So it means that user will be available to select only one input. As a result we should decide which selection we need for our code.
If you want test this CATIA macro code you can just copy it. So you can try to use input box to set and add name for body. You can watch my video tutorial to understand better.
This is preview of automation file. This file can help you a lot. So in this file you can find everything you need.
Example 3:Multiple selection for new add
This macro is very similar to the previous one. In contrast in this we want to use multiple selection.
Example 4: CATIA macro selection with search
Also in next example we want to show you how to make selection with search option. We will not comment same lines. Rather we will different ones.
This search option is very powerful when you define some basic names. Also it’s very easy to connect with powercopy. If you want to read more about that go to this link.
You can also read more about selection on those links.