Wednesday, July 14, 2010

How do you write a CATIA CATScript Macro?


A question I often get asked is "how do you create vba macros in Catia?" One solution is to write a script. No, not a script for a movie, a CATScript file! To create a CATScript macro for CATIA open Notepad and write your code, then save the file with whatever name you want and type extension .CATScript instead of .txt. Here is a simple CATScript you can use as an example. This CATScript will tell you which version of Catia you are currently using, including the service pack number. Copy and paste the code into Notepad then save as CatiaVersion.CATScript.


 

Sub CATMain()

Set SystemConfiguration1 = CATIA.SystemConfiguration

Msgbox "CATIA V" & SystemConfiguration1.Version & " R " & SystemConfiguration1.Release & " sp " & SystemConfiguration1.ServicePack
End Sub


Now you are on your way to writing your own CATScript macros and automating simple and repetitive processes!

Learn how to write CATScript macros Lesson 1.

Learn how to write CATIA CATSCRIPT MACROS

No comments:

Post a Comment

I'd love to hear from you!