This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

ViewHandlerZoomToBoundingBox Method (AABB)

Zooms the current model view.

Namespace:  Tekla.Structures.Model.UI
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2019.0.0.0 (2019.0.0.0)
public static bool ZoomToBoundingBox(
	AABB box


Type: Tekla.Structures.Geometry3dAABB
The bounding box the current view is zoomed to.

Return Value

Type: Boolean
True on success.
In the following example a part is picked and all the visible views are zoomed using the part's bounding box as a parameter.
using Tekla.Structures.Model;
using Tekla.Structures.Model.UI;
using Tekla.Structures.Geometry3d;

public class Example
       public void Example1()
           Picker MyPicker = new Picker();
           Part PickPart = MyPicker.PickObject(Picker.PickObjectEnum.PICK_ONE_PART) as Part;
           AABB PartBoundingBox = new AABB();

           if (PickPart != null)
               Solid PartSolid = PickPart.GetSolid();
               PartBoundingBox.MaxPoint = PartSolid.MaximumPoint;
               PartBoundingBox.MinPoint = PartSolid.MinimumPoint;

           ModelViewEnumerator ViewEnum = ViewHandler.GetVisibleViews();

           while (ViewEnum.MoveNext())
               View ViewSel = ViewEnum.Current;
               ViewHandler.ZoomToBoundingBox(ViewSel, PartBoundingBox);
See Also