Manipulate Viewport In Side Database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I currently have a program making a new sheet and inserting a viewport in a side database. I am trying to figure out how I can switch to model space and zoom to a window in the side database. I can do this with the following code with the drawing open using the editor but would prefer not to.
//Activate model space in the viewport
doc.Editor.SwitchToModelSpace();
//Zoom to object
ZoomWindow(ed, viewminPt, viewmaxPt);
//Switch to Paper space
doc.Editor.SwitchToPaperSpace();
private static void ZoomWindow(Editor ed, Point3d min, Point3d max)
{
Point2d min2d = new Point2d(min.X, min.Y);
Point2d max2d = new Point2d(max.X, max.Y);
ViewTableRecord view = new ViewTableRecord();
view.CenterPoint = min2d + ((max2d - min2d) / 2.0);
view.Height = max2d.Y - min2d.Y;
view.Width = max2d.X - min2d.X;
ed.SetCurrentView(view);
}
Any help is appreciated.