CATIA macro selection
CATIA macro selection is a very important topic and concept to learn when automating CATIA processes.
CATIA macro selection is a very important topic to learn when automating processes. It is ground in every macro. Hence for every action in a macro, you need some kind of selection. There are single and multiple ones. There are also two ways to select elements. So those are user selection and search by name. Hence when you have the 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 selection usage.
Example 1: Change color
Comments are inserted in code. So you will follow and better understand it. Let’s start with a 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 the body. We want to add it to another body. For this, we will use a simple selection. So it means that a 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 to test this CATIA macro code you can just copy it. So you can try to use an input box to set and add a name for the body. You can watch my video tutorial to understand better.
This is a preview of the 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 the next example, we want to show you how to make a selection with a search option. We will not comment on the 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.