Skip to main content
Solved

Multiple DWG templates

  • November 2, 2017
  • 7 replies
  • 83 views

jatoxa
Contributor
Forum|alt.badge.img+12

Does anyone know if it's possible to write with multiple DWG templates. I've tried making a published parameter and defining the template fil as AutoCadSource but it seems it only applies the first one.

 

I need each corresponding template to be the original file that I'm reading in because they're all different and have different block names within them.

 

 

Thanks!

 

 

/Jacob

Best answer by david_r

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

david_r
Celebrity
  • 8392 replies
  • Best Answer
  • November 2, 2017

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.


jatoxa
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • 65 replies
  • November 2, 2017

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

 

 


david_r
Celebrity
  • 8392 replies
  • November 2, 2017

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.


jatoxa
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • 65 replies
  • November 3, 2017

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!

 

 


  • 6 replies
  • September 3, 2020
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.


  • 6 replies
  • September 3, 2020

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?


david_r
Celebrity
  • 8392 replies
  • September 3, 2020

Hello David

can you elaborate on youw workspace solution?

It's been 3 years, but I'll try :-)

Workspace 1:

  1. Read all filenames of all the input files using the "Directory and File Pathnames" reader
  2. Decide which template file to use for the output, e.g. using the TestFilter
  3. WorkspaceRunner to execute workspace 2, with published parameters for the input filename and for the chosen template file

Workspace 2:

  1. DWG reader with filename linked to a published parameter
  2. DWG writer with the template file linked to a published parameter

Some reading material:

I hope this helps.