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.

Mapkey "opening drawing of active..."

Tornado11

New member
Hello


How can i open the drawing of an active part or assy with an mapkey?


Anyone manage to make such a mapkey?


if so would you post it here?





regards


Jan Hallvard
 
I think there is a toolkit app on the downloads page that will do this. I havn't used it, so I'm not sure how well it works or what the limitations are.
 
I tried this mapkey, but thisone ONLY opens the first drawing in the selected directory....


It seems that i have to change this sentence >`XXXXX`;< to somthing that describes what is the active window, i don`t know whitc comand that would be?


mapkey dv @MAPKEY_LABELOpen Drawing of active part;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_save_as`;\
mapkey(continued) ~ FocusOut `file_saveas` `ph_model.ObjName0`;\
mapkey(continued) ~ Activate `file_saveas` `Cancel`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;~ Activate `main_dlg_cur` `File.psh_open`;\
mapkey(continued) ~ Open `file_open` `Type`;~ Close `file_open` `Type`;\
mapkey(continued) ~ Select `file_open` `Type`1 `db_4`;\
mapkey(continued) ~ Input `file_open` `Inputname` `XXXXX`;\
mapkey(continued) ~ Update `file_open` `Inputname` `XXXXx`;~ Activate `file_open` `Open`





If anybody manage to make it work, please post it back i this topic


Regards Jan Hallvard
 
I tried this DrawingOpener.zip But Pro/e crashes when i try to retrive a drawing


I`m using Wildfire 3.0 M090


Is there anybody else who has tried this? and made it work?


Regards Jan Hallvard
 
Tornado11 said:
I tried this mapkey, but thisone ONLY opens the first drawing in the selected directory....


It seems that i have to change this sentence >`XXXXX`;< to somthing that describes what is the active window, i don`t know whitc comand that would be?


mapkey dv @MAPKEY_LABELOpen Drawing of active part;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_save_as`;\
mapkey(continued) ~ FocusOut `file_saveas` `ph_model.ObjName0`;\
mapkey(continued) ~ Activate `file_saveas` `Cancel`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;~ Activate `main_dlg_cur` `File.psh_open`;\
mapkey(continued) ~ Open `file_open` `Type`;~ Close `file_open` `Type`;\
mapkey(continued) ~ Select `file_open` `Type`1 `db_4`;\
mapkey(continued) ~ Input `file_open` `Inputname` `XXXXX`;\
mapkey(continued) ~ Update `file_open` `Inputname` `XXXXx`;~ Activate `file_open` `Open`





If anybody manage to make it work, please post it back i this topic


Regards Jan Hallvard




Hi,

mapkey dv @MAPKEY_LABELOpen Drawing of active part;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_save_as`;\
mapkey(continued) ~ FocusOut `file_saveas` `ph_model.ObjName0`;\
mapkey(continued) ~ Activate `file_saveas` `Cancel`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;~ Activate `main_dlg_cur` `File.psh_open`;\
mapkey(continued) ~ Open `file_open` `Type`;~ Close `file_open` `Type`;\
mapkey(continued) ~ Select `file_open` `Type`1 `db_4`;\
mapkey(continued) ~ Input `file_open` `Inputname` %&name;\
mapkey(continued) ~ Update `file_open` `Inputname` %&name;~ Activate `file_open` `Open`


Sorry, I don't speak English .. :(

Sorry Don't Work!!!

tanks!!

bye!!

Edited by: teti
 
I don't know how to do it with a mapkey, but you can right-click on the name of the part in the model tree to open it - maybe you can make a mapkey of this.
 
teti said:
Tornado11 said:
I tried this mapkey, but thisone ONLY opens the first drawing in the selected directory....


It seems that i have to change this sentence >`XXXXX`;< to somthing that describes what is the active window, i don`t know whitc comand that would be?


mapkey dv @MAPKEY_LABELOpen Drawing of active part;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_save_as`;\
mapkey(continued) ~ FocusOut `file_saveas` `ph_model.ObjName0`;\
mapkey(continued) ~ Activate `file_saveas` `Cancel`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;~ Activate `main_dlg_cur` `File.psh_open`;\
mapkey(continued) ~ Open `file_open` `Type`;~ Close `file_open` `Type`;\
mapkey(continued) ~ Select `file_open` `Type`1 `db_4`;\
mapkey(continued) ~ Input `file_open` `Inputname` `XXXXX`;\
mapkey(continued) ~ Update `file_open` `Inputname` `XXXXx`;~ Activate `file_open` `Open`





If anybody manage to make it work, please post it back i this topic


Regards Jan Hallvard




Hi,

