Please refer to:
- /Drawing/Examples/OdSvgExportEx — Contains code to export the extents of model space. Search OdSvgExportEx.cpp for "zoomExtents".
- /Kernel/Exports/RasterExport — Contains code that zooms to extents for the active layout.
Search RasterExportCmd.cpp for zoomToExtents().
Note: RasterExport works the same for all formats supported by Teigha (.dwg, .dgn, .rvt, etc.)