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

DRW to DXF automation

Anonymous
Not applicable

DRW to DXF automation

Hello,

 

I am wondering if there is an option to automate drw to dxf process.

 

I get a lot drw files and I have to open them with Creo, then I have to choose right view I need to export (there are many views available). After that I click on size and remove format, make it flat, make correct scale 1:1 and at the end I delete annotation and save as dxf. And prepare it for sheetmetal with another application. It takes a long time for one export, I have to do this 40 times a day at least. I am wondering if there is any way to make this faster in Creo.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Fair warning about using the Part as a starting point, there may be more steps but it's a more repeatable process. The one downside of using the part is that you may have to type in the name of the DXF. Which ever method you decide, remember to break this into small pieces by recording each little bit one at a time (say into a mapkey called TEMP), then saving the TEMP mapkey to your desktop, open TEMP.pro in Notepad, and pasting each small section of mapkeys together into your config.pro and save, and then load your updated DXF mapkey into Creo using the UPMAP mapkey from my other post about mapkeys. This is will allow you quickly build/test portions of your mapkey by solving one part at a time.

 

Here's the steps I used but feel free to start simple:

  • Unbend model (if you're working with sheetmetal) - if this command fails because model is already unbent or is not a sheetmetal part, mapkey will skip this if you add the appropriate exit unbend button clicks
  • Windchill Check Out Dialogue Box may popup - click continue
  • Search model tree using Find Tool for All Cosmetic Features and Sketches and Hide them - this prevents sketches from showing up later in DXF. 
    • CTRL-A to select all from search results, add all to Selected Item column on the right, and then exit find tool - they should still be selected and then use the hide command
    • You'll have to do this once for Cosmetic Features and then again for Sketches
  • Create a new view for DXF using the View Manager - delete 'view4dxf' view so you can rerun the mapkey on the same part without getting errors about 'view4dxf' already existing. Then create  'view4dxf' view:
    • To use 1 click for creating a view, Using 'View Normal' and 'Refit' Commands. If the orientation of your DXF matters, you can rotate the CAD model before clicking the surface to 'View Normal' to.
    • Use the "@MANUAL_PAUSE" to prompt the user to pick the surface
  • Create new drawing without a format
    • Type in name of DXF - may need to include _DXF in the name if drawing already exists. You could have the mapkey make a temporary drawing file like 'tempdxf' and have the user name the DXF later at the end if desired
    • Pause mapkey and have the user place the 'view4dxf' view on the drawing
    • Set view settings - scale of 1.0, Display Style set to 'No Hidden' or whatever your DXF needs
  • Delete extras annotations or things that might show up when placing views
    • Use the Creo Find tool to find Notes, Symbols, and Surface Finishes... Select All (CTRL-A), and delete all (one type at a time)
    • Might not be necessary but I delete all drawing layers which can remove some things that show up
    • Consider adding a pause mapkey for a user to review/clean the DXF before export
  • Export DXF
    • There are several ways to export a DXF but using the Export>DXF sets the DXF settings BEFORE having the user chose a location/name. Set settings as needed and then click Export.
    • If you have a standard location you like to save the DXFs to, navigate to it in the mapkey to save time. Remember that not everyone has your same 'Favorites' folders so consider pasting location into the bar at the top if your saving to a Network Drive. Clicking on the Desktop on shortcut will work to take you to the users Desktop if desired.
    • Mapkey pause for user to save/name the DXF and prompt them to click Resume so you can close several windows that are now open.
    • Click OK on the Save a Copy window - assuming you want to overwrite any DXF with the same name that exists in your target folder, you can click through these dialogues boxes to overwrite.
    • Click Close Export DXF page
  • Close the active Window - which should be the DXF drawing
  • Erase Not Displayed to erase temporary DXF drawing
  • The Part that you started from should now be open - you could close this automatically but I usually end the mapkey here with the part open.

View solution in original post

7 REPLIES 7

I would start with Creo Mapkeys and if you're not able to get far enough with that, try either Creo APIs or 3rd part scripting tool like SIGMAXIM SmartAssembly but they will likely require more time/money than mapkeys. Mapkeys are a recording of Creo button clicks and they're included as part of Creo. Here's a post I wrote about making mapkeys.

I have created several 'complex' dxf mapkeys that could create 2D DXFs in about 20 seconds per DXF - see the attached video. My usual perference for a starting point was actually from the Creo PRT file and not the drawing since drawings are pretty variable as as starting point since you likely have extras views, the view you want may have the wrong view settings, removing tables, removing formats, removing anotations, remove notes, removing symbols, etc. No matter which mapkey method you choose, using the Creo Find tool is your best bet to Select All (use CTRL-A to select all objects in search results) and Delete All symbols, notes, annotations, tables, etc.

 

If you want to start from a view from the drawing, record the following steps (you can record each step one at a time, save each portion out, and stitch/modify each portion together in your config.pro):

  • Remove the Format - remove all tables in the dialogue boxes
  • Creo may pop up a Windchill message about Checking Out or Continue - probably select Continue
  • Using the Creo Find tool... select/delete all tables, notes, annotations, symbols etc.
  • Select and delete all layers on the drawing - optional but this seemed to be useful for removing extra garbage from a drawing for me
  • You'll probably have to pause the mapkey/prompt the user to delete the undesired drawings views unless the Drawing View you want always has the same name
  • Save As Dxf - Pause mapkey and have user choose the location/name of file - you could navigate to a specific location if desired
  • Optional: close current Creo window and 'Erase Not Displayed' depending on whether you'd like to manually close or have the mapkey do it for you

You will have to test and change this as necessary.

Anonymous
Not applicable
(To:lhoogeveen)

This looks good, from PRT, can you write me a step by step from PRT?

 

I am still quite new to this.

 

Thank you.

Fair warning about using the Part as a starting point, there may be more steps but it's a more repeatable process. The one downside of using the part is that you may have to type in the name of the DXF. Which ever method you decide, remember to break this into small pieces by recording each little bit one at a time (say into a mapkey called TEMP), then saving the TEMP mapkey to your desktop, open TEMP.pro in Notepad, and pasting each small section of mapkeys together into your config.pro and save, and then load your updated DXF mapkey into Creo using the UPMAP mapkey from my other post about mapkeys. This is will allow you quickly build/test portions of your mapkey by solving one part at a time.

 

Here's the steps I used but feel free to start simple:

  • Unbend model (if you're working with sheetmetal) - if this command fails because model is already unbent or is not a sheetmetal part, mapkey will skip this if you add the appropriate exit unbend button clicks
  • Windchill Check Out Dialogue Box may popup - click continue
  • Search model tree using Find Tool for All Cosmetic Features and Sketches and Hide them - this prevents sketches from showing up later in DXF. 
    • CTRL-A to select all from search results, add all to Selected Item column on the right, and then exit find tool - they should still be selected and then use the hide command
    • You'll have to do this once for Cosmetic Features and then again for Sketches
  • Create a new view for DXF using the View Manager - delete 'view4dxf' view so you can rerun the mapkey on the same part without getting errors about 'view4dxf' already existing. Then create  'view4dxf' view:
    • To use 1 click for creating a view, Using 'View Normal' and 'Refit' Commands. If the orientation of your DXF matters, you can rotate the CAD model before clicking the surface to 'View Normal' to.
    • Use the "@MANUAL_PAUSE" to prompt the user to pick the surface
  • Create new drawing without a format
    • Type in name of DXF - may need to include _DXF in the name if drawing already exists. You could have the mapkey make a temporary drawing file like 'tempdxf' and have the user name the DXF later at the end if desired
    • Pause mapkey and have the user place the 'view4dxf' view on the drawing
    • Set view settings - scale of 1.0, Display Style set to 'No Hidden' or whatever your DXF needs
  • Delete extras annotations or things that might show up when placing views
    • Use the Creo Find tool to find Notes, Symbols, and Surface Finishes... Select All (CTRL-A), and delete all (one type at a time)
    • Might not be necessary but I delete all drawing layers which can remove some things that show up
    • Consider adding a pause mapkey for a user to review/clean the DXF before export
  • Export DXF
    • There are several ways to export a DXF but using the Export>DXF sets the DXF settings BEFORE having the user chose a location/name. Set settings as needed and then click Export.
    • If you have a standard location you like to save the DXFs to, navigate to it in the mapkey to save time. Remember that not everyone has your same 'Favorites' folders so consider pasting location into the bar at the top if your saving to a Network Drive. Clicking on the Desktop on shortcut will work to take you to the users Desktop if desired.
    • Mapkey pause for user to save/name the DXF and prompt them to click Resume so you can close several windows that are now open.
    • Click OK on the Save a Copy window - assuming you want to overwrite any DXF with the same name that exists in your target folder, you can click through these dialogues boxes to overwrite.
    • Click Close Export DXF page
  • Close the active Window - which should be the DXF drawing
  • Erase Not Displayed to erase temporary DXF drawing
  • The Part that you started from should now be open - you could close this automatically but I usually end the mapkey here with the part open.

Would you mind posting the mapkey file so I can import it and use it? This is pure genius and will save us alot of time.

 

-Branden

psobejko
12-Amethyst
(To:Anonymous)

You maybe could also look into this threads:

Create DXF

 

also:

how to export each sheet as separate dxf from drawing file

 

Anonymous
Not applicable
(To:psobejko)

Thank you for all the help!

Top Tags