Skip to main content
1-Visitor
October 16, 2012
Question

How do I create a single mapkey to toggle an option on and off in Creo2?

  • October 16, 2012
  • 5 replies
  • 6530 views

Many of my existing mapkeys automatically seem to do what I want , like my plane mapkey toggles on and off with the same map key...

What is the process to create a new mapkey that toggles an option on or off in Creo2 (many of my existing ones have broken and I want to add some more to enable me to spend less time in the ribbon). I don't want to have to create two mapkeys,one for "on", one for "off". I am guessing I need to manually alter something within the mapkey string of the configuration editor? If so, does anyone have an example they care to share?

    5 replies

    12-Amethyst
    October 17, 2012

    I tried to create a mapkey for hiding planes and it automatically toggles the status like you want to do. This works for point, axis and ucs too.

    For other things, like layers status on/off I used another method:

    1. I created two mapkeys: "On" and "Off".

    2. I saved the first mapkey ("On") on the Config.pro, and this mapkey end´s loading a mapkey with the same name but doing the opposite("OFF").

    Another option that works sometimes is editing the mapkey code and search for "0" and "1" status, example:


    ...`ModDsply_ChkB_ShadedEdges`1;\

    if you delete "1" like this:

    ...`ModDsply_ChkB_ShadedEdges`;\


    Creo will toglle the display.

    You can find more info in Proesite.com.

    1-Visitor
    October 19, 2012

    Yeah, I do that work around by creating two keys aswell but there must be a toggle option or an easier way.

    12-Amethyst
    October 19, 2012

    I think the example from Proesite.com is quite explanatory:

    Toggling Mapkeys

    You can create toggle mapkeys by letting the mapkey read in a small config.pro file in which the mapkey itself is redefined:

    Suppose you want the F6 button to toggle the explode, then you only need to create the two following config.pro files:

    put this in explode.pro:

    mapkey $F6 ~ Activate `main_dlg_cur` `View.psh_view_explode`;\

    ~ Activate `main_dlg_cur` `psh_util_load_config`;\

    ~ Activate `file_open` `Inputname` \

    `[full path]/unexplode.pro`

    put this in unexplode.pro:

    mapkey $F6 ~ Activate `main_dlg_cur` `View.psh_view_unexplode`;\

    ~ Activate `main_dlg_cur` `psh_util_load_config`;\

    ~ Activate `file_open` `Inputname` \

    `[full path]/explode.pro`

    In your startup config.pro add the first mapkey as well, assuming you want to explode your assy's the first time you run F6.

    One drawback, If you manually explode or unexplode between running F6 it will not work the next time you run F6, you will have to press F6 again.

    1-Visitor
    November 7, 2013

    As much as I've tried this procedure it does not work in Creo 2.0. I followed this just as stated and it just won't work. Any other suggestions on how we can toggle displays on and off.

    21-Topaz II
    November 7, 2013

    What are you trying to toggle? The first reply by Jose above has almost always worked for me, but I'm not sure I've created one in Creo2 yet. Let me know what you want toggled and I'll see what I can do.

    12-Amethyst
    November 7, 2013

    Doug has already solved your problem but I want to add one more tip:

    You can join the mapkeys in only one. Since you are calling commands that don´t exist in the active context of Creo they will ignored.

    So joining the three mapkeys that Doug created you will have:

    mapkey nn ~ Activate `main_dlg_cur` \

    `igToolbar_AncestorIGT_IGT_GRP_inh396938342.proe_win|.mcs29658718_mp|select_\

    all_check`;\

    ~ Activate `main_dlg_cur` \

    `igToolbar_AncestorIGT_IGT_GRP_inh397369119.proe_win|.mcs29658718_mp|select_\

    all_check`;\

    ~ Activate `main_dlg_cur` \

    `igToolbar_AncestorIGT_IGT_GRP_inh407984315.proe_win|.mcs29658718_mp|select_\

    all_check`;

    In this particular case, you have to enable the "Datum display filters" in the "fly" bar (I don´t know the name of that bar) and save the customization or the mapkey may not work.

    1-Visitor
    December 12, 2013

    sheesh, why does PTC make things so complicated! i know something sound easy but programatically it's not, but this seems elementary.