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
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Check this
Dim RBD As RobotBarBucklingData Set RBD = Robapp.Project.Structure.Results.Bars.Buckling.EigenValue(barnum, casenum, modenum) blenZ= RBD.BuckLengthZ
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
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
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
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
Can't find what you're looking for? Ask the community or share your knowledge.