Hi,
I have created a small example model which shows my problem in a larger model. The code makes a copy of two conveyors and creates an A-connection between them. There are 3 possible ways to run the code, of which only one seems to work:
1) Just run the scrip by pressing the green run button. The conveyors are created, but the connection is not. If you press the new top right conveyor you will get all kinds of error messages. It is also not possible to delete the conveyor anymore. So this conveyor seems to be broken pretty bad.
2) Run the code in debug mode, but just press run in the debug window. This results in the same thing as point 1.
3) Run the code in debug mode and step through the code line by line. This results in the correct results. The conveyors are created and the connection as well.
What might cause this difference?
Is there a work around for this? Should I call some other functions on the conveyor? Or what is going wrong here?
For reference the code I use:
Object con1 = Model.find("Conveyor1"); Object con2 = Model.find("Conveyor2"); Object newCon1 = createcopy( con1, model() ); Object newCon2 = createcopy( con2, model() ); newCon1.location.y = 5;newCon2.location.y = 5; contextdragconnection( newCon1, newCon2, "A" );
If something is not clear please let me know.
Thanks for the help,
Patrick