Customization > Automation Interface > Functions > Functions for diagrams > Zoom function (automation interface)
Zoom function (automation interface)
Syntax:
Zoom("<id>", <zoom percentage>)
Where:
<id> is a string that specifies the id of the diagram.
<zoom percentage> is a numeric value that specifies the zoom percentage value. A value of zero or a negative zoom percentage to fits the symbols to view.
The Zoom function allows zooming of the diagram view. Zoom opens the diagram if it is not already open and returns a Boolean value to indicate success or failure.
If any symbols are selected, then Modeler zooms in the diagram with the selected symbols in focus, else Modeler zooms the whole diagram.
Examples
In this example, Modeler sets the zoom level so that the diagram fits within the window:

Set objDiagrams = ActiveProject.Item("Diagrams")
Set objDiagram = objDiagrams.Item("Class Diagram", "My Class Diagram")
Result = Studio.Zoom(objDiagram("Id"), -1)
In this example, Modeler sets the zoom level to 100%:

Set objDiagrams = ActiveProject.Item("Diagrams")
Set objDiagram = objDiagrams.Item("Class Diagram", "My Class Diagram")
Result = Studio.Zoom(objDiagram("Id"), 100)