Question

Extract layer definitions from AutoCAD DWT template

  • 9 October 2019
  • 4 replies
  • 25 views

Badge +11

I have an AutoCAD DWT template file and I would like to extract all of the layer definitions (e.g. line style, weight, colour, etc.). The DWT file does not contain any objects (i.e. no lines, points, blocks, etc.), so FME does not have any features to process. Is there any way that I can extract the layer definitions?

I've tried using the schema reader and I can use that to get all the layer names, but not the associated linestyles, etc.

My end goal is that I need to validate supplied CAD files against the standard layer definitions defined in the template file and I was hoping to extract the template layer definitions into a spreadsheet or database so that I could use that to do the validation. Perhaps I'm going about this the wrong way? Is there a way that I can use FME to validate that a DWG matches a template DWT definition?


4 replies

Badge +16

Hi @nic_ran,

You might want to consider adding a feature per layer to the template and this way make it useful for the validation in FME.

Badge +3

@nic_ran

 

as @itay said.

 

I use dwg as templates (DWT was a DWG anyway.) and am still required for the fme reader to add an object per layer.

Then fme can read the applied styling.

 

( Then extract the info to a excell if required)

 

This issue is described in this forum a couple of times. You still (afaik) need an object per layer.

 

Badge +11

@gio, @itay, thank you both for your replies. I implemented that solution after I wrote the question and it is working well. Appreciate the validation that I'm on the right track!

@gio, I looked for other questions/answers on this topic but didn't find any. Perhaps I'm using the wrong search terms... Anyway, hope this is helpful to any others who might come across it.

Userlevel 2
Badge +17

Automated solution that extracts the layers from the DWT file by reading the schema, then creates a temporary DWG with a point on each layer, using the DWT as a template. The points are read back from the temporary file to get the layer information, which is then output to an Excel file with the same rootname as the DWT. The Excel table displays both the color number and swatch showing the actual color.

Screen Shot 2023-08-30 at 2.43.29 PM

Reply