cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

mapkey to toggle display?

mapkey to toggle display?

I'm trying to write a mapkey to toggle the simulation display on and
off. I thought I remembered the trick to getting items to toggle as
being to remove the "1" in the recorded mapkey after the switch is
selected. So my recorded mapkey:

mapkey sd @MAPKEY_LABELsim display toggle;~ Command
`ProCmdViewSimDisplay` ;\
mapkey(continued) ~ Activate `sim_display` `MasterSwitchCheck`1 ;\
mapkey(continued) ~ Activate `sim_display` `AcceptPush`;

Becomes:

!mapkey sd @MAPKEY_LABELsim display toggle;~ Command
`ProCmdViewSimDisplay` ;\
!mapkey(continued) ~ Activate `sim_display` `MasterSwitchCheck` ;\
!mapkey(continued) ~ Activate `sim_display` `AcceptPush`;

But this isn't working? Odd, as other mapkeys I have like this seem to
toggle just fine, granted they are all OUTSIDE of Mechanica... Does
anyone remember this trick???
I realize this is a Mechanica thing but, it also applies to generic
modeling, so I thought I would have better response posting here. I
tried searching the forum, but couldn't find just the right words...
toggle... display... toggle mapkey all seemed either empty or too
generic...
thanks in advance...

Paul Korenkiewicz
FEV , Inc.
4554 Glenmeade
Auburn Hills, MI, 48326-1766

3 REPLIES 3

mapkey to toggle display?

Yeah, that's the trick I've used. Did you record the 'off' mapkey to
compare? Maybe in this case there re more differences. I'd also mess
with removing the space before the 1, maybe adding a space in place of
the 1. I doubt that's going to help, but you never know.

Doug Schaefer
--
Doug Schaefer | Experienced Mechanical Design Engineer
LinkedIn

mapkey to toggle display?

Thanks Doug... yes, I had a "space" in there which cause the issue.
Once removed, all was good...

Doug's original post:
The trick to toggling mapkeys is to record two, one that turns the item
on and one that turns it off. Then, open your config file in a text
editor and compare them. There will be a single character difference,
the 'on' mapkey will have a 1 and the 'off' mapkey will have a 0.

Delete that character and it turns into a toggle. I've used that
successfully to create a bunch of mapkeys to toggle display items buried
several layers deep in menus and dialog boxes like 'display curves when
shaded' or 'display trace sketches'.

Doug's reply to my latest post:
Yeah, that's the trick I've used. Did you record the 'off' mapkey to
compare? Maybe in this case there re more differences. I'd also mess
with removing the space before the 1, maybe adding a space in place of
the 1. I doubt that's going to help, but you never know.

CORRECTED MAPKEY:
mapkey sd @MAPKEY_LABELsim display toggle;~ Command
`ProCmdViewSimDisplay` ;\
mapkey(continued) ~ Activate `sim_display` `MasterSwitchCheck`;\
mapkey(continued) ~ Activate `sim_display` `AcceptPush`;

mapkey to toggle display?

Well, what do you know.

That just goes to show how silly things that you'd never expect to work,
sometimes do.

Actually, when I first tried removing the 1 from a mapkey, I never
expected it to work. I figured it couldn't hurt to try it though ...

Doug Schaefer
--
Doug Schaefer | Experienced Mechanical Design Engineer
LinkedIn
Announcements
LiveWorx Call For Papers Happening Now!