41
Automating Pro/ENGINEER No programming skills nor money required Olaf Corten Fico BV

Corten We2009 Final Eindhoven

Embed Size (px)

Citation preview

Page 1: Corten We2009 Final Eindhoven

Automating Pro/ENGINEERNo programming skills nor money required

Automating Pro/ENGINEERNo programming skills nor money required

Olaf Corten

Fico BV

Olaf Corten

Fico BV

Page 2: Corten We2009 Final Eindhoven

This presentationThis presentation

Why Automate?

Which solutions are available?

Focus on free solutionswith no programming knowledge needed

– Mapkeys, trailfiles, Pro/BATCH

– 3rd party tools: ProTrail and sBatch

• Installation

• Usage

• Examples

Why Automate?

Which solutions are available?

Focus on free solutionswith no programming knowledge needed

– Mapkeys, trailfiles, Pro/BATCH

– 3rd party tools: ProTrail and sBatch

• Installation

• Usage

• Examples

Page 3: Corten We2009 Final Eindhoven

Why Automate?Why Automate?

Customize and extend the Pro/ENGINEER user interface with seamlessly embedded custom processes

Integrate expert systems and knowledge-based applications into the Pro/ENGINEER environment

Create automated, single-use, or derived designs by external manipulation of geometric and parametric constraints

Improve product quality with design rule verification based on inputs from external solutions

Perform tedious, routine, time-consuming and compute-intensive tasks

– Creating deliverables (plotfiles, cadfiles, BOM’s, mass-properties, images, renderings)

Customize and extend the Pro/ENGINEER user interface with seamlessly embedded custom processes

Integrate expert systems and knowledge-based applications into the Pro/ENGINEER environment

Create automated, single-use, or derived designs by external manipulation of geometric and parametric constraints

Improve product quality with design rule verification based on inputs from external solutions

Perform tedious, routine, time-consuming and compute-intensive tasks

– Creating deliverables (plotfiles, cadfiles, BOM’s, mass-properties, images, renderings)

Page 4: Corten We2009 Final Eindhoven

How can we automate?How can we automate?

The sky is the limit. It all depends on the tools you use

– Pro/Toolkit (C/C++ library)

– J-Link (Java) - Free

– Automation Gateway (Visual Basic, VBA, C, etc)

– Pro/Web.Link (HTML and Javascript) - Free

– Pro/BATCH - Free

– Built in tools like: Trailfiles & Mapkeys

– 3rd party tools like:

• sBatch• ProTrail

The sky is the limit. It all depends on the tools you use

– Pro/Toolkit (C/C++ library)

– J-Link (Java) - Free

– Automation Gateway (Visual Basic, VBA, C, etc)

– Pro/Web.Link (HTML and Javascript) - Free

– Pro/BATCH - Free

– Built in tools like: Trailfiles & Mapkeys

– 3rd party tools like:

• sBatch• ProTrail

Page 5: Corten We2009 Final Eindhoven

Pro/BATCHPro/BATCH

Tool with graphical UI to Export 2D & 3D formats

Free

Scheduler

No PDM Integration

Tool with graphical UI to Export 2D & 3D formats

Free

Scheduler

No PDM Integration

Page 6: Corten We2009 Final Eindhoven

Pro/BATCH - UsagePro/BATCH - Usage

Make shortcut to [proloadpoint]\bin\pro_batch.bat and set startup folder to where you want to run it.

Select the files you want to process

Select the action you want to do

Name your batchfile and enter which ProE startup command to use (normally proe1.bat)

Save the batchfile

Now run it (or schedule it)

Starts ProE with cmdline options:0 0 3 pro_wait -batchfile [path]\[batchfile]

Make shortcut to [proloadpoint]\bin\pro_batch.bat and set startup folder to where you want to run it.

Select the files you want to process

Select the action you want to do

Name your batchfile and enter which ProE startup command to use (normally proe1.bat)

Save the batchfile

Now run it (or schedule it)

