- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I want to understand how the Experimenter (Based Range) works with Global Variables.
Building on the thread in the question below, and to provide context, I’m sharing once again a simplified version of the model with these additional changes, so the unexpected behavior can be reproduced.
The question on which my simplified model is based is this:
Solucionado: Random Ordering of Production Plan as an Experimenter Scenario - Autodesk Community
Despite having read many posts on the forum about the Experimenter and Global Variables, I still do not understand why it doesn’t work in my setup.
In the model, I have added a GUI with a checkbox button, a Global Variable, and a Model Trigger. By activating the checkbox, I’m able to control the output of items from the conveyor system. This behaves as expected during a direct run of the model, even after resetting. I also included a Custom Code and a Decide in the Process Flow so that the GUI interaction is interpreted properly in the logic.
It’s important to note that I’m using the default value of the Global Variable to trigger the output event.
I know that the Experimenter cannot read GUI elements during its execution, which is why lines 10 and 11 of the Custom Code are two different approaches. What I expected was that, although the Experimenter cannot interpret line 11 (which uses a function that directly reads the interface), it would still be able to read a node using the syntax of line 10. Neither approach has worked. Still, I hoped that even if those two lines were not interpreted, the logic could proceed by taking the initial value of the Global Variable as valid. That did not happen, and the Experimenter produces null results.
To make it work, I would need to alter the logic by adding an ELSE clause in the custom code and explicitly assigning a value to the Global Variable, thereby overwriting the initial value—using the syntax from line 10 that reads the checkbox OUT itemcurrent node and checked the checkbox OUT from the GUI. I know how to fix this, but what I want to understand is: why doesn’t the Experimenter work by relying on the default value of the Global Variable, the way it does in a manual run?
I’m attaching both models: one with the ELSE clause and one without.
Why can’t the Experimenter use the initial (default) value of a Global Variable?
Am I missing something?
Solved! Go to Solution.