Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Translate the entire conversation x

Mapkey script which export Flat Pattern to DXF for cutting

TH_12158333
3-Newcomer

Mapkey script which export Flat Pattern to DXF for cutting

Creo Parametric 6.0.5.1

 

Hello,

i have manage to create Mapkey script which create DXF for Flat pattern state but i have small problem.

 

Prereqs: Copy a1_laser.drw to C:\Program Files\PTC\Creo 6.0.5.1\Common Files\creo_standards\templates

 

Add this script at end of Config.pro

 

mapkey $F3 @MAPKEY_LABELSheetmetal_to_DXF;\
mapkey(continued) ~ Trail `MiniToolbar` `MiniToolbar` `UIT_TRANSLUCENT` `NEED_TO_CLOSE`;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_View_control_btn` 1;\
mapkey(continued) ~ Select `main_dlg_cur` `View:casc340798662`;\
mapkey(continued) ~ Close `main_dlg_cur` `View:casc340798662`;~ Command `ProCmdViewOrient` ;\
mapkey(continued) ~ Input `orient` `NameVw_IP` `F`;~ Input `orient` `NameVw_IP` `FR`;\
mapkey(continued) ~ Input `orient` `NameVw_IP` `FRO`;~ Input `orient` `NameVw_IP` `FRON`;\
mapkey(continued) ~ Input `orient` `NameVw_IP` `FRONT`;~ Update `orient` `NameVw_IP` `FRONT`;\
mapkey(continued) ~ Activate `orient` `orientsurfPH.OrientSel1`;@PAUSE_FOR_SCREEN_PICK;\
mapkey(continued) ~ Activate `orient` `NameVw_PB_Save`;Yes;~ Activate `orient` `OkPB`;\
mapkey(continued) ~ Select `main_dlg_cur` `appl_casc`;~ Close `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Command `ProCmdModelNew` ;~ Select `new` `Type` 1 `Drawing`;\
mapkey(continued) ~ Activate `new` `OK`;\
mapkey(continued) ~ Select `dwg_create` `lst_template_names` 1 `a1_laser`;\
mapkey(continued) ~ Activate `dwg_create` `psh_ok`;\
mapkey(continued) ~ Command `ProCmdDwgShowAllAnnots@PopupMenuGraphicWinStack` ;\
mapkey(continued) ~ Select `show_model_annotations` `tab_dtl_types` 1 `lay_datum`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row0` `type`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row0` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row1` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row2` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `` ``;\
mapkey(continued) ~ Activate `show_model_annotations` `psh_sel_all_dtm`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row3` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row2` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row1` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row0` `show`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `` ``;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row0` `type`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row1` `type`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `row3` `type`;\
mapkey(continued) ~ Trigger `show_model_annotations` `tbl_datum` 2 `` ``;\
mapkey(continued) ~ Activate `show_model_annotations` `psh_apply`;\
mapkey(continued) ~ Activate `show_model_annotations` `psh_cancel`;\
mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdExportPreview` ;\
mapkey(continued) ~ Command `ProCmdDwgPubSettings` ;~ Activate `export_2d_dlg` `OK_Button`;\
mapkey(continued) ~ Command `ProCmdDwgPubExport` ;~ Activate `file_saveas` `OK`;\
mapkey(continued) ~ Activate `UI Message Dialog` `ok`;~ Command `ProCmdDwgPubCloseExportPvw` ;\
mapkey(continued) ~ Command `ProCmdWinCloseGroup` ;~ Close `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Command `ProCmdModelEraseNotDisp` ;~ Activate `file_erase_nd` `ok_pb`;

 

 

Workflow:

  1. NORMAL TO Flat Pattern state
  2. Press F3 > Choose Flat Pattern surface

TH_12158333_0-1738839414410.png

 

After that, Flat Patterned DXF should be created in Working directory 😉

 

But now i have 2 problems:

  1. Exported DXF dont have bending lines
  2. Want all SPLINES to be POLYLINES

This is DXF, but it does contains bending lines.

 

TH_12158333_0-1738834334475.png

 

I want DXF to look like this:

TH_12158333_1-1738834382608.png

 

Is there any way to export Bend lines by default when creating DXF i know options SHOW annotation and select all lines but i want default way?

 

4 REPLIES 4
Van_AG
14-Alexandrite
(To:TH_12158333)

For bend lines you should display them in the drawing before export

For splines to polylines use config option

intf2d_out_enhanced_ents hatch_only

or

intf2d_out_enhanced_ents none

"For bend lines you should display them in the drawing before export"

That sucks, because the idea is to not create drawing in first place 😞

 

"intf2d_out_enhanced_ents none"

Thanks, this works 🙂

This is not my area of expertise, but if there is a way to show them using the show annotation button and you are generating a mapkey for this process anyways, can't you just incorporate the show annotations into your mapkey?

I try this but annotation still not displayed when using Mapkey 😞

Announcements


NEW Creo+ Topics: Real-time Collaboration

Top Tags