Book a Demo

Author Topic: Addin interface to simulation with: Repository.Simulation.BroadcastSignal  (Read 3848 times)

AltSteven

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hi All,

My goal is to interface from an external application to a running simulation in Enterprise Architect.

Right now I am calling bool Result = Repository.Simulation.BroadcastSignal("ddd", ""); from a self-made Add-in, hoping that it triggers a transition signal in the simulation. The code in C# returns true, but the simulation is not affected. What might be the problem?

See below for my code and a screenshot of my test-model.

Code: [Select]
private void Function2(EA.Repository Repository)
{
    if (Repository.Simulation.IsSimulatorRunning())
    {
        bool Result = Repository.Simulation.BroadcastSignal("ddd", "");
        MessageBox.Show("Function2: Repository.Simulation.BroadcastSignal=" + Result);
    }
    else
    {
        MessageBox.Show("Function2: Simulation=" + Repository);
    }
}



This should be possible according to: https://www.sparxsystems.com.au/resources/user-guides/14.0/automation/automation.pdf
page 4 says:
"A function to send a broadcast signal to the simulation that is currently running"

PS: My first attempt was using ComObjects in the JavaScript simulator, but ComObjects don't seem to work in the simulator.
« Last Edit: July 25, 2019, 11:16:34 pm by AltSteven »