<?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 Re: How to enable in Python script visibility of labels, prepared in CIMaccess in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146548#M51822</link>
    <description>&lt;P&gt;... yes, of course. To this help I am foolishly gapeing the whole week. Veronika&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 16:36:56 GMT</pubDate>
    <dc:creator>VeronikaVlčková</dc:creator>
    <dc:date>2022-02-22T16:36:56Z</dc:date>
    <item>
      <title>How to enable in Python script visibility of labels, prepared in CIMaccess</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146525#M51818</link>
      <description>&lt;P&gt;This script does not work - I need to button up LABEL in properties of layer in a layout ... and it does not well. Where I have a mistake? Thanke You very much. Veronika&lt;/P&gt;&lt;P&gt;"...&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;nnulta.showlabels = True&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;nnulta_cim = nnulta.getDefinition('V2') # vytahne format znaceni&lt;BR /&gt;nnultaz = nnulta_cim.labelClasses[0] # sahne na aktualni tridu znaceni&lt;/P&gt;&lt;P&gt;nnultaz.type = 'CIMLabelClass'&lt;BR /&gt;nnultaz.expression = '$feature.SPT'&lt;BR /&gt;nnultaz.expressionEngine = 'Arcade' # jazyk znaceni&lt;BR /&gt;nnultaz.featuresToLabel = 'AllVisibleFeatures'&lt;BR /&gt;nnultaz.name = 'Class 1'&lt;BR /&gt;nnultaz.priority = -1&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;nnultaz.visibility = -1&lt;/FONT&gt;&lt;BR /&gt;nnultaz.iD = -1&lt;/P&gt;&lt;P&gt;nnulta.setDefinition(nnulta_cim) # prepise format znaceni... doufam&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;nnulta.showlabels = True&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;nnulta_cim = nnulta.getDefinition('V2')&lt;BR /&gt;nnulta.setDefinition(nnulta_cim)&lt;BR /&gt;projektik.save()&lt;/P&gt;&lt;P&gt;..."&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:09:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146525#M51818</guid>
      <dc:creator>VeronikaVlčková</dc:creator>
      <dc:date>2022-02-22T16:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable in Python script visibility of labels, prepared in CIMaccess</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146537#M51820</link>
      <description>&lt;P&gt;cim access is discussed here for labels&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/labelclass-class.htm" target="_blank"&gt;LabelClass—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;check to see if your layer supports labelling as in the help&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:21:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146537#M51820</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-22T16:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable in Python script visibility of labels, prepared in CIMaccess</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146548#M51822</link>
      <description>&lt;P&gt;... yes, of course. To this help I am foolishly gapeing the whole week. Veronika&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146548#M51822</guid>
      <dc:creator>VeronikaVlčková</dc:creator>
      <dc:date>2022-02-22T16:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable in Python script visibility of labels, prepared in CIMaccess</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146600#M51825</link>
      <description>&lt;P&gt;I tried the following code in my APRX project via notebook&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx=arcpy.mp.ArcGISProject("CURRENT")
map = aprx.listMaps()[0]
layer = map.listLayers()[0]
print("Supports labels", layer.supports("SHOWLABELS"))
cim = layer.getDefinition('V2')
cim_lc = cim.labelClasses[0]
cim_lc.type = 'CIMLabelClass'
cim_lc.expression = '$feature.Name'
cim_lc.expressionEngine='Arcade'
cim_lc.featuresToLabel = 'AllVisibleFeatures'
cim_lc.name = 'Class 1'
cim_lc.priority = -1
cim_lc.visibility = True
cim_lc.iD = -1
layer.setDefinition(cim)
layer.showLabels=True
aprx.save()&lt;/LI-CODE&gt;&lt;P&gt;I changed "visibility=-1" to "visibility=True" but it worked either way.&lt;/P&gt;&lt;P&gt;The test for layer.supports("SHOWLABELS") is False when labeling is turned off and to get it to change to True I can just do layer.showLabels=True as in my code sample. So that test is useless.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/152062"&gt;@VeronikaVlčková&lt;/a&gt;&amp;nbsp;You need to give us more context since the sample you sent actually worked for me. Can you show the rest of the code? Can you upload a minimal APRX file??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 18:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-enable-in-python-script-visibility-of/m-p/1146600#M51825</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-02-22T18:02:07Z</dc:date>
    </item>
  </channel>
</rss>

