I run a .cmd file after my sims to pull certain data and write it to a text file. I would like to get some numbers at a specific time in the sim. I'm trying to use a WHILE/END loop to do this per another example I found, but it isn't working. Code below...
var set var=CurrentAnalysis object=(eval(db_default(.system_defaults,"analysis")))
var set var=IP integer_value=1
While condition=((eval(CurrentAnalysis.object_value//".MyResult.time").values[IP])<2.5)
var set var=OneGTimeValue real_value=(eval(CurrentAnalysis.object_value//".MyResult.time").values[IP])
var set var=$_self.OneGTimeValue real_value=(VALI($analysis.MyResult.TIME.values,2.5))
then you created a variable OneGTimeValue that is dependent on the analysis.
If you re-run the analysis, the variable will automatically change. If try to delete the variable, A/View will complain about dependent objects as the expression makes the variable being dependent on the analysis.
If you eval the whole expression you kind of "snapshot" the value and save it to the variable. It just holds the number and not an expression.
Consequences: There's no dependency. The variable will not change when the analysis is updated and nor will A/view complain about deleting the variable.
var set var=$_self.OneGTimeValue real_value=(VALI($analysis.MyResult.TIME.values,2.5))
then you created a variable OneGTimeValue that is dependent on the analysis.
If you re-run the analysis, the variable will automatically change. If try to delete the variable, A/View will complain about dependent objects as the expression makes the variable being dependent on the analysis.
If you eval the whole expression you kind of "snapshot" the value and save it to the variable. It just holds the number and not an expression.
Consequences: There's no dependency. The variable will not change when the analysis is updated and nor will A/view complain about deleting the variable.