Question

How to write several dwg files to new created folder from PythonCaller

  • 11 March 2024
  • 3 replies
  • 46 views

Badge +6

Hello everyone,

I am converting several SDE geod to respective CAD files. All CADs need to be written in the same folder (with suffix of the currentdate). I  created this folder in Python Caller. How can I now route CADs to this folder?


3 replies

Userlevel 4
Badge +17

Hello,

FME can automatically create folders for you, if you write to ...\new_folder\test.dwg the ‘test.dwg’ file will be written in the newly created folder ‘new_folder’. You can also use a Date/Time function to create a folder name:

...\new_folder_@Left(@DateTimeNow(),8)\test.dwg

This will write ‘test.dwg’ to a newly created folder called ‘new_folder_20240311’

If you want to stick to the PythonCaller approach I would try the following:

  • Use the PythonCaller to create a feature with the path to the folder you created. 
  • Merge the path onto the features you are writing to your DWG.
  • Use the attribute in your DWG FeatureWriter to dynamically write to the folder you just created.

If you need help with any of the steps, let me know. 

Badge +6

Hi @joepk:- thank you! 

I am now using Feature Reader to read multiple geod. I used Feature Writer (output format as dwg) to create the new folder named as current date and year. 

What transformers can I use in between these two to export the dwg files to the above created folder with their same name as in the geod? Any suggestion is highly appreciated.  Thanks

Badge +6

Hi@joepk :- The issue is resolved. But thank you :)

 

Reply