# Robot load case labels(dynamo, API, Python)

**URL:** <https://forum.dynamobim.com/t/robot-load-case-labels-dynamo-api-python/42460>\
**Category:** Packages\
**Tags:** python, dynamo, structural\
**Created:** [October 29, 2019, 9:00am UTC](https://forum.dynamobim.com/t/robot-load-case-labels-dynamo-api-python/42460 "2019-10-29T09:00:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![1234eddie](https://avatars.discourse-cdn.com/v4/letter/1/4da419/32.png) [@1234eddie](https://forum.dynamobim.com/u/1234eddie)\
**Post date:** [October 29, 2019, 9:00am UTC](https://forum.dynamobim.com/t/robot-load-case-labels-dynamo-api-python/42460/1 "2019-10-29T09:00:52Z")

</div>

Hi all,

I’m trying to use dynamo to create loadcases and combinations in robot,(normally a time consuming proces). i got this working (see this [link](https://forums.autodesk.com/t5/robot-structural-analysis-forum/python-load-combinations/m-p/9114015#M78635)). but the problem i have now is that the loadcase label is the same as the loadcase name. In this [topic](https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-load-case-labels/m-p/9079126#M78319) it was solved, but i can’t get it working.

Hopefully someone can tell me what i should change??

This is the error i get when running te script. (the loadcase is well created)

 ![Error%20after%20adding%20Irobotsimplecase_label](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/e/3e7e9a270c9d6223b2a87e8ac1bbd514569b748a.jpeg)

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

label = labels.Create(IRobotSimpleCase.Label(1,"EG"))
labels.Store(label)
structure.Cases.SetLabel(1,IRobotSimpleCase.Label,"EG")

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 loadcase label which should be “EG”  
 ![loadcase%20label](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68175e5fff2655821d72edfc5443ebfb1ae3a8b7.jpeg)

corresponding chapters in robot API documentation

 ![API%20DOC%20simple%20case](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/1/81193b67686a303983f57debae1f798b94a88172.jpeg) ![Irobot%20simple%20case%20fields](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/6/d69fcd780ffb5b35e4a56b331ed040ba1118394a.jpeg)

as attachment the dynamo file(you can run it with just an empty robot file)

Thanks in advance,

Gr Edward.  
[python loadcase label simplecase label.dyn](https://forum.dynamobim.com/uploads/short-url/6uAZEbbfsOETFCUPtH3BaDDS8Z8.dyn) (3.9 KB)

---

<div class="post-metadata">

**Author:** ![1234eddie](https://avatars.discourse-cdn.com/v4/letter/1/4da419/32.png) [@1234eddie](https://forum.dynamobim.com/u/1234eddie)\
**Post date:** [October 31, 2019, 11:01am UTC](https://forum.dynamobim.com/t/robot-load-case-labels-dynamo-api-python/42460/2 "2019-10-31T11:01:08Z")

</div>

This problem was solved on the Robot structural Analysis forum.  
See this [link](https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-load-case-labels-dynamo-api-python/td-p/9114081)