Starts ProE with cmdline options:0 0 3 pro_wait -batchfile [path]\[batchfile]

Page 7: Corten We2009 Final Eindhoven

Pro/BATCH - DemoPro/BATCH - Demo

Create DXF’s from a few drawings Create DXF’s from a few drawings

Page 8: Corten We2009 Final Eindhoven

Built in functions of ProEBuilt in functions of ProE

Mapkeys

Running trailfiles

Free

Mapkeys

Running trailfiles

Free

Page 9: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Set following config.pro options:

– CMDMGR_TRAIL_OUTPUT YESputs internal ProE commands in trailfile instead of menu dependant commands~ Command `ProCmdModelSaveAs` vs.~ Activate `main_dlg_cur` `File.psh_save_as`

– TRAIL_DIR C:\TEMPmake sure your trailfiles are always on a local drive

Set following config.pro options:

– CMDMGR_TRAIL_OUTPUT YESputs internal ProE commands in trailfile instead of menu dependant commands~ Command `ProCmdModelSaveAs` vs.~ Activate `main_dlg_cur` `File.psh_save_as`

– TRAIL_DIR C:\TEMPmake sure your trailfiles are always on a local drive

Page 10: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Use built in mapkey recorderTools -> Mapkeys -> Newor

Get the commands from session trailfileCopy them to config.promapkey xxx [commands]

Pick carefully

Don’t make screen selections(unless you want to create a trailfile)

If you need to select somethingUse the Find Tool

Use built in mapkey recorderTools -> Mapkeys -> Newor

Get the commands from session trailfileCopy them to config.promapkey xxx [commands]

Pick carefully

Don’t make screen selections(unless you want to create a trailfile)

If you need to select somethingUse the Find Tool

Page 11: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Continuation:

– Continue mapkeys on a new line by ending previous line with ;\

– Start new line with mapkey(continued).(not really necessary)

– E.G.mapkey fsdxf ~ Activate `main_dlg_cur` ` ProCmdModelSaveAs `;\mapkey(continued) ~ Select `file_saveas` `type_option` \mapkey(continued) 1 `db_137`;\mapkey(continued) ~ Activate `file_saveas` `OK`;\mapkey(continued) ~ Activate `export_2d_dlg` `OK_Button`

Continuation:

– Continue mapkeys on a new line by ending previous line with ;\

– Start new line with mapkey(continued).(not really necessary)

– E.G.mapkey fsdxf ~ Activate `main_dlg_cur` ` ProCmdModelSaveAs `;\mapkey(continued) ~ Select `file_saveas` `type_option` \mapkey(continued) 1 `db_137`;\mapkey(continued) ~ Activate `file_saveas` `OK`;\mapkey(continued) ~ Activate `export_2d_dlg` `OK_Button`

Page 12: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Continuation:

– You can put ProE continuation lines on one line as long as they don’t exceed the line length.Maximum line length = 98 characters (incl. backslash)

– E.G.~ Select `file_saveas` `type_option` \1 `db_137`

Change into:

~ Select `file_saveas` `type_option` 1 `db_137` 

Continuation:

– You can put ProE continuation lines on one line as long as they don’t exceed the line length.Maximum line length = 98 characters (incl. backslash)

– E.G.~ Select `file_saveas` `type_option` \1 `db_137`

Change into:

~ Select `file_saveas` `type_option` 1 `db_137` 

Page 13: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Add description to your mapkey:

– @MAPKEY_LABEL to give your mapkey a name

– @MAPKEY_NAME to give your mapkey additional info

TIP: Always end this with the mapkey in brackets e.g. (mapkey fadxf)

E.G.mapkey xxx @MAPKEY_LABELName of the mapkey;\mapkey(continued) @MAPKEY_NAMEName and action (mapkey xxx)

Add description to your mapkey:

– @MAPKEY_LABEL to give your mapkey a name

– @MAPKEY_NAME to give your mapkey additional info

