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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Copy parameter in Mapkey won't work after re-booting Creo

tleati
10-Marble

Copy parameter in Mapkey won't work after re-booting Creo

Hello,

I have tried to record a Mapkey in which I want to copy a specific parameter of a selected component in a assembly. The steps are:

-> right mouse click

-> Edit Parameters

-> left mouse clik on the wanted parameter value

-> Edit menu

-> Copy

-> close parameters window

Here below a video of the mapkey record:

Video Link : 6854

The Mapkey works if I run it in the session where it has been recorded, with other components and other assemblies too, but doesn't work when I restart (after having saved it obviously) Creo, as if there is something in the recording related to a specific session (but that I can't see from the config.pro). (Also, the parameter whose to copy the value is present is every assembly and part we have).

Anyone can tell what is it due to and if there is something I can modify in the mapkey config.pro code to make it working forever?

(Here below the code I recorded (where codice_disegno is the parameter name):

mapkey 7 ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\

mapkey(continued) ~ Close `rmb_popup` `PopupMenu`;~ Activate `rmb_popup` `EditParameters`;\

mapkey(continued) ~ Arm `relation_dlg` `ParamsPHLay.ParTable` 2 `rowCODICE_DISEGNO` `value`;\

mapkey(continued) ~ Disarm `relation_dlg` `ParamsPHLay.ParTable` 2 `rowCODICE_DISEGNO` `value`;\

mapkey(continued) ~ Select `relation_dlg` `ParamsPHLay.ParTable` 2 `rowCODICE_DISEGNO` `value`;\

mapkey(continued) ~ Select `relation_dlg` `MenuBar1` 1 `Edit`;\

mapkey(continued) ~ Close `relation_dlg` `MenuBar1`;~ Activate `relation_dlg` `PBCopy`;\

mapkey(continued) ~ Close `relation_dlg` `relation_dlg`;

(I am trying to record this mapkey to then use it to open a selected component drawing with the help of an external software and it would be much more useful to have the copy value inside Creo).

thanks

Tommaso


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.
40 REPLIES 40
psobejko
12-Amethyst
(To:tleati)

Hi Tommaso,

I am rather confused now - I don't know what is the code for your mapkey test6 - i thought it was just a copy of my mapkey which I called 99

But you say that test6 mapkey was recorded directly in Creo... I don't get how you can do that.

Just to be on the same page, this is what test I propose:

1. Start a new session of Creo2 in which there are no mapkeys.  Perhaps you can do that by using a config.pro file where there are no mapkeys defined.

    Or you can open the mapkeys dialog box and delete all the mapkeys such that there are none in the list.

2. Download the attached zip file and extract the text file called 99.pro from it.  Put this file in your Creo working directory.  For reference, this is the content of this file:

mapkey 99 @MAPKEY_LABELGet_CODICE_DISEGNO (99);\ 

~ Command `ProCmdMakeActive`;\ 

~ Command `ProCmdMmParams` ;\ 

~ Activate `relation_dlg` `PBSearch`;\ 

~ Update `param_search` `PrmFilterPHLay.FilterRuleValueOptEditableMenu` \ 

`CODICE_DISEGNO`;~ Activate `param_search` `PrmFilterPHLay.FilterRuleAddPush`;\ 

~ Activate `param_search` `PrmSearchFindPush`;\ 

~ Activate `0_std_confirm` `OK`;\ 

~ Activate `param_search` `PrmSearchClosePush`;\ 

~ Select `relation_dlg` `ParamsPHLay.ParTable` 2 `rowCODICE_DISEGNO` `value`;\ 

~ Activate `relation_dlg` `PBCopy`;\ 

~ Close `relation_dlg` `relation_dlg`;\ 

~ Command `ProCmdWinActivate`; 

3. In Creo, Go to file->options->Configuration Editor->Import/Export->Import configuration file->99.pro

4. Verify that there is now one mapkey called 99 available in session by seeing just one entry in the mapkeys dialog box

5. Open your model / assembly

6. Select a component

7. Using the keyboard, type in the string 99

8. Please post the trail file contents starting from the point where the model/assembly was opened.

tleati
10-Marble
(To:psobejko)

Hi Paul,

yes the test6 has been recorded in Creo directly, I have tested all of those proposed here with the same result. Here below its code just for information:

mapkey test6 @MAPKEY_LABELGet_CODICE_DISEGNO (test6);\

~ Command `ProCmdMakeActive`;\

~ Command `ProCmdMmParams`;\

~ Activate `relation_dlg` `PBSearch`;\

~ Update `param_search` `PrmFilterPHLay.FilterRuleValueOptEditableMenu` `CODICE_DISEGNO`;\

~ Activate `param_search` `PrmFilterPHLay.FilterRuleAddPush`;\

~ Activate `param_search` `PrmSearchFindPush`;\

~ Activate `0_std_confirm` `OK`;\

~ Activate `param_search` `PrmSearchClosePush`;\

~ Select `relation_dlg` `ParamsPHLay.ParTable` 2 `rowCODICE_DISEGNO` `value`;\

~ Activate `relation_dlg` `PBCopy`;\

~ Close `relation_dlg` `relation_dlg`;\

~ Command `ProCmdWinActivate`;

Anyway, the good news is that your procedure WORKS !!

Thanks!!

The also great news is that, as found out with some other tests, it works even with the normal mapkey set I have, simply added to them. It's also weird because this is perfectly equal to yours published some time ago: as if by deleting once all the mapkeys, included those loaded automatically, has in some way "purged" the memory or did something else regenerating...

(I had experienced unexplainable workspace data corruption issues in the past so at this point everything could be expected from Creo...).

I have tried to open some asms I have in a workspace and from all of them the parameter value can be copied successfully, except for one where a part is subjected to assembly-level features so the message of assebly feature confirmation removal appears and the mapkey then doesn't go on...so a line more for this in the code would be needed.

I enclose here the trail file recording from the moment I open a working asm till its erase from session, just for completeness.

Bye

dschenken
21-Topaz I
(To:tleati)

Only two things occur to me:

1) Record another mapkey to do the same thing in a separate session and see what differences show up

