Robot load case labels(dynamo, API, Python)

Robot load case labels(dynamo, API, Python)

1234eddie
Advocate Advocate
2,161 Views
5 Replies
Message 1 of 6

Robot load case labels(dynamo, API, Python)

1234eddie
Advocate
Advocate

Hi @tuska.marci @Rafal.Gaweda and others.

 

Im trying to use dynamo to create loadcases and combinations in robot,(normally a time consuming proces). i got this working (see this link ). but the problem i have now is that the loadcase label is the same as the loadcase name. In this topic 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 after adding Irobotsimplecase_label.jpg

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 label.JPG

 

corresponding chapters in robot API documentation

API DOC simple case.JPGIrobot simple case fields.JPG

 

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

 

Thanks in advance,

 

Gr Edward.

0 Likes
Accepted solutions (1)
2,162 Views
5 Replies
Replies (5)
Message 2 of 6

1234eddie
Advocate
Advocate

Hi 

 

@Artur.Kosakowski @Rafacascudo @Romanich 

Can someone of you help me with this guys? 

I would really love to solve this problem. (i want to solve because i can't sent it to a client, with te wrong labels.)

 

Thanks in advance.

 

Gr Edward

0 Likes
Message 3 of 6

Rafacascudo
Mentor
Mentor

can´t help you with that . probably @Rafal.Gaweda is the one to do it

Rafael Medeiros
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 6

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @1234eddie 

 

I hope You meant this (label is not the case name).

(VBA example but it should be clear enough to understand) 

 

swlabel.jpg



Rafal Gaweda
0 Likes
Message 5 of 6

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @1234eddie 

 

Short explanation: Labels created \ got by Labels server or by HasLabel \ SetLabel are objects like bar Section, Support, Releases, Materials and so on. 

This label (misleading name in this case) is just a string = text.

 



Rafal Gaweda
0 Likes
Message 6 of 6

1234eddie
Advocate
Advocate

Many thanks @Rafal.Gaweda 

 

Your photo and explanation made it clear for me.

 

I have attached the corrected dynamo file.

 

Gr Edward

0 Likes