TIP: Always end this with the mapkey in brackets e.g. (mapkey fadxf)

E.G.mapkey xxx @MAPKEY_LABELName of the mapkey;\mapkey(continued) @MAPKEY_NAMEName and action (mapkey xxx)

Page 14: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Page 15: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Page 16: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Browsing:

– Type in full path vs browsing

~ Select `file_saveas` `ph_list.Filelist` 1 `Data`~ Activate `file_saveas` `ph_list.Filelist` 1 `Data`~ Select `file_saveas` `ph_list.Filelist` 1 `PTC`~ Activate `file_saveas` `ph_list.Filelist` 1 `PTC`~ Select `file_saveas` `ph_list.Filelist` 1 `Work`~ Activate `file_saveas` `ph_list.Filelist` 1 `Work`~ Activate `file_saveas` `ok`

vs

~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \`d:\\data\\ptc\\work`~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`~ Activate `file_saveas` `ok`

Browsing:

– Type in full path vs browsing

~ Select `file_saveas` `ph_list.Filelist` 1 `Data`~ Activate `file_saveas` `ph_list.Filelist` 1 `Data`~ Select `file_saveas` `ph_list.Filelist` 1 `PTC`~ Activate `file_saveas` `ph_list.Filelist` 1 `PTC`~ Select `file_saveas` `ph_list.Filelist` 1 `Work`~ Activate `file_saveas` `ph_list.Filelist` 1 `Work`~ Activate `file_saveas` `ok`

vs

~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \`d:\\data\\ptc\\work`~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`~ Activate `file_saveas` `ok`

Page 17: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Nesting mapkeys:

– Create nested mapkeys by calling other mapkeys with the percent sign.

– E.G.mapkey fsa @MAPKEY_LABELSave As;\mapkey(continued) @MAPKEY_NAMESave As (mapkey fsa);\mapkey(continued) ~ Activate `main_dlg_cur` ` ProCmdModelSaveAs `

mapkey fsdxf @MAPKEY_LABELSave As DXF;\ mapkey(continued) @MAPKEY_NAMESave As DXF (mapkey fsdxf);\mapkey(continued) %fsa;\mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_137`;\mapkey(continued) ~ Activate `file_saveas` `OK`

Nesting mapkeys:

– Create nested mapkeys by calling other mapkeys with the percent sign.

– E.G.mapkey fsa @MAPKEY_LABELSave As;\mapkey(continued) @MAPKEY_NAMESave As (mapkey fsa);\mapkey(continued) ~ Activate `main_dlg_cur` ` ProCmdModelSaveAs `

mapkey fsdxf @MAPKEY_LABELSave As DXF;\ mapkey(continued) @MAPKEY_NAMESave As DXF (mapkey fsdxf);\mapkey(continued) %fsa;\mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_137`;\mapkey(continued) ~ Activate `file_saveas` `OK`

Page 18: Corten We2009 Final Eindhoven

Building your mapkeysBuilding your mapkeys

Parameters:

– Use old Parameter UIWith the config.pro option NEW_PARAMETER_UI NO.

– vs

Parameters:

– Use old Parameter UIWith the config.pro option NEW_PARAMETER_UI NO.

– vs

Page 19: Corten We2009 Final Eindhoven

Building your mapkeys - DemoBuilding your mapkeys - Demo

Create mapkey to export dxf to folder on disk Create mapkey to export dxf to folder on disk

Page 20: Corten We2009 Final Eindhoven

Building your trailfilesBuilding your trailfiles

Use same approach as creating mapkeys

Start trail file with 2 line header!trail file version No. 1400!Pro/ENGINEER TM Wildfire 4.0 (c) 2009 by Parametric Technology Corporation All Rights Reserved.

Put every command on one line

Create environment variable CONTINUE_FROM_OOS = 1to prevent ProE from crashing when running a trailfile

EG:!trail file version No. 1400!Pro/ENGINEER TM Wildfire 4.0 (c) 2009 by Parametric Technology Corporation All Rights Reserved.~ Activate `main_dlg_cur` ` ProCmdModelSaveAs `~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` `d:\\data\\ptc`~ Select `file_saveas` `type_option` 1 `db_137`~ Activate `file_saveas` `OK`~ Activate `export_2d_dlg` `OK_Button`~ Activate `UI Message Dialog` `ok`

