Script variable not properly registered in Lumerical's workspace
I am using a script to create the geometry I want to simulate and another script to save the geometry / simulation parameters in a .txt file. The idea is the following:
Create_Geometry_Script.lsf: parameter1 = 1e-6; addstructuregroup; set("name","MyGroup"); adduserprop("Parameter 1",2,parameter1); set("script", Custom script using parameter 1);
Geometry_info.lsf: write("Info.txt", "Parameter 1 = " + num2str(parameter1));
Then I use script to create and run the job with a workflow like this:
Run_Simulation.lsf: Create_Geometry_Script; Set_Simulation_Script; Geometry_info; run;
The problem is that when the Geometry_info script is called, I get the error that parameter1 is not defined. I have tried saving the file and typing the missing parameter (?parameter1 = 1e-6) to populate the workspace before calling the Geometry_info script but it didn't solve the problem. I searched for a command to update the workspace but I didn't find anything. However, after the Run_Simulation.lsf stops execution (due to the missing variable), I can see and print the variable in the workspace. As a side note, when the variable is printed from within the script I get the following:
Somehow the value is registered but not the name, or this is what I understand. However the values of a different script that contains only values assignments (does not change anything in the model) seem to be properly registered, but I haven't fully checked on that.
Any idea what is going on?