'Visibility of multiple levels

In my model in Anylogic I tried to create a navigation tool to switch in visibility between floors and navigate through the 2D and 3D visualization.

I did this by creating buttons which are coded like:

navigate( viewLogic );
Ground0.setVisible( true );
Ground1.setVisible( true);
Ground2.setVisible( true);
Ground3.setVisible(true);

Where the viewlogic is the 2D view area and all grounds in this specific example are put on visible.

Only it seems only to work for my 2D model and not my 3D visualization.

When I for example do this:

navigate( view3D );
Ground1.setVisible(true);
Ground0.setVisible(true);
Ground2.setVisible(false);

Still all the floors are visible in the 3D view of the model during simulation.

What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source