public void Start() { if (bRunning == false) { // Backup all tokens data that can later be used to restore inital setting SaveTokensData(); this.pnd.StepCounter = 0; if (pnd.pyCode.StartsWith("//C#")) { script = new CSharpScript(pnd); } else { script = new PythonScript(pnd); } script.InitScript(); // Start simulation thread this.tdSimulate = new Thread(new ThreadStart(Simulate)); tdSimulate.Start(); this.bRunning = true; } else { this.tdSimulate.Resume(); } }