Skip to main content
1-Visitor
July 7, 2015
Solved

combining some mapkeys

  • July 7, 2015
  • 2 replies
  • 4908 views

HI,

I am setting up mapkey to create a named view. I can make the mapkey for creating the thumbnail view easily. See the code below.

mapkey tn @MAPKEY_NAMEcreated the thumbnail named view for IFS thumbnail;\

mapkey(continued) @MAPKEY_LABELthumbnail view;~ Command `ProCmdViewVisTool`

mapkey(continued) ~ Select `visual_dlg0` `RadioSelApplMgr` 1 `orientation`;\

mapkey(continued) ~ Activate `visual_dlg0` `ZoneNmCreate`;\

mapkey(continued) ~ Update `visual_dlg0` `Table_INPUT` `thumbnail`;\

mapkey(continued) ~ Activate `visual_dlg0` `Table_INPUT`;~ Activate `visual_dlg0` `CloseBtn`;

Now what I would like to do is set up this mapkey so that if you use it again, it saves the view. I have done a little bit with combining mapkeys to get them to work in different contexts, but that works because the one not being used simply gets skipped over in the wrong context. If I were to make another mapkey to save the current view and then smoosh them together, the first one would start working and screws things up. Is there a way to check the named views and if "thumbnail" already exists, then it saves the view, and if it doesn't it creates it?

Thanks,

Brandon


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.
Best answer by Chris3

I did not record 2 mapkeys. I just recorded 1. Steps to reproduce: Without the mapkey recorder on, create a view named whatever you want. Then turn the mapkey recorder on and go through the steps to save the view. Type in the same name as you did before with the recorder off. When you type in the same name the CAD software will ask if you want to override the old view. You indicated you wanted this, so click yes.

If the view has not been created, it will just skip over the yes dialog box.

2 replies

Chris3
21-Topaz I
July 7, 2015

The mapkey "language" changes for each version. I was able to get what you are requesting working in Creo 2 by typing in the name thumbnail and then just clicking "yes" when it prompted me if I wanted to save. My mapkey looks like this:

mapkey(continued) ~ Command `ProCmdViewOrient` ;\

mapkey(continued) ~ Input `orient` `namedviewPH.NameVw_IP` `thumbnail`;\

mapkey(continued) ~ Update `orient` `namedviewPH.NameVw_IP` `thumbnail`;\

mapkey(continued) ~ Activate `orient` `namedviewPH.NameVw_PB_Save`;Yes;\

mapkey(continued) ~ Activate `orient` `OkPB`;

Chris3
21-Topaz I
July 7, 2015

I forgot to mention that I created the thumbnail name first and then recorded the mapkey afterwards typing in the name thumbnail again. This is what gets you the save prompt.

1-Visitor
July 7, 2015

did you combine the 2 mapkeys into one? So that when I type "tn" it will do either? Or did you just create another mapkey? Is the code that you pasted a continuation of mine? Please paste the whole mapkey here so I can see what you are doing.

Chris3
Chris321-Topaz IAnswer
21-Topaz I
July 8, 2015

I did not record 2 mapkeys. I just recorded 1. Steps to reproduce: Without the mapkey recorder on, create a view named whatever you want. Then turn the mapkey recorder on and go through the steps to save the view. Type in the same name as you did before with the recorder off. When you type in the same name the CAD software will ask if you want to override the old view. You indicated you wanted this, so click yes.

If the view has not been created, it will just skip over the yes dialog box.

1-Visitor
July 8, 2015

I must be missing something. When I create a new view with the same name, it just doesn't accept it.

here's what I am typing in, and then when I hit enter to accept the name, it simply reverts back to view0001 with no dialogue box.

Is there a config setting that needs to be changed to allow this?

Brandon