Solved

Multiple DWG templates

  • 2 November 2017
  • 7 replies
  • 9 views

Badge +2

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
icon

Best answer by david_r 2 November 2017, 13:30

View original

7 replies

Userlevel 4

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.

Badge +2

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

 

 

Userlevel 4

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.

Badge +2

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?

Userlevel 4

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.

Reply