At 3.2 they added ability to change grouplayer to either check boxes or radio buttons. Is there a way to create a new grouplayer in code to default to radio buttons? I'm using LayerFactory.Instance.CreateGroupLayer() to create the GroupLayer. I can't find any methods to do so (or options in the CTOR), but maybe still too new?
Thanks,
Joe
Solved! Go to Solution.
You can access the CIM Definition of the Group Layer to accomplish this. Code snippet:
//Construct/Create the group layer first.
var groupLayerCreationParams = new GroupLayerCreationParams();
groupLayerCreationParams.Name = "Group Layer";
var groupLayer = LayerFactory.Instance.
CreateLayer<GroupLayer>(groupLayerCreationParams, MapView.Active.Map);
//Get the CIM Definition of the group layer
var groupLayerDefinition = groupLayer.GetDefinition() as CIMGroupLayer;
//Set the "SublayerVisibilityMode" CIM property of the group layer to
//"Independent" or "Exclusive". Use the SublayerVisibilityMode enum.
//SublayerVisibilityMode.Exclusive - Radio button
//SublayerVisibilityMode.Independent - checkbox
groupLayerDefinition.SublayerVisibilityMode = SublayerVisibilityMode.Exclusive;
//Set the modified CIM Definition back to the group layer.
groupLayer.SetDefinition(groupLayerDefinition);
You can access the CIM Definition of the Group Layer to accomplish this. Code snippet:
//Construct/Create the group layer first.
var groupLayerCreationParams = new GroupLayerCreationParams();
groupLayerCreationParams.Name = "Group Layer";
var groupLayer = LayerFactory.Instance.
CreateLayer<GroupLayer>(groupLayerCreationParams, MapView.Active.Map);
//Get the CIM Definition of the group layer
var groupLayerDefinition = groupLayer.GetDefinition() as CIMGroupLayer;
//Set the "SublayerVisibilityMode" CIM property of the group layer to
//"Independent" or "Exclusive". Use the SublayerVisibilityMode enum.
//SublayerVisibilityMode.Exclusive - Radio button
//SublayerVisibilityMode.Independent - checkbox
groupLayerDefinition.SublayerVisibilityMode = SublayerVisibilityMode.Exclusive;
//Set the modified CIM Definition back to the group layer.
groupLayer.SetDefinition(groupLayerDefinition);
That worked great thank you. Is there a CIM diagram that describes all the CIM definitions of most things in the map or a layout? Seems you can modify just about anything using those definitions.
Found a good doc: DevSummitPS_33.pdf (SECURED) (esri.com)
You can use the CIM Viewer addin to examine the CIM Definition of objects in ArcGIS Pro. If you are on Pro 3.x, use the addin from the CIMViewer_3.x folder in the above repo.
The ReadMe file in the repo has detailed instructions on how to use the addin to view the CIM Definitions.