Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm struggling to grasp this camera object. I want to move the camera as if the user zoomed/panned to point on a sheet.
I have the XY values from the balloon I'm looking for but I cant do what I want. The CameraPosX and Y are passed into this sub. e.g X=9.5, Y=11.0
Dim oDoc As Inventor.DrawingDocument: Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet: Set oSheet = oDoc.Sheets(SheetName) 'Actions oDoc.BrowserPanes("Model").Activate oSheet.Activate ' Get the active camera. Dim cam As Camera: Set cam = ThisApplication.ActiveView.Camera Dim tg As TransientGeometry: Set tg = ThisApplication.TransientGeometry ' Define the distance between the eye and target. Dim eyeDistance As Double: eyeDistance = 1 ' Set the eye with a hard coded z value. cam.ViewOrientationType = kFrontViewOrientation cam.Eye = tg.CreatePoint(CameraPosX, CameraPosY, eyeDistance) cam.Target = tg.CreatePoint(CameraPosX, CameraPosY, 0) ' Define the up vector as positive z. cam.UpVector = tg.CreateUnitVector(0, 0, 0) 'Dim cameraOr As ViewOrientationTypeEnum 'cameraOr = kFrontViewOrientation 'Call cam.SetExtents(CameraPosX + 10, CameraPosY + 10) ' Apply the current camera definition to the view. cam.ApplyWithoutTransition
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Solved! Go to Solution.