geoink

getting and setting Layer_Properties of a CAD based layer in ArcMap using Python

Discussion created by geoink on Mar 31, 2011
Latest reply on Mar 6, 2013 by khodge-esristaff
Looking for the proper commands to control cad layers as you would using Arcmap's Layer Properties from the Drawing Layers tab.  The calls, i guess, would be similar to the "visible" or "showLabels" as below.  It would be real nice to get to assign to a list all of the Layers of the cad drawing.  And then from the list change the autocad layer visibility.   Also any direction to using python to change the visibility of the Fields would be of use.  Sometimes when i load an annotation dwg, the only field name displayed is "Text" and i need "Layer" in order to refine a definition query.  Thanks in advance.

>>> import arcpy
>>> currentmxd=arcpy.mapping.MapDocument("Current")
>>> df = arcpy.mapping.ListDataFrames(currentmxd)[0]
>>> theNewLayer=arcpy.mapping.ListLayers(currentmxd)[5]
>>> theNewLayer.visible = True
>>> theNewLayer.showLabels = True

Outcomes