hexagon logo

Loop in .cmd file to find row at a specific time.

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])
end
 
var del var=IP
 
Thoughts? Is there a better way?
Parents
  • Start with a performance specification and ask yourself:
    • Do I need a very fast execution ?
    • Do I need to read/write a lot of stuff from/to textfiles ?
    • Do I concatenate a lot of sub-strings to longer strings and do something with it ?
    • Do I have to loop often / over a huge number of elements ?
     
    If one or more is answered with yes, you may have an advantage with Python.
    Other than that, macros may be the easier-to-create/maintain way.
Reply
  • Start with a performance specification and ask yourself:
    • Do I need a very fast execution ?
    • Do I need to read/write a lot of stuff from/to textfiles ?
    • Do I concatenate a lot of sub-strings to longer strings and do something with it ?
    • Do I have to loop often / over a huge number of elements ?
     
    If one or more is answered with yes, you may have an advantage with Python.
    Other than that, macros may be the easier-to-create/maintain way.
Children
No Data