You are on page 1of 5

6/1/2019 Introduction to CATIA V5 Automation ~ CATIA V5 Design&Automation

Este sitio utiliza cookies de Google para prestar sus servicios y para analizar su tráfico. Tu dirección IP y user-
agent se comparten con Google, junto con las métricas de rendimiento y de seguridad, para garantizar la calidad

CATIA V5 Design&Automation
del servicio, generar estadísticas de uso y detectar y solucionar abusos.
MÁS INFORMACIÓN ACEPTAR

HOME TUTORIALS » DOWNLOADS USEFUL LINKS UNCATEGORIZED

Introduction to CATIA V5 Automation SOCIAL PROFILES


06:04 No comments

CATIA V5 is a powerful tool in the CAO field. With some work you could be able to design almost everything. But What version of CATIA do you have ?
how many time will you need, for example, to create ALL screws in your assembly ? With each type ? Each
diameter ? Hopefully a tool named VBA exist to get rid of this waste of time.
I will present you the very basics applications of using VBA macros with CATIA V5. V5R19

First of all CATIA V5 can be piloted with mainly three possible languages : V5R21
1. Visual Basic
V6R12
2. VBA
3. CATScript Other version

I choosed to use VBA for a simple reason : It allows me to use easyly Excel to pilot CATIA. That's mean I could I'm just hanging around, I don't even have
use datasheets or graphics to create Parts in CATIA V5. Moreover it offers a better interface with the user CATIA
(command button, listbox...) and a priceless programming help (automatical completion, help to find errors).
However VBA has disavantages like a weak protection and it could be difficult to export VBA macros. Vote

I suppose in the following that you have some prerequisites in VBA. If not, you can look at this article which View Results Polldaddy.com
present briefly VBA for Excel. If it's not enough, you can find plenty of tutorials in Internet.

Search
Before beginning I introduce your new best friend : the CATIA help. It's very dense and complexe but it should be
your reference. You find it here : \Catia_V5\intel_a\code\bin\V5Automation.chm. I suggest you to make immediatly Popular Tags Blog Archives
a shortcut on your desktop.

Introduction to CATIA V5
1) CATIA V5 OLE (Object Linking and Embedding) Automation
CATIA V5 is a powerful tool in the
If you want to have an interactive review in Word for example, you can use the link between CATIA and Word : CAO field. With some work you could
be able to design almost everything.
just drag and drop a CATPart on your word document and you have a picture of your part. Double-click on it and But how many time will you ne...
you can edit it in CATIA V5 (Figure 1).

CATIA Structure
What is the CATIA structure ? The
CATIA structure is quite complex and
for this tutorial, you need to open
V5Automation.chm. On the firs...

Modifiying a sketch : Examples and exercices


I told you how to add a sketch and only a sketch.
Now I present you some examples and exercices to
modify sketches. WARNING : If you want ...

Quick overview of VBA


This article recap the basics things
you can do with VBA. The code is
read from top to bottom, with loops or
not You have to totally bu...

Part Design
Well, now you can create sketches, let use them in
Part Design workbench. 1) Basic features -Creating
a pad Let's tell that your ...

3D Printer Project
I belong to the robotic club of my
engineering school and we have a
new project. It is divided in two part :
first build a 3D Printer, then ...

3D Printer : Electronical part


Finally we have printed our printed
circuit card ! It's a Gen7 (link here )
and we are now trying to weld the
composants. In the sa...
http://catiav5automation.blogspot.com/2013/05/introduction-to-catia-v5-automation.html 1/5
6/1/2019 Introduction to CATIA V5 Automation ~ CATIA V5 Design&Automation

Este sitio utiliza cookies de Google para prestar sus servicios y para analizar suWelcome
tráfico. Tu
! dirección IP y user-
agent se comparten con Google, junto con las métricas de rendimiento y de seguridad,
Welcome para
to my garantizar
blog ! First ofla
allcalidad
I will make a short
del servicio, generar estadísticas de uso y detectar y solucionar abusos. presentation : I am a french student in a Mechanical
Engineer School called Supmé...
MÁS INFORMACIÓN ACEPTAR

BLOG ARCHIVES

► 2020 ( 1 )

▼ 2013 ( 7 )
► novembre ( 1 )

► juin ( 1 )

▼ mai ( 5 )
3D Printer Project

Quick overview of VBA

Modifiying a sketch : Examples and exercices

CATIA Structure

Introduction to CATIA V5 Automation

RECENT POSTS

SAMPLE TEXT

