Discussion Groups

Robot Structural Analysis

Reply
Contributor
d.robin
Posts: 23
Registered: ‎11-29-2013
Accepted Solution

API Buckilng

196 Views, 11 Replies
11-29-2013 05:45 AM

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

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

Re: API Buckilng

12-03-2013 01:19 PM 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
Please use plain text.
Contributor
d.robin
Posts: 23
Registered: ‎11-29-2013

Re: API Buckilng

12-03-2013 11:05 PM 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 ?
Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,064
Registered: ‎04-26-2010

Re: API Buckilng

12-04-2013 07:16 AM 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
Please use plain text.
Contributor
d.robin
Posts: 23
Registered: ‎11-29-2013

Re: API Buckilng

12-04-2013 07:31 AM 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

 

 

 

 

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

Re: API Buckilng

12-04-2013 08:04 AM 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
Please use plain text.
Contributor
d.robin
Posts: 23
Registered: ‎11-29-2013

Re: API Buckilng

12-04-2013 08:11 AM in reply to: d.robin

thx,

 

but yes I have to,

 

all cases are manually set to Robot from strFile

 

 

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

Re: API Buckilng

12-04-2013 08:34 AM 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
Please use plain text.
Contributor
d.robin
Posts: 23
Registered: ‎11-29-2013

Re: API Buckilng

12-04-2013 11:57 PM 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
Please use plain text.
Contributor
d.robin
Posts: 23
Registered: ‎11-29-2013

Re: API Buckilng

12-05-2013 12:00 AM in reply to: d.robin
maybe because I have got a disjoined structure

but it works on Robot UI
Please use plain text.