Display Drawing Limits and Extents

AutoCAD ActiveX

 
Display Drawing Limits and Extents
 
 
 

To display a view based on the drawing boundaries or the extents of the objects in the drawing, use the ZoomAll , ZoomExtents, or ZoomPrevious method.

ZoomAll displays the entire drawing. If the objects extend beyond the limits, ZoomAll displays the extents of the objects. If the objects are drawn within the limits, ZoomAll displays the limits.

ZoomExtents calculates zooms based on the extents of the active viewport, not the current view. Usually the active viewport is entirely visible, so the results are obvious and intuitive. However, when using the Zoom methods in model space while working in a paper space viewport, if you are zoomed in beyond the paper space viewport's borders, some of the area zoomed may not be visible.

ZoomExtents changes the view to encompass the entity extents for the current drawing. In some cases (for both ZoomAll and ZoomExtents), this may cause a regeneration. Regeneration will not occur on layers that are frozen or turned off. If your drawing has no objects, ZoomExtents displays the drawing limits.

For 3D views, ZoomAll and ZoomExtents have the same effect. Infinite construction lines (xlines) and rays do not affect either option.

ZoomPrevious zooms the current viewport to its previous extents.

See “Magnify a View (Zoom)” in the User's Guide for illustrations of how zooming works.

Zoom in on the active drawing to all contents and to the drawing extents

Sub Ch3_ZoomAll()
' ZoomAll
 MsgBox "Perform a ZoomAll", , "ZoomAll"
 ThisDrawing.Application.ZoomAll
      
' ZoomExtents
 MsgBox "Perform a ZoomExtents", , "ZoomExtents"
 ThisDrawing.Application.ZoomExtents
End Sub