<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Apply CAD symbology to CADToGeodatabase_conversion FeatureClass in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/apply-cad-symbology-to-cadtogeodatabase-conversion/m-p/630353#M49085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've got thousands of DWG files that used to be published as MapServices since ArcGIS 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;In &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000002r7000000" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS&lt;/A&gt; 10.1, CAD FeatureClass are no longer supported for MapServices&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using CADToGeodatabase_conversion to export them to FGB format and then I add them to a map document as Layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I need to apply the CAD File symbology to these Layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone achieved this ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I've been doing so far :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I first validated that the process could be done manually in ArcMap :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I could apply my .lyr file symbology to the associated CADToGeodatabase_conversion FeatureClass layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I'm stuck trying to script the process :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've made a layer from the CAD file and test the symbology type :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for dwg in glob.glob("*.dwg"):

 dwgPath = os.path.abspathdwg 
 arcpy.env.workspace = dwgPath

 dwgFcList = arcpy.ListFeatureClasses()

 for dwgFc in dwgFcList :

&amp;nbsp; arcpy.MakeFeatureLayer_management(dwgFc,myFeatLayName)
&amp;nbsp; layer = arcpy.mapping.Layer(myFeatLayName)

&amp;nbsp; print layer.symbologyType
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It says "OTHER" as it supposes to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However the documentation says that you can not convert the symbology if the symbology type is "OTHER" :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;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.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s300000008000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s300000008000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone an idea to get this working ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:49:27 GMT</pubDate>
    <dc:creator>SchoppMatthieu</dc:creator>
    <dc:date>2021-12-12T02:49:27Z</dc:date>
    <item>
      <title>Apply CAD symbology to CADToGeodatabase_conversion FeatureClass</title>
      <link>https://community.esri.com/t5/python-questions/apply-cad-symbology-to-cadtogeodatabase-conversion/m-p/630353#M49085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've got thousands of DWG files that used to be published as MapServices since ArcGIS 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;In &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000002r7000000" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS&lt;/A&gt; 10.1, CAD FeatureClass are no longer supported for MapServices&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using CADToGeodatabase_conversion to export them to FGB format and then I add them to a map document as Layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I need to apply the CAD File symbology to these Layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone achieved this ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I've been doing so far :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I first validated that the process could be done manually in ArcMap :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I could apply my .lyr file symbology to the associated CADToGeodatabase_conversion FeatureClass layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I'm stuck trying to script the process :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've made a layer from the CAD file and test the symbology type :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for dwg in glob.glob("*.dwg"):

 dwgPath = os.path.abspathdwg 
 arcpy.env.workspace = dwgPath

 dwgFcList = arcpy.ListFeatureClasses()

 for dwgFc in dwgFcList :

&amp;nbsp; arcpy.MakeFeatureLayer_management(dwgFc,myFeatLayName)
&amp;nbsp; layer = arcpy.mapping.Layer(myFeatLayName)

&amp;nbsp; print layer.symbologyType
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It says "OTHER" as it supposes to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However the documentation says that you can not convert the symbology if the symbology type is "OTHER" :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;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.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s300000008000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s300000008000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone an idea to get this working ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-cad-symbology-to-cadtogeodatabase-conversion/m-p/630353#M49085</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2021-12-12T02:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Apply CAD symbology to CADToGeodatabase_conversion FeatureClass</title>
      <link>https://community.esri.com/t5/python-questions/apply-cad-symbology-to-cadtogeodatabase-conversion/m-p/630354#M49086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding my thousands of CAD files at once manually craches ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to add DWG layers to ArcMap using python and how to preserve the CAD symbology ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 10:57:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-cad-symbology-to-cadtogeodatabase-conversion/m-p/630354#M49086</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2013-09-30T10:57:26Z</dc:date>
    </item>
  </channel>
</rss>

