Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hello,
Creo Parametric 8.0.6
I've created a mapkey to export dxf file and save drawing/part parameters then use vbscript to rename the dxf file, the mapkey works great in Creo but when i use distrubuted batch to export dxf using this mapkey it will only export the first page, is there a way to loop this for all pages in a drawing?
Thanks,
TTD
<TTD version="1.0" created_by="PTC">
<DESCRIPTION>Run a mapkey defined in a config.pro</DESCRIPTION>
<GROUP>Misc</GROUP>
<DETAILS>Will be run on any file type; user is responsible for choosing types that mapkey will operate on correctly.</DETAILS>
<SERVICE name="dbatchs"/>
<FILTER_FILE_TYPES type=".drw"/>
<!-- Replace "F1" with chosen mapkey when customizing file -->
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet">
<save_model>false</save_model>
</TKFUNC>
</TTD>
When you say it works great in Creo does it work for all pages?
Can you post the mapkey so we can look at what you are doing?
In drawing mode there is a go to sheet command. They removed it from the ribbon a while back but you can still find it in the search.
If the problem is advancing to the next page you could use this, although would have to test out what happens if you try and go to page 2 on a drawing that only has 1 sheet. It may cause Creo to crash. The only place I use this with mapkeys is to go to the first page so I don't know what happens if you try and go to a sheet that doesn't exist.
this is the mapkey i use in distribute batch, this mapkey also calls for another mapkey and also run a vbscript
mapkey dxfdet @MAPKEY_NAMEDXF Detail Number;@MAPKEY_LABELDXF Detail Number;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdExportPreview` ;\
mapkey(continued) ~ Command `ProCmdDwgPubSetDeliverable` `DXF`;\
mapkey(continued) ~ Command `ProCmdDwgPubSettings` ;\
mapkey(continued) ~ Select `export_2d_dlg` `Splines_Group` 1 `as_splines`;\
mapkey(continued) ~ Select `export_2d_dlg` `Hatching_Group` 1 `as_hatch`;\
mapkey(continued) ~ Select `export_2d_dlg` `Points_Group` 1 `as_points`;\
mapkey(continued) ~ Select `export_2d_dlg` `Notes_Group` 1 `as_notes`;\
mapkey(continued) ~ Activate `export_2d_dlg` `GenLog_Button` 0;\
mapkey(continued) ~ Activate `export_2d_dlg` `OK_Button`;~ Command `ProCmdDwgPubExport` ;\
mapkey(continued) ~ LButtonArm `file_saveas` `tb_EMBED_BROWSER_TB_SAB_LAYOUT` 3 567 12 0;\
mapkey(continued) ~ LButtonDisarm `file_saveas` `tb_EMBED_BROWSER_TB_SAB_LAYOUT` 3 567 12 0;\
mapkey(continued) ~ LButtonActivate `file_saveas` `tb_EMBED_BROWSER_TB_SAB_LAYOUT` 3 567 12 0;\
mapkey(continued) ~ Input `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \
mapkey(continued) `F:\\dxf_pdf_export\\temp_workspace`;\
mapkey(continued) ~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \
mapkey(continued) `F:\\dxf_pdf_export\\temp_workspace`;\
mapkey(continued) ~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Command `ProCmdDwgPubCloseExportPvw` ;\
mapkey(continued) ~ Activate `main_dlg_cur` `ProCmdWinActivate.view`;%dwgpara;\
mapkey(continued) #sheets;#next;#done/return;\
mapkey(continued) @SYSTEMstart F:\\dxf_pdf_export\\temp_workspace\\rename.vbs;
mapkey dwgpara @MAPKEY_NAMESave dwg parameters;@MAPKEY_LABELSave dwg parameters;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Annotate_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdDtlInsFreeNote` ;\
mapkey(continued) ~ Select `dwg_selpnt_dlg` `rad_sel_method` 1 `abs_coord`;\
mapkey(continued) ~ Input `dwg_selpnt_dlg` `opt_abs_x` `-`;\
mapkey(continued) ~ Input `dwg_selpnt_dlg` `opt_abs_x` `-2`;\
mapkey(continued) ~ Update `dwg_selpnt_dlg` `opt_abs_x` `-2`;\
mapkey(continued) ~ FocusOut `dwg_selpnt_dlg` `opt_abs_x`;\
mapkey(continued) ~ Input `dwg_selpnt_dlg` `opt_abs_y` `5`;\
mapkey(continued) ~ Update `dwg_selpnt_dlg` `opt_abs_y` `5`;\
mapkey(continued) ~ FocusOut `dwg_selpnt_dlg` `opt_abs_y`;~ Activate `dwg_selpnt_dlg` `psh_ok`;\
mapkey(continued) ~ Command `ProCmdDtlTextFromFile` ;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `dwg_para.txt`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `dwg_para.txt`;\
mapkey(continued) ~ Command `ProCmdDtlTextSaveToFile` ;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Select `file_open` `Location Browser`;\
mapkey(continued) ~ Close `file_open` `Location Browser`;\
mapkey(continued) ~ Activate `file_open` `M_pfafs:drives`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `f:`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `f:`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `dxf_pdf_export`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `dxf_pdf_export`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `temp_workspace`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `temp_workspace`;\
mapkey(continued) ~ Input `file_open` `Inputname` `dwgpara.txt`;\
mapkey(continued) ~ Update `file_open` `Inputname` `dwgpara.txt`;\
mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd` ;\
mapkey(continued) ~ Key `main_dlg_cur` `proe_win` 9 1336 1123 196608 512 3401 1746 3840 2160 \
mapkey(continued) 5348506 `Del`;~ Command `ProCmdEditDelete` ;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Layout_control_btn` 1;
rename.vbs
ok it doesn't look like you are changing sheets then. So try adding in the bit where you change sheets. If Creo crashes when you try and change to sheet 2 if it doesn't exist then it looks like you are exporting the parameters so you could use those to have VBS create a mapkey that iterates to through the number of sheets you have. Then you would import that mapkey (generated by vbs) and run that.
My mapkeys and script work fine but distributed batch doesn't loop the mapkey base on # of pages in the drawing. I wonder if there's a way to add this mapkey within 2d_dxf_export function.
a workaround is to chain the TKFUNC
<TTD version="1.0" created_by="PTC">
<DESCRIPTION>Run "DXFDET" mapkey defined in a config.pro</DESCRIPTION>
<GROUP>Misc</GROUP>
<DETAILS>Will be run on any file type; user is responsible for choosing types that mapkey will operate on correctly.</DETAILS>
<SERVICE name="dbatchs"/>
<FILTER_FILE_TYPES type=".drw"/>
<!-- Replace "F1" with chosen mapkey when customizing file -->
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
<TKFUNC func="ProMapkeyRun" mapkey_key_sequence="dxfdet"></TKFUNC>
</TTD>