I have write a self define ACT plug and need to get the step time when write to solver file. I found a way, but it, but I am not sure is there any native API to get the step time ?
Here is the code:
class InvokeUIThread():
def __init__(self, ExtAPI, analysis):
args = [None] * 7
args[0] = analysis
ExtAPI.Application.InvokeUIThread(self.internalGetAnalysisData, args)
self.args = args[1:]
def internalGetAnalysisData(self,args):
args[1] = args[0].Name
args[2] = args[0].WorkingDir
args[3] = args[0].GetResultsData()
args[4] = args[0].GeoData
args[5] = args[0].MeshData
args[6] = args[0].StepsEndTime
@property
def AnalysisName(self):
return self.args[0]
@property
def WorkingDir(self):
return self.args[1]
@property
def GetResultsData(self):
return self.args[2]
@property
def GeoData(self):
return self.args[3]
@property
def MeshData(self):
return self.args[4]
@property
def StepsEndTime(self):
return self.args[5]
def SolveCallBack(load, solverData, stream):
CurrentStepNum = solverData.CurrentStep
analysis = load.Analysis
# times = analysis.StepsEndTime
InvokeUIThread = InvokeUIThread(ExtAPI, analysis)
times = InvokeUIThread.StepsEndTime
CurrentStepTime = times[CurrentStepNum - 1]
