I have the need to load a ZenExperiment from a class described in a module imported from the macro editor.
The ZenExperiment type is not available, of course, but I can pass it directly to the class.
Just to be clear, in the main macro code, I have
Code: Select all
from module.test import test_function
exp = test_function(ZenExperiment)
print dir(exp)
Code: Select all
def test_function(ZenExperiment):
new_exp = ZenExperiment()
new_exp.Load('zen_exp_name')
print dir(new_exp)
return new_exp
Indeed by comparing the output of the two dir() calls, all methods concerning with getting/adding areas and positions are missing, raising a missing attribute error when called.
On the other hand, I can save the experiment file and manually check the xml, confirming that the right experiment was 'loaded'.
I tried to load the experiment also via
Code: Select all
new_exp = Zen.ObjectFactory.Create("Zeiss.Micro.Scripting.ZenExperiment")
new_exp.Load('zen_exp_name')
Code: Select all
Zen.Acquisition.Experiments.GetByName("zen_exp_name")
Would there be a way to allow the addition/modification of positions in an experiment created/loaded in a module?
Thank you very much for helping!