That is indeed something that would save time. Thank you. Somehow I implemented switching to the ISO view on save at the start of the addin I made. Perhaps because I wanted to be sure that the ISO view is used at save, but maybe I can acces this setting instead of manipulating the camera.
However, I figured out how to get the current camera position and later go back to that position, after a save. So for someone else who could use (a part) of my code, here it is.
To get the current view:
public void CurrentView(Data.ViewData viewData)
{
Inventor.View activeView = Globals.invApp.ActiveView;
Camera camera = activeView.Camera;
Point eyePoint = camera.Eye;
Point targetPoint = camera.Target;
UnitVector upVector = camera.UpVector;
Double perspectiveAngle = camera.PerspectiveAngle;
viewData.EyePoint = eyePoint;
viewData.TargetPoint = targetPoint;
viewData.UpVector = upVector;
viewData.PerspectiveAngle = perspectiveAngle;
}
To go back to the view the user was before the save:
public void ReturnView(Data.ViewData viewData)
{
Inventor.View activeView = Globals.invApp.ActiveView;
Camera camera = activeView.Camera;
camera.Eye = viewData.EyePoint;
camera.Target = viewData.TargetPoint;
camera.UpVector = viewData.UpVector;
camera.PerspectiveAngle = viewData.PerspectiveAngle;
camera.ApplyWithoutTransition();
}
A separate class stores the values:
public class ViewData
{
public Point EyePoint { get; set; }
public Point TargetPoint { get; set; }
public UnitVector UpVector { get; set; }
public Double PerspectiveAngle { get; set; }
}