Hi,
Is there a way to access the graphical elements (geometry, linework, labels) from a CIMMapGrid?
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.
* 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 });
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.