Use same approach as creating mapkeys

Start trail file with 2 line header!trail file version No. 1400!Pro/ENGINEER TM Wildfire 4.0 (c) 2009 by Parametric Technology Corporation All Rights Reserved.

Put every command on one line

Create environment variable CONTINUE_FROM_OOS = 1to prevent ProE from crashing when running a trailfile

EG:!trail file version No. 1400!Pro/ENGINEER TM Wildfire 4.0 (c) 2009 by Parametric Technology Corporation All Rights Reserved.~ Activate `main_dlg_cur` ` ProCmdModelSaveAs `~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` `d:\\data\\ptc`~ Select `file_saveas` `type_option` 1 `db_137`~ Activate `file_saveas` `OK`~ Activate `export_2d_dlg` `OK_Button`~ Activate `UI Message Dialog` `ok`

Page 21: Corten We2009 Final Eindhoven

sBatchsBatch

Graphical utility to run your own mapkeys

Free

Uses J-Link

By USG Innotiv (Martein Schuttert)

Builds one large mapkey from selected mapkeys and runs it on your files

Graphical utility to run your own mapkeys

Free

Uses J-Link

By USG Innotiv (Martein Schuttert)

Builds one large mapkey from selected mapkeys and runs it on your files

Page 22: Corten We2009 Final Eindhoven

Download from:http://www.usginnotiv.nl/13855/default.aspxwww.USGInnotiv.nl > 1st Tab > Divisies > Product Development > sTools

Link to download page with password will be mailed

Also other tools:

– sPurge

– Plotdate

Download from:http://www.usginnotiv.nl/13855/default.aspxwww.USGInnotiv.nl > 1st Tab > Divisies > Product Development > sTools

Link to download page with password will be mailed

Also other tools:

– sPurge

– Plotdate

sBatchsBatch

Page 23: Corten We2009 Final Eindhoven

Probably need to add the .zip extension to downloaded files

Page 24: Corten We2009 Final Eindhoven

sBatch v3.2sBatch v3.2

Creates one large mapkey and adds a button configured to run this mapkey to your config.win

Then runs a trailfile which presses this button

Can connect to Intralink 3.x Workspace

Supports R2001, Wildfire & Wildfire 2.0

Creates one large mapkey and adds a button configured to run this mapkey to your config.win

Then runs a trailfile which presses this button

Can connect to Intralink 3.x Workspace

Supports R2001, Wildfire & Wildfire 2.0

Page 25: Corten We2009 Final Eindhoven

sBatch v4.0 (beta)sBatch v4.0 (beta)

Uses asynchronous J-Link connection

Supports 64-bit

Supports Pro/ENGINEER Wildfire 4

Supports Windchill Workspace

– Intralink 3.x

– Windchill PDMLink/ProjectLink 8.0

– Windchill PDMLink/ProjectLink 9.x

Supports non-graphics mode

Improved installlation (detects Pro/E and OS version)

Uses asynchronous J-Link connection

Supports 64-bit

Supports Pro/ENGINEER Wildfire 4

Supports Windchill Workspace

– Intralink 3.x

– Windchill PDMLink/ProjectLink 8.0

– Windchill PDMLink/ProjectLink 9.x

Supports non-graphics mode

Improved installlation (detects Pro/E and OS version)

Page 26: Corten We2009 Final Eindhoven

sBatch v4.0 InstallationsBatch v4.0 Installation

C:\Program Files\USG Innotiv sBatch

Finds your latest Wildfireversion (up to v4.0)

Configure PDM integration

–PDMLink 9,8 or 7 and/or

–ProjectLink 9,8 or 7

–Intralink 3.x

Desktop icon

C:\Program Files\USG Innotiv sBatch

Finds your latest Wildfireversion (up to v4.0)

Configure PDM integration

–PDMLink 9,8 or 7 and/or

–ProjectLink 9,8 or 7

–Intralink 3.x

Desktop icon

Page 27: Corten We2009 Final Eindhoven

sBatch InstallationsBatch Installation

Creates c:\windows\sbatch.ini(to hold installation paths)

Creates \.usginnotiv\sbatch.conf inyour %USERPROFILE%(holds sBatch config. Can be updated from sBatch)

sBatch looks for config.pro in [proeloadpoint]\text

Creates c:\windows\sbatch.ini(to hold installation paths)

Creates \.usginnotiv\sbatch.conf inyour %USERPROFILE%(holds sBatch config. Can be updated from sBatch)

sBatch looks for config.pro in [proeloadpoint]\text

Page 28: Corten We2009 Final Eindhoven

Running sBatchRunning sBatch

Start sBatch

Add Files to process

Select mapkeys to runList is alphabetical

TIP: Create shortcutsto often used mapkeysat the top

Choose execution method and select run

Connects to current Pro/E session or starts a new one

Start sBatch

Add Files to process

Select mapkeys to runList is alphabetical

TIP: Create shortcutsto often used mapkeysat the top

Choose execution method and select run

Connects to current Pro/E session or starts a new one

Page 29: Corten We2009 Final Eindhoven

sBatch DemosBatch Demo

– Create 300dpi jpegs with a white background specified models shaded in the DEF_1 orientation.

• Use mapkeys–vv1 - Set View to DEF_1

–vs - Shade

– faj3 - Create 300dpi jpg with white background

– Create 300dpi jpegs with a white background specified models shaded in the DEF_1 orientation.

• Use mapkeys–vv1 - Set View to DEF_1

–vs - Shade

– faj3 - Create 300dpi jpg with white background

Page 30: Corten We2009 Final Eindhoven

ProTrailProTrail

Runs predefined tasks on selected files

Creates a large trailfile and runs it with ProE

Runs in the background

Does error checking when the task is finished

Written by me in C++

DOS Commandline utility

Runs predefined tasks on selected files

Creates a large trailfile and runs it with ProE

Runs in the background

Does error checking when the task is finished

Written by me in C++

DOS Commandline utility

Page 31: Corten We2009 Final Eindhoven

ProTrailProTrail

Download from:www.ProESite.com > Utilities > ProTrailhttp://www.proesite.com/UTIL/protrail.htm

Can connect to Intralink 3.x workspace

In most cases upwards compatible because running trailfiles is often upwards compatible as well.

Download from:www.ProESite.com > Utilities > ProTrailhttp://www.proesite.com/UTIL/protrail.htm

Can connect to Intralink 3.x workspace

In most cases upwards compatible because running trailfiles is often upwards compatible as well.

Page 32: Corten We2009 Final Eindhoven

ProTrailProTrail

Predefined tasks

– Export several 2D and 3D formats

– Create images

– Explode, unexplode

– Run Global interference, Massprops

– Set units, assign or unassign material

– Import files

– Regenerate, save, add timestamp

– Check ProE version

Predefined tasks

– Export several 2D and 3D formats

– Create images

– Explode, unexplode

– Run Global interference, Massprops

– Set units, assign or unassign material

– Import files

– Regenerate, save, add timestamp

– Check ProE version

Page 33: Corten We2009 Final Eindhoven

ProTrail InstallationProTrail Installation

One executableJust put it somewhere in your PATH.

Ideally:

– Create folder c:\Utilities

– Copy protrail.exe to this folder

– Add folder c:\Utilities to your PATH

Synchronize TEMP variable with config TRAIL_DIRe.g. C:\TEMP

One executableJust put it somewhere in your PATH.

Ideally:

– Create folder c:\Utilities

– Copy protrail.exe to this folder

– Add folder c:\Utilities to your PATH

Synchronize TEMP variable with config TRAIL_DIRe.g. C:\TEMP

Page 34: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

You start ProTrail from a DOS prompt

Use commandline arguments to drive it

Tip: Install DosHere (or Command Prompt Here) Shell extension. It enables you to quickly open a DOS prompt in a folder from Explorer.

You start ProTrail from a DOS prompt

Use commandline arguments to drive it

Tip: Install DosHere (or Command Prompt Here) Shell extension. It enables you to quickly open a DOS prompt in a folder from Explorer.

Page 35: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

Type protrail –h to get help

Use –dontrun option to test

Type protrail –h to get help

Use –dontrun option to test

Page 36: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

Options

– File Selection:

• Wildcards *.*, etc.• -drw, -prt, -asm, -lay, -models• -i inputfile• -num (objects with numerical names:

e.g. 12345.prt– Running:

• -foreground, -pause, -dontexit, -dontrun• -cmd• -v (version)

Options

– File Selection:

• Wildcards *.*, etc.• -drw, -prt, -asm, -lay, -models• -i inputfile• -num (objects with numerical names:

e.g. 12345.prt– Running:

• -foreground, -pause, -dontexit, -dontrun• -cmd• -v (version)

Page 37: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

Options

– export

• Jpg, tiff• Dxf, dwg, pdf• Iges, Step, set, stl, productview, shrinkwrap

– print (to printername)several other plot related options

– Intralink 3.x options

• -ws, -local, -ilinkNeeds PDM_LDB_PATH variable

Options

– export

• Jpg, tiff• Dxf, dwg, pdf• Iges, Step, set, stl, productview, shrinkwrap

– print (to printername)several other plot related options

– Intralink 3.x options

• -ws, -local, -ilinkNeeds PDM_LDB_PATH variable

Page 38: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

Options

– Specials:

• -save• -view, -shade• -regen• -unit, -(un)assign• -verify, -famtab, -instsave• -(un)explode, -interference, -massprops• -trail

Options

– Specials:

• -save• -view, -shade• -regen• -unit, -(un)assign• -verify, -famtab, -instsave• -(un)explode, -interference, -massprops• -trail

Page 39: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

Examples:

– protrail –e dxf –e pdf –drwCreate dxf and pdf files of all sheets on all drawings

– protrail –bgw –e jpg –dpi 300 –view DEF_1 –shade –models 36*Set background to white and create 300dpi jpegs of the DEF_1 shaded view of all models starting with 36 in their name

– protrail –ws WORK –unit mmNs –assign aisi_316.mat –regen –save –prtIn Workspace WORK set all parts to mmNs units, assign material aisi_316, regenerate and save

Examples:

– protrail –e dxf –e pdf –drwCreate dxf and pdf files of all sheets on all drawings

– protrail –bgw –e jpg –dpi 300 –view DEF_1 –shade –models 36*Set background to white and create 300dpi jpegs of the DEF_1 shaded view of all models starting with 36 in their name

– protrail –ws WORK –unit mmNs –assign aisi_316.mat –regen –save –prtIn Workspace WORK set all parts to mmNs units, assign material aisi_316, regenerate and save

Page 40: Corten We2009 Final Eindhoven

Running ProTrailRunning ProTrail

Examples:

– protrail –unexplode –interference –asm -e stepOpen all assemblies, unexplode them, do an Interference check and export to step

– protrail –famtab –modelsSave FamilyTable file of all generic models.

– protrail –import dxf -save Import all dxf’s and save as a ProE drw(also checks dxf format size)

Examples:

– protrail –unexplode –interference –asm -e stepOpen all assemblies, unexplode them, do an Interference check and export to step

– protrail –famtab –modelsSave FamilyTable file of all generic models.

– protrail –import dxf -save Import all dxf’s and save as a ProE drw(also checks dxf format size)

Page 41: Corten We2009 Final Eindhoven

Thanks for your attentionThanks for your attention