Skip to main content
Question

obtain the sourcedata file name dynamically when using a folder as a source

  • September 3, 2016
  • 3 replies
  • 53 views

Hi

I am trying to set up a dynamic workbench to convert a dwg drawing with object data to an ADAC xml file. I am pointing to a folder as the dwg source file. The source folder will contain a dwg file which will be deleted upon conversion. so the next incoming dwg will have a different name. I want the destination xml file to have the same name as the incoming dwg file. Could some one please confirm if this is possible and if so suggest methhods that I could use to achieve this objective.

3 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 3, 2016

Hi @luckydesilva,

You can use the following:

Read the folder content with a merge feature type (*.dwg) and expose the fme_basename for the DWG file name.

Another option is to use the directory and file paths reader with a filter (*.dwg) and use the attributes produced by the reader for location and file name.

A shutdown Python script or a simple systecaller dos combination can help delete the original file.

Hope this helps.


Hi Itay

I shall try the merge feature option. I think I tried the "filename path extractor" but this does not appear to work. I maybe doing something wrong of course.

Thank you!


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 3, 2016
luckydesilva wrote:

Hi Itay

I shall try the merge feature option. I think I tried the "filename path extractor" but this does not appear to work. I maybe doing something wrong of course.

Thank you!

you need to specify in the reader settings to retrieve file properties

 

 


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