Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(API) Define column reinforcements in RSA using vb.net/vba

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
berncabebe
1566 Views, 5 Replies

(API) Define column reinforcements in RSA using vb.net/vba

I have a very large structure being analyzed using RSA.  Defining provided reinforcement for columns consumes a lot of time to do it. It may be better to define the provided reinforcement in Excel sheet and create it in RSA using vb.net/vba.

 

Any body who can provide a vb.net/vba code of doing this. Thanks.

Tags (4)
5 REPLIES 5
Message 2 of 6

You may consider use of the typical reinforcement dialog and saving several patterns of reinforcements which you can them use for selected columns from the model.

 

If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.



Artur Kosakowski
Message 3 of 6
buchack
in reply to: berncabebe

Here is an example in VBA that creates column with reinforcement. After some modifications it may be used to generate reinforcing bars in existing columns.

To run example Robot regional settings must be set to US (bar shapes "1" and "T1" are hardcoded).

This macro uses two references: 'Robot Object Model v. 15.0' and 'ROBarShapeDb 2015.0 Type Library'.

 

Sub CreateColumntWithReinforcement()
Dim app As New RobotOM.RobotApplication
app.Visible = 1
app.Window.Activate
app.Project.New (IRobotProjectType.I_PT_CONCRETE_COLUMN)
Dim column As RobotOM.IRConcrColumn
Set column = app.Project.ComponentMngr.Create(IRobotProjectComponentType.I_PCT_COLUMN, "Column.1", "Level1").Data
Dim reinf As IRConcrReinforcement
Set reinf = column.Reinforcement
Dim bars As IRConcrReinforcingBars
Set bars = reinf.bars
Dim geom As IRConcrColumnGeometry
Set geom = column.Geometry

Dim cover As Double
cover = 0.05
Dim diameterLong As Double
diameterLong = 0.012
Dim diameterTran As Double
diameterTran = 0.006
Dim bendDiamLong As Double
bendDiamLong = 0.1
           
Dim h As Double
h = geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_HSD) + geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_EPD)

' lock refresh during generation for better performance
Dim wasLocked As Boolean
wasLocked = reinf.LockRefresh(True)
reinf.RemoveAll

Dim pi As Double
pi = 3.1415926

' create longituginal bars
Dim y(4) As Double
Dim z(4) As Double
y(0) = cover
y(1) = geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_A) - cover
y(2) = geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_A) - cover
y(3) = cover
z(0) = cover
z(1) = cover
z(2) = geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_B) - cover
z(3) = geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_B) - cover
Dim bar As IRConcrReinforcingBar
Dim attr As IRbctAttribute
Dim p As IRbctData
Dim barEditor As IROBarEditor
For j = 1 To 4
    Set bar = bars.Add("1", IRConcrBarType.I_CBT_BAR_TYPE_LON_MAIN, IRConcrBarSubtype.I_CBS_BAR_SUBTYPE_DOWN, diameterLong, bendDiam)
    Set barEditor = bar.GetROBarEditor(False)
    Set p = barEditor.GetData()
    Set attr = p.GetAttribute("RBCR_ATT_BAR_TEMPLATE_PARAM", 0)
    attr.SetDoubleValue "RBCR_PAR_SHAPEPARAM", (h - 2 * cover) * 1000#, -1 ' bar length
    Set attr = p.GetAttribute("RBCR_ATT_BAR_DEFPARAM", -1)
    attr.SetDoubleValue "RBCR_PAR_BAR_HOOKA1", pi * 3 / 4#, -1 ' hook angle
    attr.SetDoubleValue "RBCR_PAR_BAR_HOOKL1", 100, -1 ' hook len
    attr.SetDoubleValue "RBCR_PAR_BAR_HOOKA2", pi * 3 / 4#, -1
    attr.SetDoubleValue "RBCR_PAR_BAR_HOOKL2", 100, -1
    bar.SetROBarEditor barEditor
    bar.SetDirections 0, y(j Mod 4) - y((j + 2) Mod 4), z(j Mod 4) - z((j + 2) Mod 4), -1, 0, 0
    bar.Position.X = cover
    bar.Position.y = y(j - 1)
    bar.Position.z = z(j - 1)
    bar.SteelType = I_CST_STEEL_TYPE_LONG
Next j

' create transversal bars
For K = 1 To 10
    Set bar = bars.Add("T1", IRConcrBarType.I_CBT_BAR_TYPE_TRA_MAIN, IRConcrBarSubtype.I_CBS_BAR_SUBTYPE_ANY, diameterTran, 0#)
    Set barEditor = bar.GetROBarEditor(False)
    Set p = barEditor.GetData()
    Set attr = p.GetAttribute("RBCR_ATT_BAR_TEMPLATE_PARAM", 0)
    attr.SetDoubleValue "RBCR_PAR_SHAPEPARAM", (geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_A) - 2 * cover) * 1000#, -1
    Set attr = p.GetAttribute("RBCR_ATT_BAR_TEMPLATE_PARAM", 1)
    attr.SetDoubleValue "RBCR_PAR_SHAPEPARAM", (geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_B) - 2 * cover) * 1000#, -1
    Set attr = p.GetAttribute("RBCR_ATT_BAR_TEMPLATE_PARAM", 2)
    attr.SetDoubleValue "RBCR_PAR_SHAPEPARAM", (geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_A) - 2 * cover) * 1000#, -1
    Set attr = p.GetAttribute("RBCR_ATT_BAR_TEMPLATE_PARAM", 3)
    attr.SetDoubleValue "RBCR_PAR_SHAPEPARAM", (geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_B) - 2 * cover) * 1000#, -1
    Set attr = p.GetAttribute("RBCR_ATT_BAR_DEFPARAM", -1)
    attr.SetDoubleValue "RBCR_PAR_BAR_HOOKA1", pi * 3 / 4#, -1
    bar.SetROBarEditor barEditor
    bar.DirectionZ.z = -bar.DirectionZ.z
    bar.Position.X = K * h / 10#
    bar.Position.y = geom.Dim(IRConcrColumnDimensionType.I_CCD_COLUMN_DIM_B) - cover
    bar.Position.z = cover
    bar.SteelType = I_CST_STEEL_TYPE_TRAN
Next K

reinf.LockRefresh (wasLocked)
reinf.Comment = "Generated by VBA"
reinf.Freeze True
app.UserControl = True

End Sub

 column.png

 

Krzysztof Buchacz
Software Engineer, Autodesk
Message 4 of 6
1090174
in reply to: buchack

Hi,

 

I have Robot 2014 student version and i just have 'Robot Object Model v.14.0', the other reference ('ROBarShape Db 2015.0 Type Library) i don't.

What can i do for have this references? Install Robot 2015?

 

Regards

Message 5 of 6
berncabebe
in reply to: buchack

Good day Krzysztof,

 

How can I assign the created column reinforcements to existing bar using vb.net/vba?

 

Thank you.

Message 6 of 6
producao1QFW5H
in reply to: berncabebe

Hello all.

This was very interesting but i need the code not to create but to get the reinforcement already defined on the "provided reinforcement tab" from RSA.

 

Is it possible? With C# how can I get the defined reinforcement from RSA?

Thank you

Regards

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report