- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i read a lot of stuff concerning Views, Camera and so on and tried much more.....
I want to use or rebuild the implemented feature in Inventor "Adjusting View to a Workplane" with vb.net. It's enclosed in the ViewCube
One part works in my code: Setting the Camera Eye in the right Position to the normal auf the workplane.
The second part, rotating like the inventor feature does, don't works. I have no idea how to create the right UpVector concerning to the workplane.
I recognized also that the original feature as different behavior dependent on how the actual camera view is positioned to the screen.
Here is my code:
The Workplane comes from the selected Plane
Sub Adjust_Camera(oWorkPlane As WorkPlane) Dim oTG As TransientGeometry = InventorApp.TransientGeometry Dim oView As View = InventorApp.ActiveView Dim oCamera As Camera = oView.Camera 'Vektor der Normalen Dim oNormalEye As Inventor.Vector = oWorkPlane.Plane.Normal.AsVector 'set camera Target to Root Point oCamera.Target = oWorkPlane.Plane.RootPoint 'set camera Eye Dim pEye As Point = oCamera.Target pEye.TranslateBy(oNormalEye) oCamera.Eye = pEye 'until here it works fine 'How can i get the right upVector for adjusting the camera like Inventor does it? Dim oUpvector As UnitVector = InventorApp.TransientGeometry.CreateUnitVector(0, 0, 1) 'example oCamera.UpVector = oUpvector 'apply camera settings oCamera.Apply() End Sub End Class
In Sample eye.ipt (Inventor2017) for example i want to adjust "Arbeitsebene3"
Hoping for your help.
Best Regards Martin
Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Solved! Go to Solution.