Save the Mapkey by clicking on . You can now assign a keyboard shortcut to this Mapkey by clicking on Assign .
A standard mapkey records internal Creo commands. An uses the @SYSTEM syntax to "break out" of Creo and execute commands in the Windows Command Prompt (CMD) or shell environment. The Basic Syntax
: Creo requires double backslashes ( \\ ) for file paths in the config.pro file to parse them correctly. creo mapkey os script example
To make a mapkey run an OS command, you must use the @SYSTEM keyword. This tells Creo to open a command line window in the background and run your text. Step-by-Step Example
: The OS command string must end with a semicolon inside the mapkey definition. Save the Mapkey by clicking on
In a mapkey, you must:
' Connect to running Creo session or start new CreoAsyncConnection.Connect "" An uses the @SYSTEM syntax to "break out"
This script creates a new folder called "NewFolder" on the C: drive and launches Notepad with a new file called "example.txt".
If your script takes a long time to run and you do not need to wait for its output, use the Windows start command to run it in the background: @SYSTEM start /B C:\\cad_scripts\\long_task.bat; . This hands control back to Creo instantly.