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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Re: Mapkey Writing/Editing Tips

lockarde
12-Amethyst

Re: Mapkey Writing/Editing Tips

As per the original post

 

Does anyone know if there is a "wildcard" symbol that can be used for a mapkey?  I'm trying to create a mapkey that starts a new drawing.  It pauses for the name input, then selects the correct drawing template.  What I can't seem to get it to do is always select the highest level assembly as the default model for the drawing.  All of our highest level assemblies have a "-501" at the end of the name, with a different identifying number proceeding that.  Is there a way to make it just find the file with "-501.asm" in the name?  Coincidentally, this identifying number is also the name of the drawing - can that information be used since it is added prior to the assembly search?

ACCEPTED SOLUTION

Accepted Solutions
lockarde
12-Amethyst
(To:lockarde)

Following up on this post to share the solution.  I was able to get his to work! The mapkey is as follows:

mapkey(continued) @MAPKEY_LABELNew Drawing;~ Command `ProCmdModelNew` ;\
mapkey(continued) ~ Select `new` `Type` 1 `Drawing`;\
mapkey(continued) @MANUAL_PAUSEType Drawing File Name \nand Common Name;~ Activate `new` `OK`;\
mapkey(continued) ~ Activate `dwg_create` `psh_model_browse`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Update `file_open` `Inputname` `*-501.asm`;\
mapkey(continued) ~ Activate `file_open` `Inputname`;~ Activate `file_open` `Inputname`;\
mapkey(continued) ~ Select `dwg_create` `rad_format` 1 `1`;\
mapkey(continued) ~ Select `dwg_create` `template_names` 1 `def_template`;\
mapkey(continued) ~ Activate `dwg_create` `psh_ok`;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Table_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdDwgTblFromFile` ;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Activate `file_open` `view_favorites`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `AUTO-BOM`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `AUTO-BOM`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `def_table.tbl`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `def_table.tbl`;\
mapkey(continued) @PAUSE_FOR_SCREEN_PICK;

 

Adding the " * " to the file name was key, and it works every time.  This mapkey also selects the default table template I use that has repeat regions for auto populating material information and waits for placement on the drawing face..

View solution in original post

4 REPLIES 4
Chris3
21-Topaz I
(To:lockarde)

Mapkeys are static. IE whatever you click on and type into a box is what gets recorded into the mapkey with no changes.  Can you go the other way? Starting with Creo 6 there is an option to make the drawing name the same as the part/assembly name. Another complicated option is to call a mapkey which then calls an outside script which writes another mapkey. Doing this you can make dynamic mapkeys with the outside script. I wrote an example of this here.

 

Chris3_0-1666886352757.png

 

Chris3
21-Topaz I
(To:Chris3)

Something I forgot to mention, you can use wildcards in the filename box. See below. Doing this will limit what shows up in the dialog box. However I am pretty sure what gets recorded in the mapkey is the filename of whatever you pick when you pick a selection so I don't think this will help. Similarly you can search using the search in the upper right hand corner but again, I am pretty sure the filename that you pick is what gets recorded in the mapkey.

 

Chris3_0-1666886747751.png

 

lockarde
12-Amethyst
(To:Chris3)

Thanks for your help @Chris3! I think I can get this to work by using the filename box (provide it will record "activating/focusing" in on that field) and possibly pasting "*-501" - I'll keep messing around with it and let you know how I progress.

lockarde
12-Amethyst
(To:lockarde)

Following up on this post to share the solution.  I was able to get his to work! The mapkey is as follows:

mapkey(continued) @MAPKEY_LABELNew Drawing;~ Command `ProCmdModelNew` ;\
mapkey(continued) ~ Select `new` `Type` 1 `Drawing`;\
mapkey(continued) @MANUAL_PAUSEType Drawing File Name \nand Common Name;~ Activate `new` `OK`;\
mapkey(continued) ~ Activate `dwg_create` `psh_model_browse`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Update `file_open` `Inputname` `*-501.asm`;\
mapkey(continued) ~ Activate `file_open` `Inputname`;~ Activate `file_open` `Inputname`;\
mapkey(continued) ~ Select `dwg_create` `rad_format` 1 `1`;\
mapkey(continued) ~ Select `dwg_create` `template_names` 1 `def_template`;\
mapkey(continued) ~ Activate `dwg_create` `psh_ok`;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Table_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdDwgTblFromFile` ;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Activate `file_open` `view_favorites`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `AUTO-BOM`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `AUTO-BOM`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `def_table.tbl`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `def_table.tbl`;\
mapkey(continued) @PAUSE_FOR_SCREEN_PICK;

 

Adding the " * " to the file name was key, and it works every time.  This mapkey also selects the default table template I use that has repeat regions for auto populating material information and waits for placement on the drawing face..

Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal


Top Tags