Pro/ENGINEER WizardsDOS Batch Scripting on Steroids
By Rich Becher, Carrier Corporation
There are many ways to automate time-consuming tasks within the Pro/ENGINEER environment. The approaches that seem to work best, however, are simple, to the point, and get the job done without a 100-page training guide.
Creating a "Wizard"-type interface meets all these criteria and can be easily adopted by your Pro/ENGINEER community…and even by users with no Pro/ENGINEER knowledge. A Wizard UI is so easy to use that it virtually eliminates the need for training. And in certain cases, Pro/ENGINEER Wizards can be used as an alternative to customized Pro/TOOLKIT apps.
In the example presented here, a Wizard UI leverages Pro/ENGINEER macros accessing MS-DOS batch scripts automating the creation of sheetmetal flat patterns.
The 1-2-3 of Wizardry
1. Pro/ENGINEER Mapkey
The process starts out with a simple Pro/ENGINEER macro. In this case, the macro accesses or “calls” a MS-DOS batch script. To create this macro, select the OS Script tab from the Record Mapkey dialog. Enter the required information and save the mapkey.
The resulting Pro/ENGINEER mapkey should look like this:
Note the additional syntax for the OS command “@SYSTEM” as well as the “\” around the paths.
2. MS-DOS Batch
Batch scripting is not a complex "programming language" and is inherent to any Windows (2000/XP) platform. Batch scripts require NO compiling and will run on any Windows client without any special software or configuration.
In this step, you define the types of questions to ask the end user via a MS-DOS batch script. The script processes the user input and programming logic then determines additional questions to ask until all required user input is gathered and processed.
3. Wizard UI
The Wizard UI used for these examples uses freeware called Wizard’s Apprentice or WizApp (available at http://wizapp.sourceforge.net). This self-contained, executable Visual Basic app allows you to ask questions from a MS-DOS batch script file using Windows dialog boxes in the so-called Wizard stylelarge dialogs asking one question at a time, with a Back button, a Next button and a Cancel button.
In the sample below, WizApp provides an UI asking which Wall Type to use as the first feature for a sheetmetal part. Once all questions have been answered, a Pro/ENGINEER mapkey is created on the fly and executed in Pro/ENGINEER, creating the sheetmetal part per the user’s input.
Sample Start Templates Wizard
Sample Pro/ENGINEER Wizards
Start Templates. Leverage company standard templates.
tubeEZRouter. Prompts end user for Start and End points of copper tubing design using Pro/PIPING module. Creates tube part and drawing including Bend Table.
Sheetmetal Flat Generator. Creates DXF or IGES flat pattern of a sheetmetal part. Auto email including resulting DXFs in a ZIP file. Can run in no-graphic mode.
Blank Size. Calculates XYZ envelope of any part (i.e., sheetmetal flat blank size)
File Zipper. Creates ZIP file of current object and saves to hard drive.
PDF Batch. Batch processes PDF creation of drawings, layouts, reports, parts and assemblies. Can batch process an entire Pro/INTRALINK Workspace as well as an entire folder when working outside of Pro/INTRALINK (i.e., stand-alone Pro/ENGINEER).
Maintenance Tip
Maintaining Pro/ENGINEER Wizards typically means updating any Pro/ENGINEER mapkeys that are due to UI changes in Pro/ENGINEER.
Rich Becher is a mechanical engineer in the Engineering Information Systems division of Carrier Corporation.