AnsweredAssumed Answered

Loops and names

Question asked by Kyle Thomson on Jun 29, 2020
Latest reply on Jul 7, 2020 by Kyle Thomson

Hi all,


       I am trying to loop a program to run several thermal analysis runs. However, I need them to be names study1, study2, study3......etc. I have the loop set up and the code to name the first run. the issue I am running into is that since the name is in parenthesis I cannot get it to iterate. Please see the code below. Thanks for any help that can be provided. PS yes there will be more added in the loop later on but for now trying to take baby steps.


For I = 2 To 8760

'***Sets up the themal study for an Assembly
Set ActiveDocObj = COSMOSWORKSObj.ActiveDoc()
Set StudyManagerObj = ActiveDocObj.StudyManager()
StudyManagerObj.ActiveStudy = 0
Set motionStudyMgr = Part.Extension.GetMotionStudyManager()
StudyManagerObj.ActiveStudy = 0
'How to loop the name change?????????????????
NewStudyName = "Thermal assembly"
Set CWNewStudy = StudyManagerObj.CreateNewStudy3(NewStudyName, 3, 0, ErrorCodeObj)