(API) Changing the bar type

(API) Changing the bar type

dagmaraxf
Participant Participant
2,206 Views
10 Replies
Message 1 of 11

(API) Changing the bar type

dagmaraxf
Participant
Participant

Hi, 

 

How can I change the bar type using the API (please see the screenshot below)? I have already created bars in the project whose type is "N/A" and I would like to have a RC beam. Do I have to create a beam instead of a bar at the beginning?

I would appreciate your help.

 

Screen.jpg

0 Likes
Accepted solutions (1)
2,207 Views
10 Replies
Replies (10)
Message 2 of 11

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @dagmaraxf 

 

type (Steel beam EC3) is used for design.

' with Bar as RobotBar and Existing Label "Steel beam EC3" (to be created in other case) 
Bar.SetLabel IRobotLabelType.I_LT_MEMBER_TYPE, "Steel beam EC3"

Best regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 3 of 11

Stephane.kapetanovic
Mentor
Mentor

Note that this also works for R / C types

Bar.SetLabel IRobotLabelType.I_LT_MEMBER_TYPE, "RC Beam"

 image.pngimage.png

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 4 of 11

dagmaraxf
Participant
Participant

@Stephane.kapetanovic

Yes, you are absolutely right, thank you. I was confused by the mention in the API: Member type for steel/aluminum and timber design.

0 Likes
Message 5 of 11

dagmaraxf
Participant
Participant

Hi @Stephane.kapetanovic maybe you know the solution to my next problem. I would like to change the settings of Calculation Parameter Definition.

I try :

structure.Labels.GetLabel(IRobotLabelType.I_LT_MEMBER_REINFORCEMENT_PARAMS, "standard").Data but gets an error. However, with the same syntax only with "I_LT_MEMBER_TYPE" the code works. Is there any other way to access these settings?

 

screen2.png

 

0 Likes
Message 6 of 11

Stephane.kapetanovic
Mentor
Mentor

hi @dagmaraxf 

 

try these links

https://forums.autodesk.com/t5/robot-structural-analysis-forum/provided-reinforcement-api-robot/td-p...

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-how-to-get-bar-reinforcement-resu...

 

Best regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 7 of 11

dagmaraxf
Participant
Participant

Thank you for your help, I have already studied the links and my calculation of the required reinforcement works. However, while "bars.Get(1).SetLabel(IRobotLabelType.I_LT_MEMBER_REINFORCEMENT_PARAMS, "standard")" works fine, I don't know how to modify the "standard" parameter set (or create a new one, "Create" does not work). I think I should refer to "IRBestCalcParamsDataDoubleValue" but I don't know how.

 

0 Likes
Message 8 of 11

Stephane.kapetanovic
Mentor
Mentor

See messages 10 to 13/29 on second of previous links.

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 9 of 11

stefanyC6JZ7
Enthusiast
Enthusiast

Hi @dagmaraxf 

Could you upload the code of the creation of bars, including how you assigned section, material, and releases?. Currently I am trying to create bars with version CPython3, I just managed to create bars but tey are missing the properties. Thank you in advance.

 

Best regards, 

Stefany 

0 Likes
Message 10 of 11

dagmaraxf
Participant
Participant
from RobotOM import *
from System import Object
import math
from time import gmtime,strftime
from math import sqrt




ConcreteClass = IN[0]   
B = IN[2]  
H = IN[1]  


NameS = str(H*100)+"x"+str(B*100)   #Section Name
B = B*1
H = H*1

application = RobotApplicationClass()
project = application.Project
structure = project.Structure
results = structure.Results
bars = structure.Bars
rbars = results.Bars
labels = structure.Labels
nodes = structure.Nodes
loads = structure.Cases


app = RobotApplicationClass()
app.Project.New(IRobotProjectType.I_PT_FRAME_2D)

#Geometry
structure.Nodes.Create(1,0,0,0)
structure.Nodes.Create(2,8,0,0)
structure.Nodes.Create(3,16,0,0)

bars.Create(1,1,2)
bars.Create(2,2,3)

#Supports
Support = labels.Create(IRobotLabelType.I_LT_NODE_SUPPORT, 
"Przegub przesuwny")
Support.Data.UX = 0
Support.Data.UY = 1
Support.Data.RY = 0
labels.Store(Support)

nodes.Get(1).SetLabel(IRobotLabelType.I_LT_NODE_SUPPORT, "Przegub")
nodes.Get(2).SetLabel(IRobotLabelType.I_LT_NODE_SUPPORT, "Przegub")
nodes.Get(3).SetLabel(IRobotLabelType.I_LT_NODE_SUPPORT, 
"Przegub przesuwny")

#Section


lab_serv = labels
sec = lab_serv.Create(IRobotLabelType.I_LT_BAR_SECTION, NameS)
data = sec.data

data.ShapeType = IRobotBarSectionShapeType.I_BSST_CONCR_BEAM_RECT
nonst_data = data.concrete
nonst_data.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_BEAM_B,
B)
nonst_data.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_BEAM_H,
H)
data.MaterialName = ConcreteClass[0]
data.CalcNonstdGeometry()
lab_serv.Store(sec)

bars.Get(1).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, NameS)
bars.Get(2).SetLabel(IRobotLabelType.I_LT_BAR_SECTION, NameS)

Hi,
Sorry it took me so long to write back. I am inserting the code.

Message 11 of 11

stefanyC6JZ7
Enthusiast
Enthusiast

Hi @dagmaraxf

Thank you very much for your response. 

 

Best regards, 

Stefany 

0 Likes