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 Buckilng

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
d.robin
417 Views, 11 Replies

API Buckilng

Hi,

 

How can I get BuckLengthY ?

 

I've tried this but it crash on gRobotBarFlambement.EigenVector :

                Current.ResultatsRobotFlambement = New List(Of ResultatRobotFlambement)
                Dim TousCas As RobotOM.IRobotCaseCollection = gProjet.Structure.Cases.GetAll

                For Each iBarre As Integer In Current.Barres
                    If gProjet.Structure.Bars.Exist(iBarre) Then
                        Dim Barre As RobotBar = gProjet.Structure.Bars.Get(iBarre)
                        Dim iStart As Integer = Barre.StartNode
                        Dim iFin As Integer = Barre.EndNode
                        If iStart > iFin Then
                            iStart = Barre.EndNode
                            iFin = Barre.StartNode
                        End If
                        For iNoeud As Integer = iStart To iFin
                            If gProjet.Structure.Nodes.Exist(iNoeud) Then
                                'Dim N As RobotOM.IRobotNode = gProjet.Structure.Nodes.Get(iNoeud)
                                For iCas As Integer = 1 To TousCas.Count
                                    Dim Cas As RobotOM.IRobotCase = CType(TousCas.Get(iCas), RobotOM.IRobotCase)
                                    Dim Fla As RobotBarBucklingData = gRobotBarFlambement.EigenVector(iNoeud, iCas, gProjet.Structure.Results.Any.Mode)
                                    Dim D As Double = Fla.BuckLengthY
                                    If D <> 0 Then
                                        Dim Res As New ResultatRobotFlambement With {.Barre = iBarre, .Noeud = iNoeud, _
                                            .Cas = Cas.Name.Trim, .LongueurFlambement = D}
                                        Current.ResultatsRobotFlambement.Add(Res)
                                    End If
                                    Fla = Nothing
                                Next
                            End If
                        Next
                        Barre = Nothing
                    End If
                Next

                TousCas = Nothing

11 REPLIES 11
Message 2 of 12
Rafal.Gaweda
in reply to: d.robin

Check this

 

Dim RBD As RobotBarBucklingData
Set RBD = Robapp.Project.Structure.Results.Bars.Buckling.EigenValue(barnum, casenum, modenum)
blenZ= RBD.BuckLengthZ

 



Rafal Gaweda
Message 3 of 12
d.robin
in reply to: Rafal.Gaweda

thx,
I've tried it
but this crash :
Robapp.Project.Structure.Results.Bars.Buckling.EigenValue(barnum, casenum, modenum)

how get you the modenum ?
Message 4 of 12
Rafal.Gaweda
in reply to: d.robin

you get   RBD 

you have to specify for which bar, case, mode (barnum, casenum, modenum) you want to get RBD from Robapp.Project.Structure.Results.Bars.Buckling.EigenValue



Rafal Gaweda
Message 5 of 12
d.robin
in reply to: d.robin

thx

 

that's ok

 

'I specify the case number like that :

dim TousCas as RobotOM.IRobotCaseCollection = MyRobotApplication.Project.Structure.Cases.GetAll

 

'the BucklingServer

dim BuServer as RobotBarBucklingServer = MyRobotApplication.Project.Structure.Results.Bars.Buckling

 

'the barre number like that :

for each iBarre as integer in Current.Barres  'All My Bars

    if MyRobotApplication.Project.Structure.Bars.Exist(iBarre)

        for iCas as integer = 1 to TousCas.Count

            'I've got a crash on getting EigenValue, when I'm using UI on robot it works fine with same project

            dim Bu as RobotBarBucklingData = BuServer.EigenValue(iBarre, iCas, 1) '1->ModeNum

        next

    end if

next

 

 

 

 

Message 6 of 12
Rafal.Gaweda
in reply to: d.robin

This loop

 

for iCas as integer = 1 to TousCas.Count

 

means you are trying to get buckling results for each \ all cases in project

Do you really have only \ all cases set as buckling in model?

 

If not, you have to check case type

 

Dim CaseType As Integer
    CaseType = Robapp.Project.Structure.Cases.Get(iCas).AnalizeType

    If (CaseType = I_CAT_STATIC_NONLINEAR_BUCKLING Or CaseType = I_CAT_STATIC_BUCKLING _
        Or CaseType = I_CAT_COMB_BUCKLING Or CaseType = I_CAT_COMB_NONLINEAR_BUCKLING) Then

 



Rafal Gaweda
Message 7 of 12
d.robin
in reply to: d.robin

thx,

 

but yes I have to,

 

all cases are manually set to Robot from strFile

 

 