2) You have a mapkey with the same name being restored after the one you recorded and so of course it won't work.

For the second one, check all the config.pro files that you are loading to see if that mapkey is being saved elsewhere. You should also be able to use the pull-down and see which files are being loaded in the Option dialog. At least one of them should have mapkey 7.

Hi David,

thanks for your reply.

-concerning the point 1), I didn't understand really what you mean. The mapkey I created and posted here as first, does not work in other sessions and that's the problem I am trying to solve.

-Concerning the point 2, the mapkey posted by me is exactly the one visible in the screen recording video, under the name 7 in mapkeys list window.

Bye

dschenken
21-Topaz I
(To:tleati)

Point 1 - re-record the mapkey with a different name in a new session and compare it to the existing one for differences.

Point 2 - you need to look at all the config files that get loaded to make sure that there is only one copy of the mapkey. The mapkey window only shows a portion of the recorded mapkey and if you or someone else introduced one with the same name that loads after the one you created, then the one you want to run won't be the one that runs.

I would also recommend not using a single letter or number. You can edit the config to change the name later, but until then, give them a longer name each time you record it - test1, test2, test3, et al until it actually works correctly. You can run them by clicking on the desired one in the mapkey window, which can stay open, and then picking Run.

Hi David,

I tried your steps and the outcome, for the Point 1, is that after having recorded two mapkeys in two different sessions, they are perfectly the same and both don't work if run in another session (I used for them longer names). It' really strange.

Concerning the point 2, yes there are no copies of that mapkey nor any with the same name.

At this point I will contact the technical support and see whether maybe they have experienced the same issue with some other customers and maybe the R&D gave some kind of answer.

Thanks

Bye

Jose_Costa
6-Contributor
(To:tleati)

That hasn't worked? Strange, works on Creo 3...

Here is another try, I cleaned all the junk on this one:

mapkey 7 ~ Command `ProCmdEditParameters`;\

mapkey(continued) ~ Select `relation_dlg` `ParamsPHLay.ParTable` 2 `rowCODICE_DISEGNO` `value`;\

mapkey(continued) ~ Activate `relation_dlg` `PBCopy`;~ Activate `relation_dlg` `PB_OK`;

If the mapkey finds something unexpected it may ignore it and continue until the end. This way you will never know what went wrong.

Unless you take a look at the trailfile, Creo registers everything there. Open the trailfile, run the mapkey, reload the trailfile and search for error lines in the end of the file.

That's it.

Note: this mapkey will only work if a component is selected.

Jose

Hi Jose,

thanks. I have the Creo 2.0 M110, if this may make some difference.

Yes I also have in mind to make the mapkey once the component is already selected.

I posted in response to Paul's last post all the mapkeys proposed in this topic and the relative trail file recordings after they have been played.

Bye

dschenken
21-Topaz I
(To:tleati)

Mapkeys are version sensitive, so any Creo 3 mapkeys are not guaranteed to work. If they do it is by accident as PTC does not make them backwards compatible.

Also see my other response.Re: Copy parameter in Mapkey won't work after re-booting Creo

dschenken
21-Topaz I
(To:tleati)

Just add the parameter as a column in the model tree. You can then directly copy or change the value.

No need for a mapkey.



The above would work great except for a peculiar glitch in the Creo selection process. Sigh.

If the item is locked in the Workspace or is otherwise in a non-modifiable state, Creo first prompts the User that the item can't be changed and after that dialog box is dispatched, rewards the user by replacing the line with a blank line, so there is nothing to copy. When anything else is selected, Creo then replaces the blank with the original value. Look, but don't touch.

That aside, in reproducing the steps above I had no trouble, which leads me back to thinking this has more to do with not correctly loading the desired mapkey. It may also be failing because the models on later days are being locked and the mapkey as created is not working with the locked parts. I notice the part that says 'Edit' just before "Copy', but I think the right mouse button produces a menu with Copy on it that does not involve an Edit.

Hi David,

the fact of putting the parameter in the model tree is that in this case I would like to make this mapkey for the purpose of copying the parameter, and than use this value to open its drw. (and not to change it).

I know the message you are referring to, and the item I am testin the mapkey on doesn't show it, nor it did in the mapkey test6 recording action.

Yes I think so also, as you said the software doesn't load the mapkey properly, this happens with some mapkeys such as these in the topic, and another one (replace components in an asm). That's also why it's weird.

The fact of the locked components, I don't think it's the cause since they don't even start running...they should at least show the parameters window...

thanks

bye

Top Tags