
The code isn't as complete as I'd like: I haven't coded for all the view parameters (which are addressed in the DevNote quoted above in item 1, for those of you who are ADN members and can understand ObjectARX), and haven't tested for handling views not-aligned with the current UCS (etc., etc.). Call the command synchronously using COM "_.ZOOM _W " + lower + " " + upper + " "

( AcadApplication) Application.AcadApplication Point2d max2d = new Point2d(max.X, max.Y) Point2d min2d = new Point2d(min.X, min.Y) Helper functions to zoom using different techniques PromptEntityResult per = ed.GetEntity(peo) ĭb.TransactionManager.StartTransaction() [Change this to ZoomWin2 or WoomWin3 to Zoom to a window specified by the userĪ Just change the functions used from ZoomWin() to ZoomWin2() or ZoomWin3(), as needed: I ended up implementing the following C# code to show each of these techniques, which can be applied to commands that zoom either to a window (ZW) or to an entity (ZE). The first two change the view very effectively, but don't show the nice view transitions you get with the ZOOM command (hence the 3rd option). Call the ZOOM command using one of the techniques in this previous post.Use the COM API to perform a ZoomWindow.Create a ViewTableRecord and set it as the current view (the classic ObjectARX technique, as described in this DevNote on the ADN site).NET API in AutoCAD doesn't expose a handy "ZoomWindow" method, but there are a few options open that use officially supported APIs: NET, whether to a window or to an entity. It shows how to perform a programmatic zoom in. This post was inspired by a recent email from Sreekar Devatha, who is just about to leave DevTech India to work in one of our Engineering teams in Singapore (all the best on your new adventure, Sreekar! :-).
