Copy Part CATIA macro

Copy Part CATIA macro

Have you ever needed to Copy Part more times? For example when you have more instances of the same Part? In this post, I’ll show you how to make Copy Part CATIA macro for this operation. 

copy

Introduction

First of all, almost in every model, there are more instances of the same Part. So how do you make those instances and constraints for them? Are you doing it manually? Well if you do, certainly there is a better and faster way for that. Hence let’s write some code for that action. 

Additional

That was just a simple code of copy Part CATIA macro for one instance of the selected part. You can also use for loop to make more instances, just one or two lines of code. 

If the selected part has constraints you can copy those constraints or not.

assembly constraints

Furthermore here in the options tab, you can change these options. For example, now it’s enabled copy instances without the assembly constraints. So if you run previous copy Part CATIA macro, and your main part has constraints, they will not be copied. 

You can change these options with macro too.

So this code is to enable copy without constraints. We need this when we want to create constraints with macro. If they are also copied we have two constraints for the same instance. All of these options you can record with a macro. 

Also, you can add constraints to those instances. 

We make Fix constraint. For example, you can make any type of constraint. But if you don’t know how you can always record it. All inputs and declarations in this code are made from that first selection. 

Therefore users just need to select that first part and we will define it all based on it. So you can just add this second code to the first one and get a full macro. 

Finally, if you need to copy part with brake link, you can do it with this code:

If you have any issues feel free to contact me.

Read more tutorials here or download free macros here.

Leave a Reply

Your email address will not be published. Required fields are marked *