Enable or Disable Popups in Python in ARCGIS Pro

829
1
Jump to solution
12-09-2020 06:42 PM
LeandraGordon
Occasional Contributor II

Hi All,

Is there any way to enable/disable popups in Arcpy for pro?

I am using ArcPro 2.4.0


I have a number of layers in a map that I am preparing for sharing into Portal and we wish to turn off popups for some and enable them for others.

I am using .LRYX files to style the features and popups are disabled in the layer file ( "htmlPopupEnabled" : false, &  "showPopups" : false, ) but it does not seem to be reading the layer file for this setting ( I am running Apply Symbology from Layer)
Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor

You can enable/disable pop ups using python and the ArcPro CIM module. The basic code is:

p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('phi_clip')[0]
l_cim = l.getDefinition('V2')
l_cim.showPopups = False
l.setDefinition(l_cim)

 

Note: phi_clip is a layer name in my project, obviously change it to your requirements

View solution in original post

1 Reply
DuncanHornby
MVP Notable Contributor

You can enable/disable pop ups using python and the ArcPro CIM module. The basic code is:

p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('phi_clip')[0]
l_cim = l.getDefinition('V2')
l_cim.showPopups = False
l.setDefinition(l_cim)

 

Note: phi_clip is a layer name in my project, obviously change it to your requirements