Question

Hello, I'm trying to make a simple coord. system transformation for a dwg file, and it works just fine but my problem is with resulting layers colors and linetypes being all the same. It's not surprising since it's defined to do so in options of wri

  • 17 December 2021
  • 4 replies
  • 1 view

Badge

I just want the resulting dwg to have the exact same layer colors and linetypes as the source.

Anyone succeeded in doing so?

Screenshot_4Screenshot_3Screenshot_2Screenshot_1


4 replies

Badge

I figured it out, I had to set to using a template file(the source file) in the writer.

Now comes the hard part, I want to use this for multiple files in a folder, get all files from a folder, reproject and write the same number of files but for every file use his source as template, that's tough for me.

Apparently I need to use fanout dataset with multiple workspaces and therefore a Workspacerunner.

But that is another question... oh God help me!😁

Userlevel 1
Badge +11

Hi @_mp7_​,

good catch on using the template file! It sounds like you're on the right track with your layer (fme_feature_type) fanout as well. For setting writer templates with multiple different files, you can use a user parameter for your template file instead of hardcoding it to one specific template file.

 

Source dataset user parameter:

Notice in the Navigator panel (View > Windows > Navigator), your reader has an icon with a purple cog and a person silhouette, it should say something like (Linked to SourceDataset_ACAD) at the end of the data source path and that's FME automatically creating a user parameter for the source data. You can then specify in the template file parameter on the writer, the down arrow > User Parameters > SourceDataset_ACAD to use the corresponding source file (layers colours /line type etc..) to write out. You may need to add the writer to the canvas first, I noticed that I couldn't select User Parameters from the dropdown immediately until after I had plopped the writer down and went back to edit it.

 

Here's a few resources to check out for more information:

 

Hope that helps a bit!

Badge

Hi @jovitaatsafe​ ,

thx so much for replying, it certainly helped a lot. In the meantime I made some progress, I managed to make it transform multiple files (every .dwg from a folder) to another folder with every single dwg transformed. The only problem is when using this method, I'm trapped at my problem from the start, as here I can't select the input file to be used for template, because I end up with layers being of the same color and linetype.

Apparently I need to use 2 workspaces, one with PATH reader and on the other treats one file at a time and so I can use traditional readers/writers with the template linked to the input file.

Sounds easy but being a beginner it's hard :)

 

 

Badge +20

Hi @jovitaatsafe​ ,

thx so much for replying, it certainly helped a lot. In the meantime I made some progress, I managed to make it transform multiple files (every .dwg from a folder) to another folder with every single dwg transformed. The only problem is when using this method, I'm trapped at my problem from the start, as here I can't select the input file to be used for template, because I end up with layers being of the same color and linetype.

Apparently I need to use 2 workspaces, one with PATH reader and on the other treats one file at a time and so I can use traditional readers/writers with the template linked to the input file.

Sounds easy but being a beginner it's hard :)

 

 

DWG Writer doesn't allow this but FeatureWriter set as DWG does.

You can set Template via attribute

Feature Reader template fileSo try it and let us know 😁

Reply