noobmaui.blogg.se

Catia v5 macros for drafting
Catia v5 macros for drafting












catia v5 macros for drafting

If you want to assign values to specific cells in the spreadsheet from the CATIA parameters, i.e. The lines with the Set prefix create the necessary environment, the following lines assign values to the CATIA parameters by retrieving values from specific cells in an Excel spreadsheet, last the part is updated. Then we need a couple of lines that direct the macro to the correct CATPart and then we can add all the modifications that we want. The procedure is quite simple, we insert a new module in the editor by right-clicking and selecting Insert…>Module. With the Excel connection set up and the master part prepared we can start writing our macro. In the picture below you can see which parameters I have defined to control the design.

catia v5 macros for drafting

The part I will be using is a type of T-connection, its size and position of the interfaces are of interest, as well as how many screw lugs we want to use. When all those boxes are checked we are ready to write a VBA macro and apply it to our part. Open the Visual Basic editor from the Developer tab and choose Tools>References, here we will have to check all the boxes that start with CATIA, there’s a lot of them so patience will be required. OK your way out and we can get into the Visual Basic editor. While still in the options window, go to Trust Center>Trust Center Settings…>Macro Settings and enable all macros as well as check the Trust access… box. In order to get access to the Visual Basic editor we must make sure that the Developer tab is visible, do this by going to File>Options>Customize Ribbon and check the box next to Developer.

catia v5 macros for drafting

Create as many variants of the master part as you wish Create an Excel spreadsheet to use as Human/Machine-interfaceĦ. Write a VBA macro that controls the parametersĥ. Define with parameters how the master part should be able to changeĤ. We will look at adding automation in order to remove repetitive tasks connected to creating differently sized variants of a part.ģ.

Catia v5 macros for drafting how to#

In this blog post I will show you how to connect CATIA V5 to Excel, and write a simple VBA macro, in order to take our first trembling steps towards design automation. Luckily for you this can be done, the “someone else” will be CATIA and Excel. You would like to focus on innovation and creativity, and preferably have all the routine tasks be performed by someone else. When you’re starting to become comfortable with designing in CATIA V5 you might realize that you spend a lot of time performing repetitive tasks that could be more suited for a machine.














Catia v5 macros for drafting