Dynamo and RSA define load combinations

Hi All,

@Jonathan.Olesen @pechu9 @erfajo @jacob.small @acam694 @Arthur1

I got this working with python just for one combination.(see the picture below).

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object

#The inputs to this node will be stored as a list in the IN variables.

CombCaseName = IN[0]
CaseNumber = IN[1]
CFactors = IN[2]
CombNumber = IN[3]
application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
loads = structure.Cases

CaseComb = structure.Cases.CreateCombination(CombNumber,CombCaseName,IRobotCombinationType.I_CBT_ULS,IRobotCaseNature.I_CN_WIND,IRobotCaseAnalizeType.I_CAT_COMB)
IRobotCaseFactorMngr
caseManage1 = CaseComb.CaseFactors
caseManage1.New(CaseNumber[0],CFactors[0])
caseManage1.New(CaseNumber[1],CFactors[1])
caseManage1.New(CaseNumber[2],CFactors[2])
caseManage1.New(CaseNumber[3],CFactors[3])

Now i want to do this for multiple cases at once. this is what i came up with(but it does only create ‘Comb1’)

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object

#The inputs to this node will be stored as a list in the IN variables.

CombCaseName = IN[0]
CaseNumber = IN[1]
CFactors = IN[2]
CombNumber = IN[3]
application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
loads = structure.Cases

CaseComb = structure.Cases.CreateCombination(CombNumber[0],CombCaseName[0],IRobotCombinationType.I_CBT_ULS,IRobotCaseNature.I_CN_WIND,IRobotCaseAnalizeType.I_CAT_COMB)
IRobotCaseFactorMngr
caseManage1 = CaseComb.CaseFactors
caseManage1.New(CaseNumber[0],CFactors[0])
caseManage1.New(CaseNumber[1],CFactors[1])
caseManage1.New(CaseNumber[2],CFactors[2])
caseManage1.New(CaseNumber[3],CFactors[3])

Can someone tell me what i should change
1: in the python script to do this for multiple combinations?
2: With “IRobotCaseFactorMngr” I’m now limited it to four cases and factors, how can i change it so it’s dynamic.

The sources of the code came from:

Thanks in advance,

PS: I’m the same one who created this topic, i only lost my username etc.