Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

on off mapkeys

Status
Not open for further replies.

mechbull

Computer
Nov 28, 2005
36
how do you create a mapkey so that pushing it 1 time turns something on pushing it again will turn it off

there are currently keys like this set up here but would like to know how to create them. here is an example of 1 that turns datum planes on and off just using the (f9) key

mapkey $F9 @MAPKEY_LABELToggle Planes;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `Utilities`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `Utilities.psh_util_env`;\
mapkey(continued) ~ Activate `env_dlg` `DtmDsply_PB_DtmPlanes`0 ;~ Activate `env_dlg` `Apply_`;\
mapkey(continued) ~ Activate `env_dlg` `OK_`;
 
Replies continue below

Recommended for you

I'm not sure what version you are using, so this may not work.

My mapkey to toggle planes is:

mapkey $F5 @MAPKEY_LABELPlane_Toggle;\
mapkey(continued) ~ Activate `main_dlg_cur` `ProCmdEnvDtmDisp.ddisp`0;

And it toggles okay. I'm not sure if that specific environment command is particular to Wildfire 2.

If that doesn't work, maybe you can record another mapkey of the planes being turned on, and then append to the end of your current mapkey to overwrite it's own definition. If you do this for both definitions, it should work in sort of a loop, always rewriting the defintion of the F5 mapkey every time it is pressed. I don't have the chance to try it, but it might be worth a go.


Someone I once worked with had an interesting mapkey system.

He had a flyout on the toolbar that switched his mapkeys for him. So if he pressed button one, a mapkey was executed which would overwrite the current mapkey definitions with a new set. This allowed him to customize his function keys based on his present task.
 
The toggle mapkeys depend on what you are doing. I had one that would turn on/off the four datum types.

Just create the key for the action of pressing the 4 icons and close the mapkey. Nothing special to the mapkey being a toogle.


"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.

Ben Loosli
Sr IS Technologist
L-3 Communications
 
Not sure if this what's needed, but if you delete "0" or "1" in the mapkey record; i.e. ...

~ Activate `env_dlg` `DtmDsply_PB_DtmPlanes`0;
becomes
~ Activate `env_dlg` `DtmDsply_PB_DtmPlanes`;

... it will work for most(?) "toggle" functions.
 
ok here is a mapkey i would like to be able to toggle on and off

view/ display settings/ model display/ shade/ with edges

here is my mapkey for that

it currently only turns edges on


mapkey eo @MAPKEY_LABELedges on;~ Select `main_dlg_cur` `MenuBar1`1 `View`;\
mapkey(continued) ~ Select `main_dlg_cur` `View.cb_view_advanced`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Close `main_dlg_cur` `View.cb_view_advanced`;\
mapkey(continued) ~ Activate `main_dlg_cur` `psh_view_mdldisp`;\
mapkey(continued) ~ Select `modeldisplay` `ModDsply_Tab`1 `ModDsply_Layout_Shade`;\
mapkey(continued) ~ Move `modeldisplay` `modeldisplay`2 20.990874 0.401565 ;\
mapkey(continued) ~ Activate `modeldisplay` `ModDsply_ChkB_ShadedEdges`1 ;\
mapkey(continued) ~ Activate `modeldisplay` `ModDsply_PB_Apply`;\
mapkey(continued) ~ Activate `modeldisplay` `ModDsply_PB_OK`;
 
I'd have to load and play with the mapkey but what I'd try ...

change ..._ShadedEdges'1;\
to
...ShadedEdges';\

 
... also -- wonder what the "Move 'modeldisplay ..." statement is? Might be able to delete that line. Should also be able to delete the "...PB_Apply';\" line? Might be able to delete all but three or four line? Experimenting is fun. <G>
 
The text below will toggle shaded edge view state in WF2. When originally recorded it has a "0" (off) or "1" (on) flag. Removing the flag causes it to toggle the existing state. (If you are unfamiliar with...) Just paste into a *.pro, unwrap if necessary and remove blank lines, load the *.pro and see if it works for you.

mapkey edge @MAPKEY_LABELToggle Shaded Edges;\

mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `View`;\

mapkey(continued) ~ Select `main_dlg_cur` `View.cb_view_mdlsetup`;\

mapkey(continued) ~ Close `main_dlg_cur` `View.cb_view_mdlsetup`;\

mapkey(continued) ~ Select `main_dlg_cur` `View.cb_view_advanced`;\

mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\

mapkey(continued) ~ Close `main_dlg_cur` `View.cb_view_advanced`;\

mapkey(continued) ~ Activate `main_dlg_cur` `psh_view_mdldisp`;\

mapkey(continued) ~ Select `modeldisplay` `ModDsply_Tab`1 `ModDsply_Layout_Shade`;\

mapkey(continued) ~ Activate `modeldisplay` `ModDsply_ChkB_ShadedEdges` ;\

mapkey(continued) ~ Activate `modeldisplay` `ModDsply_PB_OK`;
 
yes that was what i was looking for all along

your post on the "0" (off) or "1" (on)

if there any more tricks like that let us know

thank you
 
That's about it for my bag of tricks. Still learnin' this stuff, myself. `;^)
 
here is something i found

i was also wondering about adding custom icons into pro i saw an old link on here

thread554-27197

where does pro store its icons i have had no luck opening a config.win file and unsure about importing a custom icon i made

i tried renaming an old config.win file from config.win.56
to just con.win still will not open with any program i have

anyway heres a trick for mapkeys

by: Peter Spindloe of Design Knowledge on 2005-07-06
Tool/Utility: Pro/ENGINEER Version: Wildfire Area: Core

Tip:
When mapkeys execute the menus flash up on screen; this is distracting, and slows down execution. In versions 2001 and earlier, the config.pro option "visible_mapkeys no" took care of the problem by eliminating the display of the Menu Manager menus. However, the dialog boxes and dashboards of the Wildfire releases are not affected by this option.

You can edit the actual text of the mapkeys stored in the config.pro in a way that removes the menu flash but preserves the function. This technique came from the PTC/USER email exploder from Donald Gibson in response to a question by Damián Castillo.

The following is the text of a mapkey as recorded:
mapkey `data @MAPKEY_NAMEInsert Shared Data;@MAPKEY_LABELdata;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `Insert`;\
mapkey(continued) ~ Select `main_dlg_cur` `Insert.cb_sharedata`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Close `main_dlg_cur` `Insert.cb_sharedata`;\
mapkey(continued) ~ Activate `main_dlg_cur` `pshDataFromFile`;

The text can be edited, removing the "Select `main_dlg_cur`
`MenuBar1`1" text. The resulting mapkey looks like this:
mapkey `data @MAPKEY_NAMEInsert Shared Data;@MAPKEY_LABELdata;\
mapkey(continued) ~ `Insert`;\
mapkey(continued) ~ `Insert.cb_sharedata`;\
mapkey(continued) ~ Activate `main_dlg_cur` `pshDataFromFile`;

The mapkey runs more quickly and without menus flashing on the screen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor