I need help writing a code that automatically generates a model from a script. So far, I’ve managed to create and position the elements, but now I need to configure a process where, through the code, the worker takes the pieces and transfers them to the buffer.
What can I do to achieve this through the code?
Object F1= createinstance(library().find("?Source"), model());
F1.setLocation(0,0,0);
F1.name="F1";
Object M1 = createinstance(library().find("?Processor"), model());
M1.setLocation(0,10,0);
M1.name="Daria";
Object M2 = createinstance(library().find("?Queue"), model());
M2.setLocation(0,20,0);
M2.name="Buffer";
Object S1 = Object.create("Sink");
S1.setLocation(0,30,0);
S1.name="Salida";
objectconnect(Model.find("F1"),Model.find("Daria"));
objectconnect(Model.find("Daria"),Model.find("Buffer"));
objectconnect(Model.find("Buffer"),Model.find("Salida"));
Object T1= createinstance(library().find("?Operator"), model());
T1.setLocation(5,15,0);
T1.name="Trabajador";