Discussion Groups

Robot Structural Analysis

Reply
Active Member
Adamchuk_Nicolay
Posts: 7
Registered: ‎02-15-2013

(API) VBA ROS - running steel code calculation

367 Views, 20 Replies
02-15-2013 02:10 AM

Hi,

please help me with next problem:

how running calculation for steel members using VBA (Robot Open Standart).

 

Unfortunatly not any example for this case.

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,604
Registered: ‎04-26-2010

Re: VBA ROS - running steel code calculation

02-15-2013 02:22 AM in reply to: Adamchuk_Nicolay

Nicolay,

 

Check pdf in message 2 here: http://forums.autodesk.com/t5/Autodesk-Robot-Structural/Manual-Calculations-for-Steel-Design-using-A...

 

Example from page 95

 

Two small examples of creating steel design groups and geting steel design ratio attached



Rafal Gaweda
Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,604
Registered: ‎04-26-2010

Re: VBA ROS - running steel code calculation

02-15-2013 02:24 AM in reply to: Rafal.Gaweda

example of creating steel design label for bars



Rafal Gaweda
Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,604
Registered: ‎04-26-2010

Re: VBA ROS - running steel code calculation

02-15-2013 03:18 AM in reply to: Rafal.Gaweda
Please use plain text.
Contributor
rdrmolina
Posts: 16
Registered: ‎02-03-2014

Re: VBA ROS - running steel code calculation

04-07-2014 06:32 AM in reply to: Rafal.Gaweda
Hi,
How can I create a Code group, and specify the sections list and code parameters to use by each group using Robot API.

thanks
Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,604
Registered: ‎04-26-2010

Re: VBA ROS - running steel code calculation

04-07-2014 06:36 AM in reply to: rdrmolina
Example in message 2 of this thread.
Code parameters are assigned to bars , not design group


Rafal Gaweda
Please use plain text.
Contributor
rdrmolina
Posts: 16
Registered: ‎02-03-2014

Re: (API) VBA ROS - running steel code calculation

04-07-2014 07:52 AM in reply to: Adamchuk_Nicolay

Hi,
I'm so sorry, but I didn't understand how to specify Section database and section families in your code. I saw how to include or exclude a member in Code Grup if you define all the parameters before. In my case I want to create a Code group at the first time without any definition before. Cold you help me?
thanks.

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,604
Registered: ‎04-26-2010

Re: (API) VBA ROS - running steel code calculation

04-08-2014 04:08 AM in reply to: rdrmolina

Code update for previous example

 

Dim RDMServer As RDimServer
    Dim RDMStream As RDimStream
    Dim RDMGrps As RDimGroups
    Dim RDMGrp1 As RDimGroup
    Dim RDmGrpProfs As RDimGrpProfs
    
    Set RDMServer = RobApp.Kernel.GetExtension("RDimServer")
    RDMServer.Mode = I_DSM_STEEL
    
    Set RDMGrps = RDMServer.GroupsService
    idx = 0
    While Cells(2 + idx, 1) <> Empty
    
        usrgr = Int(Cells(2 + idx, 1))
    
        Set RDMGrp1 = RDMGrps.Get(usrgr)
        RDMGrp1.Name = Cells(2 + idx, 2)
        Set RDMStream = RDMServer.Connection.GetStream
        RDMGrp1.GetMembList RDMStream
        RDMStream.Clear
        RSelection.FromText Cells(2 + idx, 3)
        Cells(2 + idx, 3) = RSelection.ToText
        RDMStream.WriteText RSelection.ToText
        RDMGrp1.SetMembList RDMStream
        
        Set RDmGrpProfs = RDMServer.Connection.GetGrpProfs
        RDmGrpProfs.Clear
        RDMStream.Clear
        RDMStream.WriteText ("IPE")           ' family of profiles
        RDMStream.WriteText ("HEA")           ' family of profiles
        RDmGrpProfs.SetFamilies "SIMPL", RDMStream ' section database
        RDMGrp1.SetProfs RDmGrpProfs

        RDMGrps.Save RDMGrp1
        idx = idx + 1
    Wend

 



Rafal Gaweda
Please use plain text.
Contributor
rdrmolina
Posts: 16
Registered: ‎02-03-2014

Re: (API) VBA ROS - running steel code calculation

04-08-2014 08:31 AM in reply to: Rafal.Gaweda
Thanks Rafal,
Again you were extremely efficient and attentive with me.
Please use plain text.
Contributor
rdrmolina
Posts: 16
Registered: ‎02-03-2014

Re: (API) VBA ROS - running steel code calculation

04-10-2014 07:22 AM in reply to: rdrmolina
Private Sub CommandButton2_Click()

On Error GoTo err
Set RobApp = New RobotApplication

If Not RobApp.Visible Then
Set RobApp = Nothing
MsgBox "Open Robot and load model", vbOKOnly, "ERROR"
Exit Sub
End If

Dim RSelection As RobotSelection
Set RSelection = RobApp.Project.Structure.Selections.Create(I_OT_BAR)

Dim RDMServer As RDimServer ' Resultados
Dim RDMStream As RDimStream ' vetor com os parametros
Dim RDMGrps As RDimGroups ' De todos os grupos
Dim RDMGrp1 As RDimGroup ' Grupo em questão
Dim RDmGrpProfs As RDimGrpProfs

Set RDMServer = RobApp.Kernel.GetExtension("RDimServer")
RDMServer.Mode = I_DSM_STEEL

Set RDMGrps = RDMServer.GroupsService
idx = 0
While Cells(2 + idx, 1) <> Empty

usrgr = Int(Cells(2 + idx, 1)) ' Captura o valor do nome do grupo na primeira coluna da planilha

Set RDMGrp1 = RDMGrps.Get(usrgr) ' Seleciona qual grupo se pretende capturar as informações
RDMGrp1.Name = Cells(2 + idx, 2) ' Seta o nome do grupo com o valor da segunda coluna da planilha
Set RDMStream = RDMServer.Connection.GetStream ' vetor de parâmetros
RDMGrp1.GetMembList RDMStream ' Aloca as informções do grupo selecionado no vetor RDMStream
RDMStream.Clear ' Limpa o vetor
RSelection.FromText Cells(2 + idx, 3) ' Faz a seleção conforme preeechimento da 3 coluna da planilha
Cells(2 + idx, 3) = RSelection.ToText
RDMStream.WriteText RSelection.ToText
RDMGrp1.SetMembList RDMStream

Set RDmGrpProfs = RDMServer.Connection.GetGrpProfs
RDmGrpProfs.Clear
RDMStream.Clear
RDMStream.WriteText ("CW") ' family of profiles
RDMStream.WriteText ("CWN") ' family of profiles
RDmGrpProfs.SetFamilies "AISI", RDMStream ' section database
RDMGrp1.SetProfs RDmGrpProfs

RDMGrps.Save RDMGrp1
idx = idx + 1

Wend
Exit Sub



err:
If err.Number = 91 Then MsgBox "One of group number does not exist in model.Please check"

End Sub


I tested the code but it didn't work. On this example I was trying change the actual database to "AISI" and section families to "CW" and "CWN", but the code always Stop in this line

RDmGrpProfs.SetFamilies "AISI", RDMStream

What am I doing wrong?

thanks
Please use plain text.