Skip to main content

Hi I have a GDB file with feature layers from ArcGIS Pro in it that I would like to use workbench to convert to CAD while maintaining the symbology colors.

 

I have extracted the colors of the symbology in hex code format *(E.g. #ffffff) into the attribute tables of the layers.

 

I added my GDB in as a Reader, added in an AttributeFilter, link the field that my symbology is dependent on back in ArcGIS, then added in a DWGStyler to every single possible option in that field in AttributeFilter.

 

I set the color of DWGStyler to be the field containing the hexcode, and then added in my output vis writer and connected everything.

 

But no matter what I try, the CAD file doesn't register any of that at all.

FME Color by attributeAs you can see, none of the hex colors seemed to have gotten into my CAD file.

image.png

You probably can find the answer in the translation log. I think you need to use a different value then a hex code to set the color. You can use the ColorConverterNew from the FME Hub to convert from HEX to FME color codes.


You probably can find the answer in the translation log. I think you need to use a different value then a hex code to set the color. You can use the ColorConverterNew from the FME Hub to convert from HEX to FME color codes.

Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

In the ColorConverterNew, choose the from = HEX, to = FME.

 

In the DWGStyler, choose FME_COLOR, not HEX_COLOR.

 

Be aware, this will set the color of the line, not the color of the layer.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

ok so FME itself doesn't support working with Hex colors (at least I don't think so). Typically everything needs to be converted to fme color (0-1) or RGB (0-255).

 

In the ColorConverterNew you can pick FME as output color and then in the DWGStyler you can pick FME_COLOR from the list.

 

image 

The AUTOCAD output here can be used, however, not in conjunction with the DWGStyler. The DWGStyler assumes that data are in fme's internal format rather than already prepared for ACAD


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Hi @virtualcitymatt​ & @nielsgerrits​ !

 

I think it worked, at least for polygonal layers. I will need to play around with points and polyline files.

ArcGIS Pro to CAD maintaining symbology 

Do any of you know how I might be able to make a python script to automate the process? I have multiple files, all of which have the same data in their attribute tables where the color data exists to be passed into ColorConverterNew -> DWGStyler -> Writer.

 


Other solution​ without python.

Make a table (e.g. Excel) with colums e.g.

feature_layer,​ fill_color, line_color, ...

Merge the table with your data (FeatureMerger) and control the DwgStyler ​ with attributes.

It's for the moment more to work,​ but very easy to update the workflow in case of new featureclasses.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

How I do this:

  • Creator to initiate
  • FeatureReader (Directory and File Pathnames) to scan folder for files.
  • Filter only files needed using Tester / TestFilter / AttributeFilter.
  • Use FilenamePartExtractor to get _dirpath and _rootname.
  • FeatureReader to read dwg based on path_windows. Merge attributes.
  • Conversion, all group by path_windows etc to keep these attributes.
  • FeatureWriter to write results, using _dirpath and _rootname.

Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

By the way @nielsgerrits​ any chance you know how to convert points from a GDB to blocks in DWG?

 

I have no issues with polylines and polygons but I can't seem to get points to work.

 

Point To Block failI'm currently using AttributeCreator with the following settings

New Attribute | Attribute Value

autocad_entity| autocad_insert

autocad_block_name|BasicPoint

 

BasicPoint is the name of the point I created and saved in my BasicPoint.dwg file I'm using as a template.

 

No matter what I try the end results still is an empty cad file.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

There are 2 ways of creating blocks in dwg's:

  • Send an collection / Aggregate to a dwg (Feature)Writer
  • Send a point to a dwg (Feature)Writer, using the DWGStyler. This requires you to define a template file in the (Feature)Writer which contains the blocks referred to in the DWGStyler. I point to the same file when doing this.

Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

2nd method worked!Original PointsColor carried over but not on the block itselfBut the color data doesn't seem to be going through to the block itself:

 

image.pngIt shows up on the properties like in the screenshot of CAD but the points all seem to take color data from the layer?


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

I'm also trying to follow along with your steps for batch conversion but I don't understand what I'm suppose to select and if I have selected any wrong info.imageimage.pngI'm linking this folder to the workspace and I think I can do a filter from the reader via Path Filter but I'm at a lost on what to do next.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Use the feature with the path to the gdb (path_windows) as input for the FeatureReader, where field Dataset = attribute path_windows.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Not sure if I follow, is this what you meant?image.png


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Yes exactly. Then under Output Ports, choose Single Output Port.

 

As the input is dynamic (based on attribute) the FeatureReader can not know what FeatureClasses it will get, that is the other screen you get. So you read everything, generic. Then you can use an AttributeExposer to expose fme_feature_type (in gdb, this is feature class name) split the features by featureclass, if needed.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

imageOk I added an AttributeExposer and then connected it to my ColorConverterNew but I don't see any of the fields I need that I would with a single file, did I miss a step somewhere?


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

You you will need to expose these attributes as well. In the AttributeExposer, you can import from feature cache.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

imageI tried both import by Feature Cache and Dataset, both only seem to contain data at the folder level containing my gdbs, nothing specific from my gdb were there :/


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Ah, I see the issue.

First reader need to read the directory.

Second reader needs to read the gdb. So it should be a GDB reader, not a Directory reader.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Nice I was able to retrieve the fields I need for color conversion! Now I'm stuck on how I'm suppose to export the files?

Also is there a way to handle errors? I'm assuming that a user might have both line and polygonal layers in their GDBs, and the line will still have a FillColorField, but all of the values should be null, so I think that might return a Rejected output.

 

Also I'm not sure what exactly is getting rejected in my FeatureReader reading GDB files o.O

 

Update, I have garbage data that is completely incompatible with my workspace which brings up a good point, is there a way I can handle bad files in a batch? Like just skip over them and let the user know which of those files were skipped?image.png


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

Glad you got to the next step 🙂 You probably want to start a new topic for a new question.


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

imageOoph sorry but I haven't figured out what I need to put to export my files yet 😂

When I was running the single file process previously what I did was just type in a name of a dwg file.

For the batch processed version will this still apply?

If it does then I assume what happens is everything gets chucked into a single DWG file and not their own DWG file on a per GDB basis(Which is what I'm trying to achieve)?

 


Hi @nielsgerrits​  thanks for replying! I'm still very new to FME (Literally started using this today).

I downloaded the ColorConverterNew and loaded it into my workbench as per the picture:

Updated workflow below:image.pngAll my hex codes should be in the correct format needed by ColorConverterNew:

Hex codesAnd after running the workspace there doesn't appear to be any warning. But opening the exported DWG file, it seems like nothing carried over in terms of colors?

 

CAD no colors

You can fanout on an attribute name. The DirectoryReader also has a filename and a rootname attribute. You can configure the FeatureReader to merge the attributes from the initiating feature, to merge the original filename to each feature and use that when writing.


Reply