If your workspace only treats one dwg file at a time, you can link the template parameter to the input filename parameter:
If you have a fully dynamic workspace that treats multiple, different dwgs at once, consider using the FeatureWriter rather than a regular writer. The FeatureWriter will let you link the template file to a feature attribute, e.g. fme_dataset which will contain the input filename.
If your workspace only treats one dwg file at a time, you can link the template parameter to the input filename parameter:
If you have a fully dynamic workspace that treats multiple, different dwgs at once, consider using the FeatureWriter rather than a regular writer. The FeatureWriter will let you link the template file to a feature attribute, e.g. fme_dataset which will contain the input filename.
Hi David,
Thanks for your reply! I'm running multiple dwg's at the same time so the first solution won't work in this case.
If using the FeatureWriter I run in to two new problems. It seems that I can't fanout on basename and create multiple files?
Also I'm using a "hack" that @Mark2AtSafe showed me in another thread to allow minus signs in attributes. It seems that the FeatureWriter completely disregards that.
Link to the other thread:
https://knowledge.safe.com/questions/56810/dwg-minus-symbol.html
You may want to consider using two workspaces: Workspace A that iterates over all your dwg files using the PATH reader and launches workspace B for each file (WorkspaceRunner). Workspace B only treats one file at a time and you can therefore use the traditional readers/writers with the template linked to the input file. Hopefully that works.
If your workspace only treats one dwg file at a time, you can link the template parameter to the input filename parameter:
If you have a fully dynamic workspace that treats multiple, different dwgs at once, consider using the FeatureWriter rather than a regular writer. The FeatureWriter will let you link the template file to a feature attribute, e.g. fme_dataset which will contain the input filename.
It turns out you can fanout with the featurewriter, I didn't know that. So all in all the featurewriter is the best way to go. Thanks for both your answers!
It turns out you can fanout with the featurewriter, I didn't know that. So all in all the featurewriter is the best way to go. Thanks for both your answers!
Hello !
I have the same question.
It seems to me that you are addressing 2 questions. Yes fanout lets you parametrically define dwg output names , but have you been able to parametrically define multiple templates?, namely each dwg file gets its corresponding file as template.
You may want to consider using two workspaces: Workspace A that iterates over all your dwg files using the PATH reader and launches workspace B for each file (WorkspaceRunner). Workspace B only treats one file at a time and you can therefore use the traditional readers/writers with the template linked to the input file. Hopefully that works.
Hello David
can you elaborate on youw workspace solution?
Hello David
can you elaborate on youw workspace solution?
It's been 3 years, but I'll try :-)
Workspace 1:
- Read all filenames of all the input files using the "Directory and File Pathnames" reader
- Decide which template file to use for the output, e.g. using the TestFilter
- WorkspaceRunner to execute workspace 2, with published parameters for the input filename and for the chosen template file
Workspace 2:
- DWG reader with filename linked to a published parameter
- DWG writer with the template file linked to a published parameter
Some reading material:
I hope this helps.