Dear all,
Is there a way to access (modify, read) the load case labels via API? (I'm not referring to the case number, name or nature etc. but label)
Thanks in advance for the help!
Best regards,
Marcell
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Hi @Anonymous,
I tend to think that is not possible to change/assign labels for load cases using API.
Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.
Roman Zhelezniak
Robot Evangelist & Passionate Civil Structural Engineer
Hi @Rafal.Gaweda,
Thanks for your answer!
I've actually just found that you can very easily read and modify case and combination labels using RobotSimpleCase.Label or IRobotCaseCombination.Label.
Best regards,
Marcell
Hi @Anonymous @Rafal.Gaweda
you solved this with using API, i'm currently using dynamo with a python script, and try to achieve also to set the labels(because it's annoying that the label is the case name).
this is the API information.
this is my setup which creates the loadcase, only with the case name as label.
This is the python code:
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. LoadCaseName = IN[0] LoadCaseNumber = IN[1] LoadCaseLabel = IN[2] application = RobotApplicationClass() project = application.Project structure = project.Structure labels = structure.Labels loads = structure.Cases #output Caseeigengewicht = structure.Cases.CreateSimple(LoadCaseNumber,LoadCaseName,IRobotCaseNature.I_CN_PERMANENT,IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR) Caseeigengewicht.Records.New(IRobotLoadRecordType.I_LRT_DEAD) LoadRecord = Caseeigengewicht.Records.Get(1) LoadRecord.SetValue(IRobotDeadRecordValues.I_DRV_Z,-1) LoadRecord.SetValue(IRobotDeadRecordValues.I_DRV_ENTIRE_STRUCTURE,True) OUT = LoadCaseNumber
This is the error i get when i add "IRobotSimpleCase.label"
This is what i have added in the code.
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. LoadCaseName = IN[0] LoadCaseNumber = IN[1] LoadCaseLabel = IN[2] application = RobotApplicationClass() project = application.Project structure = project.Structure labels = structure.Labels loads = structure.Cases #output Caseeigengewicht = structure.Cases.CreateSimple(LoadCaseNumber,LoadCaseName,IRobotCaseNature.I_CN_PERMANENT,IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR,IRobotSimpleCase.label(LoadCaseLabel)) Caseeigengewicht.Records.New(IRobotLoadRecordType.I_LRT_DEAD) LoadRecord = Caseeigengewicht.Records.Get(1) LoadRecord.SetValue(IRobotDeadRecordValues.I_DRV_Z,-1) LoadRecord.SetValue(IRobotDeadRecordValues.I_DRV_ENTIRE_STRUCTURE,True) OUT = LoadCaseNumber
Can some one tell me what i should change to set the label for the loadcase.
I have added both dynamo files.
Thanks in advance,
Gr Edward.