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..."

I tried starting with a completely empty config.pro except for the ed mapkey. It's still trying to open rererer.
smiley5.gif

I noticed that before it tries to open rererere, I get the message "No object was copied".
I have changed the path to the .vbs file.
 
Only thing I can think of is trial and error test the script:

leave out all but the 1st line of the script part below and then run the script, see what it does.
Then add the second one and so on. I added some descriptions, so you know what to expect

Test this with these lines:

sk "^s"
Opens the SAVE dialog
sk "{TAB 3}"
Presses TAB 3 times to get to where you input the modelname
sk "{BS 3}"
Deletes the last 3 charactes (PRT)
sk "drw"
Writes DRW at the end of the modelname
sk "+^{left}"
Sends CTRL + SHIFT + LEFT to select the entire name, By now I think qou'll most likely have already stumbled upon the problem...
sk "^c"
Opens CTRL + C to copy the name
sk "^a"
Aborts saving a file
sk "^o"
Opens the OPEN dialog
sk "^v"
Pastes the copied modelname
sk "~"
Confirms opening the model

Let me know where the error occurs ....
Good luck!
 
Thanks for the description, it seems so logical now that I see it.
Anyway, at first it stopped working at TAB 5 (I noticed I needed 5 tabs). The marker wouldn't jump to the input box. All I got was "rererere" in the status bar.
I have a hotkey script which makes NumLock type "re" (for my regenerate mapkey). Well, I tested deacticating that hotkey (don't ask me how numlock is mistaken for the tab-key
smiley24.gif
) and now the script works all the way down to ctrl + o. Ctrl + v does not work for some reason. The drawing name is copied, but for some reason it won't paste.
 
Check if

sk "+^{left}"

actually selects the entire name and

sk "^c"

really copies the name by opening notepad and pasting it there
If it pastes there, it should paste in ProE as well...
 
The drawing name is copied, but it simply won't paste.

I'll try deactivating all hotkeys on Monday when I get back to work...
 
No luck. I've deactivated all hotkeys but it still won't paste.
smiley24.gif


If I comment out the last line

sk "~"

I can press ctrl + v and the drawing name appears in the input box. Maybe it's too fast? How can I make a delay before

sk "^v"

?
 
It works!!
smiley4.gif


I changed the delay from 100 to 200 and now it works perfectly!

Thanks for all the help!


Edited by: m-d-e
 
Glad it finally works!

BTW the delay issue is also something which will not occur when using native ProE commands (e.g. mapkeys)...
 
Has anyone tried to updatethe ed.vbsfor the Creo interface. The file save shortcut does not have the model name field active, so it does not get saved the buffer. The Rename command brings up the current file name but I have been unable to save this text to the Windows cut and paste buffer,


'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()
 
First you do it manually:


SAVE


And then press the TAP keyX times, untill the filenumber is highlited.


In the second line insert X like this:


sk "^s"
sk "{TAB X}"



You can set the the Sleep time up to 2000. Then you can watch what happens. BTW 100 might be to fast. Try 800 and go down step by step.
 
'Option Explizit

WScript.Sleep 200

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 200 'Zeitangabe in Millisekunden

End Sub

sk "^s"
sk "{TAB 5}"
sk "+^{left}"
sk "^c"
sk "^a"
sk "^n"
sk "{TAB 3}"
sk "{DOWN}"
sk "{TAB 3}"
sk "{DOWN}"
sk "{TAB 3}"
sk "{DOWN}"
sk "^v"
sk "{BS 4}"
sk "~"
sk "{TAB 2}"
sk "{BS 10}"
sk "a3_komatsu"
sk "{TAB}"
sk "~"

WScript.Quit()


Creates a new drawing with the same name as the active
prt/asm and locates a list of template drawings to pick from.
Most used template.drw
 
Hi!


I created mapkeys in Creo 2 for opening drawing (with same name as part) of active part / assembly and one for creating new drawing with same name as active part/asm.



It is simple code in creo config.pro file and some in DOS file.


If somebody needs them, I can send this (I don't want to share it on internet yet; it is not tested enough and via e-mail I hope that I will get fedback about bugs - now after some tests works perfect ), my e-mail address:
49736_173_34_cache.jpg
 
Last edited:

Sponsor

Articles From 3DCAD World

Back
Top