mapkey dv @MAPKEY_LABELOpen Drawing of active part;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_save_as`;\
mapkey(continued) ~ FocusOut `file_saveas` `ph_model.ObjName0`;\
mapkey(continued) ~ Activate `file_saveas` `Cancel`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;~ Activate `main_dlg_cur` `File.psh_open`;\
mapkey(continued) ~ Open `file_open` `Type`;~ Close `file_open` `Type`;\
mapkey(continued) ~ Select `file_open` `Type`1 `db_4`;\
mapkey(continued) ~ Input `file_open` `Inputname` %&name;\
mapkey(continued) ~ Update `file_open` `Inputname` %&name;~ Activate `file_open` `Open`


Sorry, I don't speak English .. :(

Sorry Don't Work!!!

tanks!!

bye!!


lamentable su mapkey no trabaja. esto tambi
 
Hi,

I made a script for this for WF 4. It works with English and German language versions.



2009-09-10_070414_Open_Drw_v0.01.zip



It's still in 'beta', so suggestions are welcome!



To use it, put the .exe somewhere and change the mapkey to point to the .exe.

Then in ProE just activate the mapkey and wait a few seconds. ProE will
write and .inf file. The script will read the drawing info from the
file and switch back to ProE and open it.



Hope it's of use to other people as well.uploads/Zestje/2009-09-10_070414_Open_Drw_v0.01.zip
 
Another way with vbs script:


First have this mapkey:

mapkey ed @MAPKEY_LABELexcisting drawing;~ Activate `main_dlg_cur` `File.psh_save`;\
mapkey(continued) @SYSTEM\start WScript.exe C:\\ptc_wf3\\ed.vbs


Second make in notepad the following ed.txt file and rename it to ed.vbs:


'Option Explizit


WScript.Sleep 100


Dim Fi, Fso


Set Shell = CreateObject("WScript.Shell")
Set WshShell = WScript.CreateObject("WScript.Shell")


Sub sk(Befehl)
'wscript.echo befehl
WshShell.SendKeys(Befehl)
WScript.Sleep 100 'Zeitangabe in Millisekunden


End Sub


sk "^s"
sk "{TAB 5}"
sk "{BS 3}"
sk "drw"
sk "+^{left}"
sk "^c"
sk "^a"
sk "^o"
sk "^v"
sk "~"


WScript.Quit()


Note my startdir is C:\ptc_wf3.Adjust the mapkey and placement od the ed.vbs file to your spec.


Works for prt, asm also instances. Solution found on www.cad.de
smiley2.gif

Edited by: GunnarHansen
 
The disadvantage of the vbs solution is that it relies on keystrokes to navigate the menus instead of native ProE commands, which I find less robust against changes (in ProE) and slow responding computers.

My script unfortunately also uses keystrokes right at the end to open the file, but I think I know how to get rid of that by pausing the mapkey to run the script and then continuing it, but haven't implemented that yet...
 
I get this error message:
Cannot find G:\[path to working directory]\mapkey ed @MAPKEY_LABELexcisting drawing;~ Activate `main_dlg_cur` `File.psh_save`;\.

Also, if I run it again with the same part active, it opens the first part (not even drawing) in the working directory.

Any ideas?
 
Did you put this in a mapkey (in your config.pro) and load it into proE?:

mapkey ed @MAPKEY_LABELexcisting drawing;~ Activate `main_dlg_cur` `File.psh_save`;\
mapkey(continued) @SYSTEM\start WScript.exe C:\\ptc_wf3\\ed.vbs


and the rest in the vbscript? I think maybe you put the above mapkey in the .vbs???
 
Yes, the mapkey is in config.pro.

It's trying to open the mapkey row. The open dialog opens and in the file name box there's "mapkey ed..."


Edited by: m-d-e
 
I tried in WF4 and noticed it takes only three tabs to get to the filename in the open dialog

Try replacing

sk "{TAB 5}"

with

sk "{TAB 3}"


BTW my script -should- not be version-dependent, but I can't test that explicitely...
 
Tornado11 said:
Hello


How can i open the drawing of an active part or assy with an mapkey?


Anyone manage to make such a mapkey?


if so would you post it here?





regards


Jan Hallvard


I do not know if it is a mapkeys problem, butif you want toopen a drawing by giving the same parts or assemblies name.


Trythis: rename_drawings_with_object BOTH
 
Okay, changed to TAB 3.

Now it's trying to open ererererere
"Cannot find ererere. Try again, by adding a file extension such as ".prt"."

re activates my regenerate all-mapkey. Could his be a problem?
 
Really weird.. sounds like some conflict with another mapkey or something?
Try starting proE without any configs (rename them) and then load just the single mapkey to find out is there somehow is a conflict...
smiley5.gif


BTW have you tried if my script works? See the previous page...
 

Sponsor

Articles From 3DCAD World

Back
Top