- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I hope someone here can help me a little bit with this.
I'm working with a python script inside dynamo, to create load combination in Robot.
The fact is i got it working for just one combination.(see picture below).
This is the python script:
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])
But now i want to edit the script to do this for multipe cases. This is what i have written now, but it only creates "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.
I have also asked the same question at the Dynamo forum, see link.
https://forum.dynamobim.com/t/dynamo-and-rsa-define-load-combinations/26777/5
Thanks in advance,
Edward
Solved! Go to Solution.