Hi,
I see now that to get consistent results the Eye and the upvector also need to be set. Here is another example. Does this solve the problem?
Public Sub Zoom_With_Camera()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Set oSheet = oDoc.ActiveSheet
Dim sheetWidth As Double
sheetWidth = oSheet.Width
Dim sheetHeight As Double
sheetHeight = oSheet.Height
Dim oCamera As Camera
Set oCamera = ThisApplication.ActiveView.Camera
'Set oCamera = oDoc.Views(1).Camera
Dim NewTargetPnt As point
Set NewTargetPnt = ThisApplication.TransientGeometry.CreatePoint(sheetWidth / 2, sheetHeight / 2, 0)
oCamera.Target = NewTargetPnt
Dim newEyePnt As point
Set newEyePnt = ThisApplication.TransientGeometry.CreatePoint(sheetWidth / 2, sheetHeight / 2, 1)
oCamera.Eye = newEyePnt
oCamera.UpVector = ThisApplication.TransientGeometry.CreateUnitVector(0, 1, 0)
' Call oCamera.SetExtents(40, 40)
oCamera.Apply
End Sub
Thanks,
Wayne
Wayne Brill
Developer Technical Services
Autodesk Developer Network