Question

I would like to take a number of dwg files from one location, change the coordinate system, and save them to another location with a suffix i.e. '_newfile'. I have the code for the coordinate conversion, but having trouble with the bulk input and o


I would like to take a number of dwg files from one location, change the coordinate system, and save them to another location with a suffix i.e. '_newfile'.

I have the code for the coordinate conversion, but am having trouble with the bulk input and output with the suffx- any help with code would be much appreciated, thanks!


3 replies

Userlevel 1
Badge +11

Hi @geraldlockard​ ,

Good question! If you're reading a number of dwg files and want to output files a suffix, take a look at this dataset fanout example. Under the Dataset Fanout section midway down the page, and in particular steps 3 and 4 show an example of a fanout based on Neighbour names and a prefix of _trees. For your dataset, it would look more like @Value(fme_basename)_newfile.dwg. You will likely need to expose the fme_basename attribute in the Format Attributes tab when you double click the yellow reader feature type to allow you to choose this in the Fanout Dataset expression.

 

In my screenshot below, I'm reading two DWG files as a single merged feature type, using a feature type fanout on my layer name to retain my layers, and a dataset fanout to get a suffix on my output file names.

 

fanout-expressionResulting in:

output_suffixRegarding bulk inputs, you might also be interested in checking out batch processing options, and a good place to start is this article: Can FME be Used in Batch Mode?

 

Hope that helps! Happy FME'ing (:

Hi @geraldlockard​ ,

Good question! If you're reading a number of dwg files and want to output files a suffix, take a look at this dataset fanout example. Under the Dataset Fanout section midway down the page, and in particular steps 3 and 4 show an example of a fanout based on Neighbour names and a prefix of _trees. For your dataset, it would look more like @Value(fme_basename)_newfile.dwg. You will likely need to expose the fme_basename attribute in the Format Attributes tab when you double click the yellow reader feature type to allow you to choose this in the Fanout Dataset expression.

 

In my screenshot below, I'm reading two DWG files as a single merged feature type, using a feature type fanout on my layer name to retain my layers, and a dataset fanout to get a suffix on my output file names.

 

fanout-expressionResulting in:

output_suffixRegarding bulk inputs, you might also be interested in checking out batch processing options, and a good place to start is this article: Can FME be Used in Batch Mode?

 

Hope that helps! Happy FME'ing (:

Thanks for the response Jovitaatsafe,

 

I have reviewed the fanout demo and the bulk attribute rename information, unfortunately these do not provide me with the functionality I am looking for. Essentialy it is two processes- please see below:

  1. I have a folder of files and I would like to rename them all and put them in another folder is this possible using fme?
  2. I have a fme coordinates transform script, can I apply this to all files within a folder? I would rather not have to open each file one at a time to run the script.

Thanks

Userlevel 3
Badge +17

Thanks for the response Jovitaatsafe,

 

I have reviewed the fanout demo and the bulk attribute rename information, unfortunately these do not provide me with the functionality I am looking for. Essentialy it is two processes- please see below:

  1. I have a folder of files and I would like to rename them all and put them in another folder is this possible using fme?
  2. I have a fme coordinates transform script, can I apply this to all files within a folder? I would rather not have to open each file one at a time to run the script.

Thanks

Dear Gerard,

 

FME is a powerfull application that can do lot's of stuff after you get to know the program.

 

It is best to learn the program so you can do what you want.

 

First step is to open lot's of files. See my example workbench here:

https://community.safe.com/s/question/0D54Q00008lShSvSAK/create-simple-batch-file-and-run

 

If you can open and view lot's of files you are ready for the next step, do the desired transformation on 1 of these files. This is done by a Reprojector.

 

Then you save the files with a different filename. Look at the fan-out example and the last transformer in my workbench.

 

 

 

 

 

 

Reply