Autodesk Revit API
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'm racking my brains on this one. I can't seem to find a way to programmatically zoom/pan. I know I can zoom to the extents of the selected objects, but that's not what I want.
thanks in advance, Chuck
Re: programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Don't believe it's possible I would also like to save current extents, center point & zoom for the current view to re-use on another level which would put the user in the same spot.
Re: programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I simply want to Zoom Fit in the current active view. Seems simple but again I can't find the answer. Any takers? Thanks Dale
Re: programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You could try this worked for what I needed a while ago now... http://forums.augi.com/showthread.php?106364-lower
Imports AC_App = Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Interop
Public Class FloorSurferView
Private pMax As Point3d
Private pMin As Point3d
Public Sub New()
SaveView()
End Sub
Private Sub SaveView()
Dim ed As Editor = AC_App.DocumentManager.MdiActiveDocument.Editor
Using acView As ViewTableRecord = ed.GetCurrentView()
Dim pCenter As Point3d = New Point3d(acView.CenterPoint.X, acView.CenterPoint.Y, 0)
pMin = New Point3d(pCenter.X - (acView.Width / 2), pCenter.Y - (acView.Height / 2), 0)
pMax = New Point3d(pCenter.X + (acView.Width / 2), pCenter.Y + (acView.Height / 2), 0)
End Using
End Sub
Public Sub Zoom()
Dim app As AcadApplication = CType(Application.AcadApplication, AcadApplication)
Dim lower() As Double = New Double() {pMin.X, pMin.Y, pMin.Z}
Dim upper() As Double = New Double() {pMax.X, pMax.Y, pMax.Z}
app.ZoomWindow(lower, upper)
End Sub
End Class
Re: programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks for the reply, but I need this for Revit (2013). Regards, Dale
Re: programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hey guys,
you seem to have missed my last post:
http://thebuildingcoder.typepad.com/blog/2012/06/u
The UIView class provides full support for pan and zoom. That is what it is there for, as far as I can tell.
Best regards,
Jeremy
--
Jeremy Tammik
Autodesk Developer Network -- http://www.autodesk.com/joinadn
The Building Coder -- http://thebuildingcoder.typepad.com
Re: programmat ically zoom/pan?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks, Jeremy!

