<?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 Importing AutoCAD using python, how do I exclude frozen/off &amp;quot;Layers&amp;quot; in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/importing-autocad-using-python-how-do-i-exclude/m-p/495888#M38933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to append data from AutoCAD DWG into existing FGDB feature classes using python/arcpy.&amp;nbsp; The CAD drafter has set specific Layers to "frozen" or "off" to eliminate them from his view and I would like to keep these settings upon import.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS reads these settings when I view the same AutoCAD file in ArcMap/ArcCatalog, however, I cannot get arcpy to respect these settings while importing the data using python.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my boiled down code:&lt;/P&gt;&lt;PRE class="python" name="code"&gt;outFC = "&amp;lt;outGDB&amp;gt;\\&amp;lt;outFC&amp;gt;" inputDrawing = "&amp;lt;path&amp;gt;\\&amp;lt;file&amp;gt;.dwg" inputLayer = os.path.basename(inputDrawing) + "_layer"&amp;nbsp; arcpy.MakeFeatureLayer_management(inputDrawing,(inputLayer + _FI), desc = arcpy.Describe(inputLayer + _FI) field_info = desc.fieldInfo #this is dumb but allows me to get the field info dynamically&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(inputDrawing,inputLayer,&amp;lt;layer information&amp;gt;,"","",field_info) arcpy.SelectLayerByAttribute_management(inputLayer, "NEW_SELECTION", "NOT \"Layer\" LIKE 'S_Grid%' AND NOT \"Layer\" = '0'") # This list of exclusions is what I want to avoid&amp;nbsp; arcpy.Append_management(inputLayer, outFC, "NO_TEST") &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Has anyone done this before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Nov 2014 21:46:45 GMT</pubDate>
    <dc:creator>TrevorWeiland</dc:creator>
    <dc:date>2014-11-13T21:46:45Z</dc:date>
    <item>
      <title>Importing AutoCAD using python, how do I exclude frozen/off "Layers"</title>
      <link>https://community.esri.com/t5/python-questions/importing-autocad-using-python-how-do-i-exclude/m-p/495888#M38933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to append data from AutoCAD DWG into existing FGDB feature classes using python/arcpy.&amp;nbsp; The CAD drafter has set specific Layers to "frozen" or "off" to eliminate them from his view and I would like to keep these settings upon import.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS reads these settings when I view the same AutoCAD file in ArcMap/ArcCatalog, however, I cannot get arcpy to respect these settings while importing the data using python.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my boiled down code:&lt;/P&gt;&lt;PRE class="python" name="code"&gt;outFC = "&amp;lt;outGDB&amp;gt;\\&amp;lt;outFC&amp;gt;" inputDrawing = "&amp;lt;path&amp;gt;\\&amp;lt;file&amp;gt;.dwg" inputLayer = os.path.basename(inputDrawing) + "_layer"&amp;nbsp; arcpy.MakeFeatureLayer_management(inputDrawing,(inputLayer + _FI), desc = arcpy.Describe(inputLayer + _FI) field_info = desc.fieldInfo #this is dumb but allows me to get the field info dynamically&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(inputDrawing,inputLayer,&amp;lt;layer information&amp;gt;,"","",field_info) arcpy.SelectLayerByAttribute_management(inputLayer, "NEW_SELECTION", "NOT \"Layer\" LIKE 'S_Grid%' AND NOT \"Layer\" = '0'") # This list of exclusions is what I want to avoid&amp;nbsp; arcpy.Append_management(inputLayer, outFC, "NO_TEST") &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Has anyone done this before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 21:46:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/importing-autocad-using-python-how-do-i-exclude/m-p/495888#M38933</guid>
      <dc:creator>TrevorWeiland</dc:creator>
      <dc:date>2014-11-13T21:46:45Z</dc:date>
    </item>
  </channel>
</rss>

