Rotate view with vba

551
2
11-10-2011 05:28 AM
RobertoSpedale
New Contributor
Hi
I would to rotate the view with vba by an angle define (like set "Rotation" in "Data frame properties").
I use this code to set Map scale but I can't set Map Rotation:

Dim pMxApp As IMxApplication
Set pMxApp = Application
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim map1 As IMap
Set map1 = pMxDoc.Maps.Item(0)
pMxDoc.Maps.Item(0).MapScale = 10000
Dim pActiveView As IActiveView
Set pActiveView = pMxDoc.ActiveView
pActiveView.Refresh


Could someone tell me how to rotate view?!
Now I am using ArcGIS 9.1 version.

Thanks a lot!
Roberto
0 Kudos
2 Replies
TimWhiteaker
Occasional Contributor II
I'm using 9.2, but this worked.

  Set pActiveView = pMxDoc.FocusMap
  pActiveView.ScreenDisplay.DisplayTransformation.Rotation = 90
  pActiveView.Refresh
0 Kudos
RobertoSpedale
New Contributor
I'm using 9.2, but this worked.


It works! Many many thanks!
0 Kudos