DOWNLOAD

Picture 1 : OLE operation

2) IN- and OUT macros

a) IN process application

You have two choices to pilot CATIA.

First you can use the Visual Basic Editor included in CATIA V5 (TOOLS\MACRO\Visual Basic Editor Picture 2)
You create this way IN process application.

Picture 2 : Run the VB Editor

You have the same Macro menu as in VBA Excel where you can see all the macro you have writed. You can run,
edit, rename or delete this macro. You can also record a macro if you have a specifical need or when you did'nt
remember the right syntax. Then you can find it in the module name you have choosed.

How to add a macro as a command in a Toolbar ?

Go to Tools\customize\Commands and click on Macro. Select the macro you want and then drag and drop it in the
toolbar you wish. You can also use a personalised icon if you don't like the default icon by clicking on Show
Properties (Picture 3)

http://catiav5automation.blogspot.com/2013/05/introduction-to-catia-v5-automation.html 2/5
6/1/2019 Introduction to CATIA V5 Automation ~ CATIA V5 Design&Automation

Este sitio utiliza cookies de Google para prestar sus servicios y para analizar su tráfico. Tu dirección IP y user-
agent se comparten con Google, junto con las métricas de rendimiento y de seguridad, para garantizar la calidad
del servicio, generar estadísticas de uso y detectar y solucionar abusos.
MÁS INFORMACIÓN ACEPTAR

Picture 3 : How to add a macro on your toolbar

b) OUT process application

Otherwise, you can pilot CATIA through Excel.


Personnaly, I found this solution more effective for two reasons :

You can use Excel datas


You have more freedom (VB Editor in CATIA need a CATMain sub whereas VBA in Excel didn't)

However you have to activate the CATIA functions, propertys and types. Just check the boxes beginning by catia
in TOOL\REFERENCES (Picture 3)

http://catiav5automation.blogspot.com/2013/05/introduction-to-catia-v5-automation.html 3/5
6/1/2019 Introduction to CATIA V5 Automation ~ CATIA V5 Design&Automation

Este sitio utiliza cookies de Google para prestar sus servicios y para analizar su tráfico. Tu dirección IP y user-
agent se comparten con Google, junto con las métricas de rendimiento y de seguridad, para garantizar la calidad
del servicio, generar estadísticas de uso y detectar y solucionar abusos.
MÁS INFORMACIÓN ACEPTAR

Picture 3 : Activate the CATIA libraries in VBA Excel

However, as you aren't in CATIA VB Editor, you have to declare CATIA as Object in your sub.

You have two cases :

If CATIA is already running

The GetObject function allows to set CATIA application as the object you defined.
The code is so :

[...]
Dim CATIA As Object
Set CATIA = GetObject("CATIA.Application")
[...]

If CATIA is not running

You have to create the object using CreateObject :

[...]
Dim CATIA As Object
Set CATIA = CreateObject("CATIA.Application")
[...]

Now you are able to create your first macro, which launch CATIA if not.

sub CATRun()

Dim CATIA As Object

'In Error case CATIA is not already open

On Error Resume Next


Set CATIA = GetObject("CATIA.Application")
If Err.Number <> 0 Then
 Set CATIA = CreateObject("CATIA.Application")
 CATIA.Visible=True
End if
On Error GoTo 0

End sub

http://catiav5automation.blogspot.com/2013/05/introduction-to-catia-v5-automation.html 4/5
6/1/2019 Introduction to CATIA V5 Automation ~ CATIA V5 Design&Automation

Now you're Este


able tositio utilizaV5cookies
run CATIA de Google
through Excel. para further
Before going prestaryousus
needservicios
to have a y para analizar
su tráfico. Tu dirección IP y user-
introduction to the
agent
CATIA structure. se comparten con Google, junto con las métricas de rendimiento y de seguridad, para garantizar la calidad
del servicio, generar estadísticas de uso y detectar y solucionar abusos.
MÁS INFORMACIÓN ACEPTAR

Article plus récent Accueil

0 commentaires:

Enregistrer un commentaire

Saisissez votre commentaire…

Commentaire : Compte Google

Publier Aperçu

Inscription à : Publier les commentaires (Atom)

Copyright © 2019 CATIA V5 Design&Automation | Powered by Blogger

Design by FThemes | Blogger Theme by Lasantha - Premium Blogger Templates | NewBloggerThemes.com

http://catiav5automation.blogspot.com/2013/05/introduction-to-catia-v5-automation.html 5/5

You might also like