REM Log it echo %DATE% %TIME% - Released %PART_NUMBER% Rev %REV% >> \SERVER\LOGS\release.log exit /b 0
Run complex data manipulation scripts outside of Creo's internal scripting limits. Creo Mapkey OS Script Example: Step-by-Step
This example copies the currently active workspace file to a backup directory on your local machine. The Batch Script ( backup_model.bat )
: This tells Windows to copy all Creo part files to the new folder. Running Advanced Scripts creo mapkey os script example
mapkey .f @MAPKEY_LABELOpen Work Dir in Explorer;\ mapkey(continued) @SYSTEM start explorer.exe "."; Use code with caution. Example: Zip and Email Deliverables
mapkey $F12 @MAPKEY_NAMERelease to MFG;\ ~ Command `ProCmdModelSaveAs` ;\ ~ Select `file_saveas` `type_option` 1 `STEP`;\ ~ Open `file_saveas` `ph_list.Filelist`; \ ~ Select `file_saveas` `ph_list.Filelist` 1 `C:\CREO_EXPORTS\current.step`;\ ~ Command `ProCmdFileSave` ;\ ~ Command `ProCmdPrint` ;\ ~ Select `print_dlg` `pdf_export_btn` 1 ;\ ~ Activate `print_dlg` `OK` ;\ ~ Delay 1 ;\ ~ Command `ProCmdUtilSystem` `system("C:\scripts\release_to_manufacturing.bat &model_name &pro_mp_revision")`;\ ~ Command `ProCmdFileEraseNotDisp` ;
: Remember that while Windows paths aren't case-sensitive, mapkey shortcuts themselves are. If you'd like, I can help you: REM Log it echo %DATE% %TIME% - Released
To help refine this automation for your specific workflow, let me know: What is your Creo workstation running on?
This mapkey saves the current drawing and then runs a batch file located in your working directory called backup_drawing.bat .
Record a Mapkey named PDFR (PDF Release): Running Advanced Scripts mapkey
For complex data processing (CSV formatting, database uploads), Python is superior.
Save the following code as C:\Creo_Scripts\creo_cleanup.bat . This script creates a backup directory, moves generated deliverables, and deletes old Creo iteration files (e.g., part.prt.1 ).
: The OS command, such as start "path" , call script.bat , or powershell.exe .
' Copy current date and time into Notepad file Dim dateTime dateTime = Now() Dim fsoFile Set fsoFile = fso.OpenTextFile(desktopPath & "\project_notes.txt", 8, True) fsoFile.WriteLine dateTime fsoFile.Close
You can chain DOS commands to perform file operations.