Matshopp

Apply CAD symbology to CADToGeodatabase_conversion FeatureClass

Discussion created by Matshopp on Sep 30, 2013
Latest reply on Sep 30, 2013 by Matshopp
I've got thousands of DWG files that used to be published as MapServices since ArcGIS 10.1.

In ArcGIS 10.1, CAD FeatureClass are no longer supported for MapServices

I'm using CADToGeodatabase_conversion to export them to FGB format and then I add them to a map document as Layers.

Now I need to apply the CAD File symbology to these Layers.

Has anyone achieved this ?


Here is what I've been doing so far :

I first validated that the process could be done manually in ArcMap :
I add my dwg file, get to its FeatureClass layer properties, change "CAD unique entity value" to "Unique values, many fields" (which match perfectly) and export it as a .lyr file.
Then I could apply my .lyr file symbology to the associated CADToGeodatabase_conversion FeatureClass layer.
It works fine.

But I'm stuck trying to script the process :

I've made a layer from the CAD file and test the symbology type :

for dwg in glob.glob("*.dwg"):

 dwgPath = os.path.abspathdwg 
 arcpy.env.workspace = dwgPath

 dwgFcList = arcpy.ListFeatureClasses()

 for dwgFc in dwgFcList :

  arcpy.MakeFeatureLayer_management(dwgFc,myFeatLayName)
  layer = arcpy.mapping.Layer(myFeatLayName)

  print layer.symbologyType


It says "OTHER" as it supposes to.

If I'm adding the layer to a map document at this stage, the layer is recognized as "CAD Feature Class" but its symbology is "uniqueValue". Anyway,

I thought I could change the symbology type to "Unique values, many fields", save it as a .lyr file and then apply it to my CADToGeodatabase_conversion FeatureClass layer as I've done manually.

However the documentation says that you can not convert the symbology if the symbology type is "OTHER" :

Depending on the symbology type, a layer's symbology can be modified. There are a limited number of supported symbology types for which properties and methods are available. It is good practice to first test the layer's symbologyType property. If a value of OTHER is returned, then the layer's symbology can't be modified.

http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s300000008000000

Has anyone an idea to get this working ?

Outcomes