Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
Could anyone help me with the method below. I would like to zoom to a (non-selected) occurrence, which behaves exactly like the 'Find in Window' command on BrowserNodes.
How do I setup the camera correctly so it zooms to the occurrence without changing viewing direction of the camera? I can't figure it out. Thanks in advance!
private void ZoomToOccurrence(ComponentOccurrence occurrence)
{
var camera = InventorApplication.ActiveView.Camera;
var minPoint = occurrence.RangeBox.MinPoint;
var maxPoint = occurrence.RangeBox.MaxPoint;
var centerPoint = InventorApplication.TransientGeometry.CreatePoint((maxPoint.X - minPoint.X), (maxPoint.Y - minPoint.Y), (maxPoint.Z- minPoint.Z));
var target = centerPoint;
var eye = ???
camera.Target = target;
camera.Eye = ???
camera.SetExtents(40, 40);
camera.Apply();
}
Solved! Go to Solution.