Is there a possibilty to directly read the "styling" properties of a DWG layer in FME? By styling properties I mean e.g. the color, linetype, and lineweight.
Unfortunately, at least with standard reader options, these Schema Features do not have any styling properties associated with them:
As a workaround, I could read the Data Features of the DWG file with e.g. a standard RealDWG reader (Autodesk AutoCAD RealDWG DWG/DXF) and activate the option 'Store Layer Properties on Features' in the reader properties:
Then, the single Data Features have corresponding attributes with the information on their layer's styling properties:
However, this workaround has some limitations (e.g. if there are no Data Features on a specific layer).
Good question! Unfortunately the answer is as you suspected: there needs to be a feature in each layer of the template in order to read in the styling information into FME, as suggested by this previous Q&A thread.
I recently answered a similar question and had put together a workspace that adds a line feature to each layer of a template file, and you can find it attached here.
The workspace looks something like this:
Use a Creator (to create a line feature) + FeatureReader (with the AutoCAD DWG/DXF reader) to get the number of feature types /layers from the Schema output port
Get the count and make that many clones
Give the clones a Count for an ID to join with layer names so that each clones has one unique layer name
Write out using a feature type fanout with the template set on the writer. You can set the output file extension to .dwt
We have an enhancement request to ask for support for reading autocad template layer definitions tracked internally as (FMEENGINE-76295) and I'll update here when it has been addressed.
Hopefully that helps ease things up a bit more than going into AutoCAD to add a feature for each layer.
Good question! Unfortunately the answer is as you suspected: there needs to be a feature in each layer of the template in order to read in the styling information into FME, as suggested by this previous Q&A thread.
I recently answered a similar question and had put together a workspace that adds a line feature to each layer of a template file, and you can find it attached here.
The workspace looks something like this:
Use a Creator (to create a line feature) + FeatureReader (with the AutoCAD DWG/DXF reader) to get the number of feature types /layers from the Schema output port
Get the count and make that many clones
Give the clones a Count for an ID to join with layer names so that each clones has one unique layer name
Write out using a feature type fanout with the template set on the writer. You can set the output file extension to .dwt
We have an enhancement request to ask for support for reading autocad template layer definitions tracked internally as (FMEENGINE-76295) and I'll update here when it has been addressed.
Hopefully that helps ease things up a bit more than going into AutoCAD to add a feature for each layer.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.