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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

mapkey to toggle display?

PAULKORENKIEWIC
1-Newbie

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


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

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

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`;

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
Top Tags