Using CIMGridLine.ElementType GridElementType.Corner

210
1
Jump to solution
05-18-2020 10:26 AM
ChrisLocke
New Contributor

Hi,

any sample code for using CIMGridLine with GridElementType.Corner? 

I am trying to modify the code given here

https://community.esri.com/message/888447-re-how-to-add-cimgraticule-into-mapframe-object?commentID=..., but keep crashing as I am not sure which properties are required or how exactly VisibleIndices is used (if at all?).

Thanks.

Solved:

GridElementType.Corner needs to be used in conjunction with CIMGraticule.IsAutoScaled = true.

If CIMGridPattern Interval = 0 then the coordinates will show at the exact corners. If this has a value the coordinates will show at the closest auto scaled tick to the corner.

So edit code from above to include:

var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Corner Label",
ElementType = GridElementType.Corner,
GridLineOrientation = GridLineOrientation.NorthSouth,

Pattern = new CIMGridPattern { Interval = 0, Start = 0, Stop = 1, Gap = 0 },

etc.....

}

var mapGrid = new CIMGraticule
{
Name = "Graticule",
IsVisible = true,
IsAutoScaled = true,

etc....

}

0 Kudos
1 Solution

Accepted Solutions
ChrisLocke
New Contributor

Solved:

GridElementType.Corner needs to be used in conjunction with CIMGraticule.IsAutoScaled = true.

If CIMGridPattern Interval = 0 then the coordinates will show at the exact corners. If this has a value the coordinates will show at the closest auto scaled tick to the corner.

So edit code from above to include:

var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Corner Label",
ElementType = GridElementType.Corner,
GridLineOrientation = GridLineOrientation.NorthSouth,

Pattern = new CIMGridPattern { Interval = 0, Start = 0, Stop = 1, Gap = 0 },

etc.....

}

var mapGrid = new CIMGraticule
{
Name = "Graticule",
IsVisible = true,
IsAutoScaled = true,

etc....

}

View solution in original post

0 Kudos
1 Reply
ChrisLocke
New Contributor

Solved:

GridElementType.Corner needs to be used in conjunction with CIMGraticule.IsAutoScaled = true.

If CIMGridPattern Interval = 0 then the coordinates will show at the exact corners. If this has a value the coordinates will show at the closest auto scaled tick to the corner.

So edit code from above to include:

var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Corner Label",
ElementType = GridElementType.Corner,
GridLineOrientation = GridLineOrientation.NorthSouth,

Pattern = new CIMGridPattern { Interval = 0, Start = 0, Stop = 1, Gap = 0 },

etc.....

}

var mapGrid = new CIMGraticule
{
Name = "Graticule",
IsVisible = true,
IsAutoScaled = true,

etc....

}

0 Kudos