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
  • 102 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....)

2 replies

Forum|alt.badge.img
  • 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
  • October 16, 2018
rileym wrote:
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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings