Select to view content in your preferred language

Can I select layer on contents view programmatically ?

160
3
Jump to solution
Thursday
rdc_hirohara
New Contributor

I am currently attempting to port a tool from ArcGIS Desktop + ArcObjects to ArcGIS Pro. In ArcObjects, I was able to select a layer in the content view using the following code:

IMap map = ArcMap.Document.FocusMap;
IActiveView activeView = (IActiveView)map;
IContentsView contentsView = mxd.CurrentContentsView;
contentsView.SelectedItem = layer;

However, in ArcGIS Pro, I cannot find an equivalent functionality. Is there a corresponding feature available in ArcGIS Pro? I could not find it in the API reference.

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Yes, You can. MapView has method SelectLayers.

View solution in original post

3 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Yes, You can. MapView has method SelectLayers.

rdc_hirohara
New Contributor
Thank you for the information, GKmieliauskas. The SelectLayers method in MapView is exactly what I was looking for. I appreciate your help!
0 Kudos
GKmieliauskas
Esri Regular Contributor

So, accept as solution

0 Kudos