Skip to main content
Question

How to iterate through a list of .dwg file in order to convert them to .shp format

  • October 16, 2018
  • 2 replies
  • 131 views

Forum|alt.badge.img

Hi there,

New to FME! I would like to automate a simple FME task; convert .dwg to .shp. How can I go about doing this simple command for hundreds of .dwg files? Also, how can I make the output .shp to have as a suffix the original .dwg filename? e.g. 1234.dwg to (1234_line.shp, 1234_polyline.shp, 1234_polygon.shp and etc....)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

Forum|alt.badge.img
  • 28 replies
  • October 16, 2018
Hi @hugocrites

 

 

If the DWG files are within a single directory, when adding your reader you can select 'select multiple files' from the drop-down to the right of the 'dataset' parameter. Here you can select a folder rather than a file, and FME will add a feature type for each file within the folder.

 

 

If you need multiple SHP outputs, simply map these to equivalent SHP writers and the filename will remain the same.

 

 

If you need to merge them into a single output SHP, then you can use an AttributeExposer to expose the 'fme_basename' attribute, which is the filename of the input feature type. You can then use this in the writer output.

 

 

Cheers

 


Forum|alt.badge.img
  • Author
  • 3 replies
  • October 16, 2018
Hi @hugocrites

 

 

If the DWG files are within a single directory, when adding your reader you can select 'select multiple files' from the drop-down to the right of the 'dataset' parameter. Here you can select a folder rather than a file, and FME will add a feature type for each file within the folder.

 

 

If you need multiple SHP outputs, simply map these to equivalent SHP writers and the filename will remain the same.

 

 

If you need to merge them into a single output SHP, then you can use an AttributeExposer to expose the 'fme_basename' attribute, which is the filename of the input feature type. You can then use this in the writer output.

 

 

Cheers

 

@rileym Thanks for this! it worked