Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Automatically run mapkey

EddyVE

New member
Hi all,
Is it possible to automatically execute a mapkey whenever a new file (part, drawing,...) is opened?
If so, can you set separate mapkeys for different file types? A certain mapkey for a part, another mapkey for drawings, etc.?


Is it possible to automatically execute a mapkey whenever WildFire (1.0) is started?


Kind regards
Eddy
 
Yes you can do it by using trail files. Open proe and run your mapkeys then close proe. A trail file gets created in your working directory, copy this and rename it to a txt file eg eddy.txt.


Now create a start up command for proe using your txt file as a start up argument and use it when you want to do this task.


Here is an example as shown on the PTC knowledge base


Pro/ENGINEER can be launched with a trail file as an argument (e.g. when using a shortcut to launch Pro/ENGINEER,
modify the properties and add the trail file with full path as an argument in the command line).
Launch Pro/ENGINEER manually and apply the interactive actions to maximize the main window.
Exit Pro/ENGINEER and copy the trail file that has been created during the session under a new name with extension *.txt
(e.g. full_size.txt).
Edit the *.txt file and remove all commands added after the window has been maximized - otherwise exiting Pro/ENGINEER will
be part of the 'startup routine'!
For example, if you exit Pro/ENGINEER after resizing the window, using 'File' 'Exit',
then the command lines to exit begin with:


~ Select `main_dlg_cur` `MenuBar1` \
1 `File`
~ Close `main_dlg_cur` `MenuBar1`
~ Activate `main_dlg_cur` `File.psh_exit`
...


Delete all lines beginning with these lines up to the end of the trail file.
Then add the trail file with full path as an argument to your Pro/ENGINEER start command.
Pro/ENGINEER will launch and execute the trail file automatically.


Note: Pro/ENGINEER can also be launched with a model as an argument, to retrieve this model upon
launching.
If such an argument is already used for launching Pro/ENGINEER, then it is not possible to add the
trail file as well. Only one file can be used as a start argument.


Good luck


Keith
 
Keith,


Thanks for that tip!
That will work for when Pro/E starts up.

Is there a similar method for when a new file is opened (and Pro/E is already running)?


Kind regards
Eddy
 
Eddy


The only way I think that you can do this is to create a mapkey that carries out the commands for opening a new file (eg a part) and then goes on to carry out your tasks or runs your other mapkey(s).


You would have to do a mapkey for each type of start file (ie part, drawing and assembly). You can then use this mapkey to open a new file instead of using the standard "file#new"menu option.


Your only difficulty then is how to force people to use your mapkey instead of the standard menu. You could try editing your config.win to remove the option but it all gets a bit messy when you start interferring with standard commands. I would say that if someone forgets to use your new mapkey then tough luck , they will have to run the other tasks manually, that'll teach em


Keith
 
Keith,

Good idea!!
This function is for my personal use only, so the fact that other people might use the standard 'File Open' function is not an issue.

Thanks for your help!

Kind regards
Eddy
 

Sponsor

Articles From 3DCAD World

Back
Top