Differences in macros between catia v5 and catia v6 or 3dexperience
-
Upload
fernando-petre -
Category
Engineering
-
view
1.422 -
download
49
Transcript of Differences in macros between catia v5 and catia v6 or 3dexperience
2017
Fernando Petre, Technical Manager, CAD/PLM Consultant
M: +40 725 155 588
Some differences in macros between
CATIA V5 and CATIA V6 or 3DEXPERIENCE
2017
Is a well known fact that most of the users would like to do some tedious and repetitive operations in CATIA
faster. One way is to use macros. Some of these can be found in CATIA installation folder. For beginning, I will
show where you can find the automation documentation for few CATIA local installations.
Dassault Systemes provided those macros (CATSCript, catvbs, catvba) as samples in order to show some
functionalities which can be achieved thru automation.
For CATIA V5 (R25 for example) the file can be found on the path
c:\Program Files\Dassault Systemes\B25\win_b64\code\bin\ and the name of the file is V5Automation.chm
For CATIA V6 (V6R2013x) the file is on the path
c:\Program Files\Dassault Systemes\B214\win_b64\code\bin\ and the name of the file is DSYAutomation.chm
For 3DEXPERIENCE 2017x (cloud version) the path is
c:\Program Files\Dassault Systemes\B419\win_b64\code\bin\ and same name like for CATIA V6
DSYAutomation.chm
2017
For those who want to start programming in CATIA V6 in 3DEXPERIENCE is good to know that macros done in
previous versions of CATIA V6 it might be possible to work also in 3DEXPERIENCE (below is a screen capture
from DS documentation file). .
2017
In order to notice the differences between the number of examples in CATIA V5 and V6, I copied in other
separate folders the samples provided in installation path but only CATScripts and catvbs for V5R25 (B25) and
3DEx 2017x cloud (B419).
The differences between the number of provided samples can be very easy observed in this screen capture.
V5R25 3DEx 2017x
cloud
2017
I will use for exemplification the macro named
Drawing_Titleblock_PlyBook.CATScript .
Because the macro editor is not so friendly from
visual point of view, I’ve done some modifications
to a popular free portable text editor named
SCITE.
If you choose to open in this enhanced text
editor, you will loose the other advantages
coming from the original CATIA VB Editor (object
browser, insert object resolution…)
The macro used for example is looking like here
(V5 macro version). Is a long macro with over
1100 lines which will create a specific frame and
a title block.
2017
Another advantage of SCITE is that you can configure
and run the macro directly from the dropdown menu or
simply pushing F5 key.
In CATIA VB Editor you can search the
objects. This is not possible in SCITE editor.
2017
Running the macro in CATIA V5R25 (directly from SCITE as I preferred), we will get the frame and the
title block.
2017
To compare codes from V5 with V6 (v6r2013x), I will use Compare plug-in from Notepad++ , which will show
us differences. Area with differences is marked below.
V5 V6
2017
In 3DEXPERIENCE 2017x (cloud) I will do few customization in order to easy
the work. First I will run from the web interface one of the preferred Favorite
Apps , Drafting App. The Drafting rich app will be launched.
2017
I will run the Action Pad button and I will customize a little bit, placing the Macros and Fit All In buttons inside .
2017
Running the macro Drawing_Titleblock_PlyBook.CATScript will give us the frame and the title block in 3DEx
Drafting App
2017
But….to have this result running the macro, you need to modify the code, even if it was working in CATIA V6.
You can see the differences between those two codes on right side, in the blue zones the code is the same for
3DEx 2017x cloud and v6r2013x along whole macro.
3DEx
2017x
cloud
V6
2017
Macro was created in 3DEx by using Create
button. Using Edit button you can open the
new created macro and create effectively the
macro eventually by pasting code from another
macro inside and modifying in order to not
have any errors.
2017
Using again Notepad++ we can see differences in another macro comming from samples provided by
Dassault Systemes, CATIASelection_1.CATScript. In the case of this macro, even if the macro was provided
as sample in the installation folder for B419 (3DEx), the code has to be corrected (in screen capture the code
is not corrected).
3DEx V5
2017
All macros are saved in the database in V6, in a Macro library. The library can be searched and accessed like
in the picture bellow.
2017
Information about differences brtween V5 and V6 code can be found in the documentation. A simple example
can be seen here.
2017
Another example can be found
here.
As a conclusion, a macro
which will run very well in V5
will not run as it was written in
V6. There are just few cases
when you will be able to do it.
Users must check their code
to see if this will accomplish
the new automation objects,
methods, and properties
available in 3DEXPERIENCE.
2017
Thank you!