Is there any way to zoom in programmatically during the model running in AnyLogic? In fact I need to capture the zoom event and do some modifications on some elements of my model. If there is no direct method to capture the zoom event, Is there any available variable or parameter representing the zoom ratio of the active view area in 2D mode?
Thanks in advance.
I don't know how efficient is this answer, but it works and solves my problem.
You can reach some sort of zoom manipulators through getExperimentHost()
method every where in your model.
Description copied from class:
Presentable
Returns the experiment host object of the model, or some dummy object with no functionality if there is none.
Via this method you can zoom in and out your model while running using zoomIn and zoomOut methods.
zoomIn
void zoomIn(double coefficient)
Zooms in the animation view by the given amount
zoomOut
void zoomOut(double coefficient)
Zooms out the animation view by the given amount
Using these methods and some customized variables and methods, and also limiting the user to be able zoom in and zoom out through specific controls, it would be a little bit of coding issues.