CATIA V6 Automation: Visual Studio Tools for Applications

One of the main changes going from programming macros in CATIA V5 to CATIA V6 is that the data model replaces the document-centric model relying on files with a product/representation model relying on a database and client/server architecture. In V6, documents and files are replaced with product references and instances. There are new robust query and save operations as well as a unique entity-relation based data model that reduces storage size. Parts now support multiple representations enabled through isolation between the part reference and its shape.

V6 macros are saved and accessed from macro libraries stored in PLM server database. You can create a V6 macro for each V5 macro processed. V5 VBA should first be exported from V5. V6 macros cannot be saved in representations. Review, modify, and test code. Any objects whose types derives from Document in V5 should be replaced.

Supported Scripting Languages in CATIA V6

Scripting languages supported in V5 are still supported in V6, including:

  • CATScript (typed variables)
  • Visual Basic Scripting Edition – VBScript (variant variable)
  • Visual Basic for Applications – VBA
  • Supports both VB.net and C# languages
  • New in V6 is VSTA – Visual Studio Tools for Applications

catia v6 macros

Visual Studio Tools for Applications (VSTA)

VSTA provides a development framework and a light version of the Visual Studio Integrated Development Environment (IDE). VSTA provides .NET data access capabilities, where VBA is limited to COM based data access. The VSTA runtime works in both 32-bit and 64-bit client and server environments. VSTA provides a more powerful customization toolset than VBA, CATScript, or VBScript. VSTA supports VB.net and C# languages

  • Create a VSTA library
  • Tools>Macro>Macros>Macro libraries
  • Select PLM VSTA Projects from Library Type then Create new library…C# or VB.net
  • V6 automation documentation: launch DSYAutomation.chm. This will show you the V6 object model.

To learn more about programming in CATIA V6 and if your V5 macros will translate, read our article here.

5 Comments

Add a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.