Skip to main content
Solved

Set dynamic AutoCAD Layer coloring to DWG Writer

  • 28 January 2020
  • 4 replies
  • 63 views

  • Hi all,

I am specifying the AutoCAD Layer color by a given attribute 'Category' which is being filtered using 'AttributeFilter' transformer and redirected to each DWG Writer to specify the AutoCAD Layer Name and color. All the below DWG Writers are a single DWG Output File.

 

For some reason, when no features are written to some of the above DWG Writer, I still have that AutoCAD Layer Name written as below, even though no features have been past through the attribute filter so I am not even sure why that Layer 1, Layer 100000, etc. is being set.

Any help would be highly appreciated.

 

Thanks,

Ana

4 replies

Userlevel 1
Badge +17

Are you using a DWG template file for the writer?

If that is the case those empty layers are part of the template and will be created in the output DWG.

Hope this helps finding the issue.

Badge

Are you using a DWG template file for the writer?

If that is the case those empty layers are part of the template and will be created in the output DWG.

Hope this helps finding the issue.

No, I am not using a DWG template file but just setting the Default Color to an AutoCAD color code equivalent such as '250' in order to set a color for each 'Category' as my AutoCAD layers change every time the workspace is run and could not find a way to make Template File work for this case.

Userlevel 1
Badge +17

Looking at the DWG writer parameters here, you could set the parameter "Purge Unused Objects" to Yes to avoid writing empty layers.

Hope this helps.

Badge

Looking at the DWG writer parameters here, you could set the parameter "Purge Unused Objects" to Yes to avoid writing empty layers.

Hope this helps.

This has solved the problem. Many thanks for your help Erik. It is really appreciated :)

Reply