Apply CAD symbology to CADToGeodatabase_conversion FeatureClass

624
1
09-30-2013 02:57 AM
SchoppMatthieu
New Contributor III
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 ?
Tags (2)
0 Kudos
1 Reply
SchoppMatthieu
New Contributor III
Also, an alternative for me is to publish my CAD files as a mapservice with ArcGIS 9.3, to cache it and then to use the cache with a 10.1 mapservice.

The problem I have in this scenario is the one I described in the previous post : Adding DWG Layer using arcpy.AddLayer doesn't preserves CAD symbology as it does when you add the layer manually in ArcMap.

Adding my thousands of CAD files at once manually craches ArcMap.
Does anyone know how to add DWG layers to ArcMap using python and how to preserve the CAD symbology ?
0 Kudos