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.

Making a ’toggling mapkey’

dgs

New member
I originally posted this on the old Design Knowledge-base web site ([url]www.designkb.com[/url]) about 2 years ago, but it seems to be gone now so I thought I'd share it here. It was for 2001 but still works at least through WF3.
When creating a mapkey for things that toggle on and off, the resultant mapkey is frequently (though not always) only good for either 'on' or 'off', depending on the state when the mapkey was created. By simply altering a single character in the mapkey, we can turn it into a toggle.

A mapkey in Pro/E 2001 for enabling/disabling transparency for example, would look like this if recorded when transparency was on:
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
mapkey tr @MAPKEY_NAMEToggle Tranparency on/off;@MAPKEY_LABELTr;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `View`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Select `main_dlg_cur` `View.cb_view_advanced`;\
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_Transprncy`0 ;\
mapkey(continued) ~ Activate `modeldisplay` `ModDsply_PB_OK`;</BLOCKQUOTE>
If recorded when transparency was off, the same mapkey would look like this:
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
mapkey tr @MAPKEY_NAMEToggle Tranparency on/off;@MAPKEY_LABELTr;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `View`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Select `main_dlg_cur` `View.cb_view_advanced`;\
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_Transprncy`1 ;\
mapkey(continued) ~ Activate `modeldisplay` `ModDsply_PB_OK`;</BLOCKQUOTE>
Notice that they are exactly the same except for the second to last line. That line in the
 

Sponsor

Articles From 3DCAD World

Back
Top