Select to view content in your preferred language

Data frame rotation angle.

860
3
10-16-2011 08:33 PM
papegowda1
Deactivated User
I am developing VB.net(ArcObjects)  program similar to Data driven pages. I am facing problem when printing irregular shape polygons which contains data frame rotation.

When we set the data frame rotation angle the data is not displaying in the center. This was the problem which was exist in the data driven pages also, but after service pack 3 this was solved.

Please let me know how this was fixed in the data driven pages, so that I can implement same in my application.
0 Kudos
3 Replies
JohnLutz1
New Contributor
Hi Pape,

Please give the following pseudocode a try.   When there is rotation, use the index shape's envelope to set the map extent...

    double rotation = ipMap.ScreenDisplay.DisplayTransformation.Rotation
    if (rotation != 0)
      IPoint ipCenter = IGeometry5(ipIndexShape).CentroidEx
      ITransform2D(ipIndexShape).Rotate(ipCenter, DEG2RAD(rotation))

      ISegmentCollection ipPolygon = new esriGeometry.Polygon
      ipPolygon.SetRectangle(ipIndexShape.Envelope);
      ITransform2D(ipPolygon).Rotate(ipCenter, -DEG2RAD(rotation));
      ipIndexShape = ipPolygon;
    EndIf
0 Kudos
papegowda1
Deactivated User
Hi John,

Thanks for suggestion. If you can translate this code to VB.net it will be great help for me and also I have not understood the �??ipIndexShape�?? variable. Can you please elaborate more on this?

Please help me it was urgent for me.
0 Kudos
JohnLutz1
New Contributor
The big picture for Map Books is that you use the features in an "index" layer to define the map extents for a series of pages.   The ipIndexShape variable above is the geometry being used to define the map extent for the current page.  Hope that helps.

John
0 Kudos