Select to view content in your preferred language

CIMMapGrid graphical elements?

93
1
a week ago
GrantTaylor2
New Contributor II

Hi,

Is there a way to access the graphical elements (geometry, linework, labels) from a CIMMapGrid?

0 Kudos
1 Reply
UmaHarano
Esri Regular Contributor

You can access and work with the grid elements using the CIM (Pro's Cartographic Information Model.)

* Download the CIMViewer. Compile and deployt it.

* Use the CIMViewer to examine the Layout. (In the layout view, select the layout and click the Show CIM Viewer button. This will give you an idea about the CIMLayout and how to access its elements.

UmaHarano_0-1718296646900.png

* Your code to access the MapGrid will look like this:

var layoutView = LayoutView.Active;
if (layoutView == null)
  return;
await QueuedTask.Run( () => {
  var cimLayout = layoutView.Layout.GetDefinition();
  var layoutElements = cimLayout.Elements;
  var mapFrame = layoutElements.OfType<CIMMapFrame>().FirstOrDefault();
  var mapGirds = mapFrame.Grids;
  //get the first map grid
  var mapGrid = mapGirds.FirstOrDefault();
  //Do something with the map grid
  mapGrid.NeatlineSymbol = ....; //etc

});
0 Kudos