When loading a model using 'load_system', simulink is opened in the background. When adding a subsystem (using the API) to the loaded model, the simulink remains in the background (so far so good). However if you add, for example, a state to a stateflow block (using the API again), simulink pops up to the foreground. To make things worse, the window is activated every time a new state is added.
How to prevent simulink to go to the foreground when sending these types of commands?