Message 8 of 12
Rafal.Gaweda
in reply to: d.robin

my example VBA code (all bars; all cases must be set as buckling in model)

 

Dim robapp As RobotApplication
Set robapp = New RobotApplication
Dim TousCas As RobotCaseCollection
Set TousCas = robapp.Project.Structure.Cases.GetAll

Dim TousBarres As RobotBarCollection
Set TousBarres = robapp.Project.Structure.Bars.GetAll

'the BucklingServer
Dim BuServer As RobotBarBucklingServer
Set BuServer = robapp.Project.Structure.Results.Bars.Buckling
 
'the barre number like that :

For i = 1 To TousBarres.Count
        iBarre = TousBarres.Get(i).Number
        For iC = 1 To TousCas.Count
            iCas = TousCas.Get(iC).Number
            Dim Bu As RobotBarBucklingData
            Set Bu = BuServer.EigenValue(iBarre, iCas, 1) '1->ModeNum
            Ly = Bu.BuckLengthY
            Lz = Bu.BuckLengthZ
        Next iC
Next i

 



Rafal Gaweda
Message 9 of 12
d.robin
in reply to: Rafal.Gaweda

it still crash

I've add your precedant post to test but it's not better
Dim Cas As RobotOM.IRobotCase = CType(TousCas.Get(iCas), RobotOM.IRobotCase)
Dim B As Boolean
Select Case Cas.AnalizeType
Case IRobotCaseAnalizeType.I_CAT_COMB_BUCKLING
B = True
Case IRobotCaseAnalizeType.I_CAT_COMB_NONLINEAR_BUCKLING
B = True
Case IRobotCaseAnalizeType.I_CAT_STATIC_BUCKLING
B = True
Case IRobotCaseAnalizeType.I_CAT_STATIC_NONLINEAR_BUCKLING
B = True
Case Else
B = False
End Select
If B Then
Dim Fla As RobotBarBucklingData = gRobotBarFlambement.EigenValue(iBarre, iCas, 1)
end if
Message 10 of 12
d.robin
in reply to: d.robin

maybe because I have got a disjoined structure

but it works on Robot UI
Message 11 of 12
d.robin
in reply to: Rafal.Gaweda

I've tried it on Excel and it works

it's on vb.net that it crash

Excel code :
Public Sub test()
Dim gRobotApplication As RobotOM.IRobotApplication
Set gRobotApplication = New RobotOM.RobotApplication
Dim gProjet As RobotOM.IRobotProject
Set gProjet = gRobotApplication.Project
Dim gRobotBarFlambement As RobotBarBucklingServer
Set gRobotBarFlambement = gRobotApplication.Project.Structure.Results.Bars.Buckling
Dim TousCas As RobotOM.IRobotCaseCollection
Set TousCas = gRobotApplication.Project.Structure.Cases.GetAll
Dim ToutesBarres As RobotBarCollection
Set ToutesBarres = gRobotApplication.Project.Structure.Bars.GetAll

Dim i As Integer
For i = 1 To ToutesBarres.Count
Dim iBarre As Integer
iBarre = ToutesBarres.Get(i).Number
If CBool(gProjet.Structure.Bars.Exist(iBarre)) Then
Dim Barre As RobotBar
Set Barre = gProjet.Structure.Bars.Get(iBarre)
For j = 1 To TousCas.Count
Dim iCas As Integer
iCas = TousCas.Get(j).Number
Dim Cas As RobotOM.IRobotCase
Set Cas = TousCas.Get(iCas)
Dim B As Boolean
Select Case Cas.AnalizeType
Case IRobotCaseAnalizeType.I_CAT_COMB_BUCKLING
B = True
Case IRobotCaseAnalizeType.I_CAT_COMB_NONLINEAR_BUCKLING
B = True
Case IRobotCaseAnalizeType.I_CAT_STATIC_BUCKLING
B = True
Case IRobotCaseAnalizeType.I_CAT_STATIC_NONLINEAR_BUCKLING
B = True
Case Else
B = False
End Select
If B Then
Dim Fla As RobotBarBucklingData
Set Fla = gRobotBarFlambement.EigenValue(iBarre, iCas, 1)
Debug.Print Fla.BuckLengthY
End If
Next
Set Barre = Nothing
End If
Next
Set TousCas = Nothing
Set gRobotBarFlambement = Nothing
End Sub
Message 12 of 12
d.robin
in reply to: d.robin

I've found the problem

After Buckling Calcul,
Robot must be interractive to get BucklingResults

if it's not it crash

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

Post to forums  

Autodesk Design & Make Report