AnsweredAssumed Answered

How to set total time for transient

Question asked by Kyle Thomson on Jun 26, 2020

Trying to add in the values of time total and time step for my transient study. I keep getting error code 424. Any help wold be appreciated. Thanks!



'Should change the thermal study to transient
'will read the end conditions of the previously run study and use those as initial
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
Set ActiveDocObj = COSMOSWORKSObj.ActiveDoc()
Set StudyManagerObj = ActiveDocObj.StudyManager()
StudyManagerObj.ActiveStudy = 1
Total_Time = 3600
Time_Step = 600
Step_Count = Total_Time / Time_Step
Set ThermalOptionsObj = StudyObj.ThermalStudyOptions()
ThermalOptionsObj.SolverType = 3
ThermalOptions.TotalTime = Total_Time
ThermalOptions.TimeIncrement = Time_Step
'Says that the previous study was called thermal 1 for initializing initial conditions
ThermalOptionsObj.ThermalStudyNameUsedForInitialTemperature = "Thermal 1"
'This is the line that causes the Error to appear for switching from steady to transient
'ThermalOptionsObj.ThermalSolution = 0
ThermalOptionsObj.SolutionType = swsThermalSolutionType_e.swsThermalSolutionTypeTransient
' Redraw