Quick Tips: How to run a macro on CATIA V5 open

You can start CATIA and request that a macro is executed as soon as CATIA is started using the -macro option followed by the full path of the macro you want to run:

CNEXT -macro P:\Users\MyMacros\MacroToRun.CATScript

For example, this macro would run the CATMain function defined in the MacroToRun.CATScript file.

Macros can however be stored in other macro libraries like catvba documents or any other V5 documents like CATPart or CATProduct documents. You can use the following syntax to run the CATMain function defined in the myMacro macro of the myDocument document:

CNEXT -macro myDocument.catvbamyMacro

CNEXT -macro myDocument.CATPartmyMacro

CATIA sessions launched this way will remain active after the end of the macro unless you explicitly end it in the macro using the CATIA.Quit method.

Common paths for CNEXT.exe are C:|Program Files|Dassault Systemes|B17|intel_a|code|bin|CNEXT.exe

3 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.