'Agent and overhead crane have different spaces in AnyLogic

I have an overhead Crane placed in Main, and i want to use this crane to move agent which is placed in an another agent called as MyAgent. When i tried to do that it is giving me an error of different spaces. Can anyone help me to remove this error. main window Myagent logic

error discription



Solution 1:[1]

Easiest way is to push your embedded agent into a flowchart on Main using an "Enter" block. This will force it to live on the space of Main. Once done, use the same trick to push it back into the space of the normal parent agent of it.

Else, you can play with setEnvironment() but this does not always work

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 Benjamin