AnsweredAssumed Answered

How to change names in a loop

Question asked by Kyle Thomson on Jul 6, 2020
Latest reply on Jul 8, 2020 by Kyle Thomson

Hi all,


      For the code below, I want the name of the study to change with the I values. So for example start out at thermal study 2 and go up to thermal study 8760. However, since the name is in quotes is it possible to name it through looping?


'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)