Robot Steel API - Member definition parameters

Robot Steel API - Member definition parameters

Anonymous
Not applicable
2,289 Views
11 Replies
Message 1 of 12

Robot Steel API - Member definition parameters

Anonymous
Not applicable

Hello,

 

I'm trying to define members parameters, using Robot Steel API, to design a bar structure steel with EN1993-1.

I have seen the document "Robot API Steel Design" but I can’t do it. It’s possible provide a complete example to "Visual Basic -Microsoft Excel" for a “Bar” type?

 

Thanks

0 Likes
Accepted solutions (1)
2,290 Views
11 Replies
Replies (11)
Message 2 of 12

Rafal.Gaweda
Autodesk Support
Autodesk Support

Look closer at paragraphs 4.4.1 and 4.4.2 in mentioned doc.

 

Examlpe below

Set all \ required RDimMembParams in place where you cae see commented dots in code below

 

 

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication

    RobApp.Project.Preferences.SetActiveCode I_CT_STEEL_STRUCTURES, "ENV 1993-1:1992"

    Dim RLabel As IRobotLabel
    Dim RdimLabelData  As IRDimMembDefData
    Dim RDimMembParams As IRDimMembParamsEC3
    
        Set RLabel = RobApp.Project.Structure.Labels.Create(I_LT_MEMBER_TYPE, "My Label")
        Set RdimLabelData = RLabel.Data
        
        RdimLabelData.SetDeflYZRelLimit I_DMDDDT_DEFL_Y, 100
        RdimLabelData.SetDeflYZRelLimit I_DMDDDT_DEFL_Z, 200
        RdimLabelData.SetDisplXYRelLimit I_DMDDDT_DISP_X, 300
        RdimLabelData.SetDisplXYRelLimit I_DMDDDT_DISP_Y, 400
        

        Set RDimMembParams = RdimLabelData.CodeParams
        
        RDimMembParams.BuckLengthCoeffY = 10
        '......
        RdimLabelData.CodeParams = RDimMembParams
        RobApp.Project.Structure.Labels.Store RLabel

 

 




Rafal Gaweda
0 Likes
Message 3 of 12

Anonymous
Not applicable

Thank you!

0 Likes
Message 4 of 12

Anonymous
Not applicable

Hello,

 

When I run the Macro in Excel, it return an error:

Run-time '13'

Type mismatch

 

It occurs on line:

Dim RdimLabelData  As IRDimMembDefData

 

Annex image with the error.

 

Thank you!

0 Likes
Message 5 of 12

Rafal.Gaweda
Autodesk Support
Autodesk Support

Wrong Params.

 

    RobApp.Project.Preferences.SetActiveCode I_CT_STEEL_STRUCTURES, "ENV 1993-1:2005"
'.....
    Dim RDimMembParams As IRDimMembParamsE32

 

 



Rafal Gaweda
0 Likes
Message 6 of 12

Anonymous
Not applicable

Ok! Already works! Thank you!

0 Likes
Message 7 of 12

Anonymous
Not applicable

Hello,

 

At the moment, I have defined the member type. What remains now is to assign the type of member to the respective bar, in other words, assign the type "My Label" to a bar 1 and 2, for example. How do this? You can send an example?

 

Thank you.

0 Likes
Message 8 of 12

Rafal.Gaweda
Autodesk Support
Autodesk Support

Like for all labels

 

for one \ given bar number

 

Dim Rbar As RobotBar
Dim BarCollection As RobotBarCollection

RobApp.Project.Structure.Bars.Get(bar_number).SetLabel I_LT_MEMBER_TYPE, "My Label"

'or

Set Rbar = RobApp.Project.Structure.Bars.Get(bar_number)
Rbar.SetLabel I_LT_MEMBER_TYPE, "My Label"

 

for bar collection

 

Set RobotBarCollection = .........
For i = 1 To BarCollection.Count

BarCollection.Get(i).SetLabel I_LT_MEMBER_TYPE, "My Label"

Next i

 



Rafal Gaweda
0 Likes
Message 9 of 12

Anonymous
Not applicable

Dear all,

 

I tried to implement the code below with the corrections made and wasn't able to do it.

An error appears in the line that sets Member Parameters : 

Set RDimMembParams = RdimLabelData.CodeParams
Sub A_MemType()

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication

    RobApp.Project.Preferences.SetActiveCode I_CT_STEEL_STRUCTURES, "ENV 1993-1:2005"

    Dim RLabel As IRobotLabel
    Dim RdimLabelData  As IRDimMembDefData
    Dim RDimMembParams As IRDimMembParamsE32
    
        Set RLabel = RobApp.Project.Structure.labels.Create(I_LT_MEMBER_TYPE, "My Label")
        Set RdimLabelData = RLabel.data
        
        RdimLabelData.SetDeflYZRelLimit I_DMDDDT_DEFL_Y, 100
        RdimLabelData.SetDeflYZRelLimit I_DMDDDT_DEFL_Z, 200
        RdimLabelData.SetDisplXYRelLimit I_DMDDDT_DISP_X, 300
        RdimLabelData.SetDisplXYRelLimit I_DMDDDT_DISP_Y, 400
        

        Set RDimMembParams = RdimLabelData.CodeParams
        
        RDimMembParams.BuckLengthCoeffY = 10
        '......
        RdimLabelData.CodeParams = RDimMembParams
        RobApp.Project.Structure.labels.Store RLabel

End Sub

 Thanks in advance.

0 Likes
Message 10 of 12

Artur.Kosakowski
Autodesk Support
Autodesk Support
Accepted solution

Try:

 

Sub A_MemType()

           Dim RobApp As RobotApplication

           Set RobApp = New RobotApplication

           RobApp.Project.Preferences.SetActiveCode I_CT_STEEL_STRUCTURES, "EN 1993-1:2005/AC:2009" ‘ "ENV 1993-1:2005"

           Dim RLabel As IRobotLabel

           Dim RdimLabelData As IRDimMembDefData

           Dim RDimMembCodeParams As Object ‘IRDimMembParamsE32

           Set RLabel = RobApp.Project.Structure.labels.Create(I_LT_MEMBER_TYPE, "My Label")

           Set RdimLabelData = RLabel.data

           RdimLabelData.SetDeflYZRelLimit I_DMDDDT_DEFL_Y, 100 RdimLabelData.SetDeflYZRelLimit I_DMDDDT_DEFL_Z, 200

           RdimLabelData.SetDisplXYRelLimit I_DMDDDT_DISP_X, 300 RdimLabelData.SetDisplXYRelLimit I_DMDDDT_DISP_Y, 400

           Set RDimMembCodeParams = RdimLabelData.CodeParams

           RDimMembCodeParams.BuckLengthCoeffY = 10

           RdimLabelData.CodeParams = RDimMembCodeParams

           RobApp.Project.Structure.labels.Store RLabel

    End Sub

 

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
0 Likes
Message 11 of 12

Anonymous
Not applicable
Thanks Arthur. It worked perfectly.
0 Likes
Message 12 of 12

polylouis
Enthusiast
Enthusiast

Hello @Artur.Kosakowski,

 

how to translate  Dim RDimMembCodeParams As Object in C# ?

 

Thank you in advance,

Regards


Louis 

0 Likes