Hello,
After running a calculation on robot i'm trying to get only the maximum result, like a displacement or a stress, by using the following algorithm in VB.
But i think it's taking too long, is any better/faster way? I only need for the first case of loads.
If Iniciar = True Then Dim i As Integer Dim robApp As IRobotApplication robApp = New RobotApplication Dim cas_col As RobotCaseCollection cas_col = robApp.Project.Structure.Cases.GetAll Dim fe_col As RobotFiniteElementCollection fe_col = robApp.Project.Structure.FiniteElems.GetAll Dim cas As IRobotCase cas = cas_col.Get(1) Dim numCas As Long numCas = cas.Number Dim params As New RobotFeResultParams Dim max As Double Dim m As Double max = 0 m = 0 For i = 1 To fe_col.Count Dim fe As IRobotFiniteElement fe = fe_col.Get(i) Dim numFe As Long numFe = fe.Number params.Element = numFe params.Case = numCas Dim princFE As IRobotFeResultPrincipal princFE = robApp.Project.Structure.Results.FiniteElems.Principal(params) m = -princFE.UGZ princFE = Nothing cas = Nothing If m > max Then max = m End If fe = Nothing Next i robApp = Nothing Result = max End If
Thanks in advance!
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Thanks Rafael, I should have spent more time looking in the forum. I'm going to try this.
I've tried the other post but i'm having some difficulties, isn't there any easier way of only getting the extreme value in the whole structure (it only has panels)?
I was reading the ROS API and I found "IRobotExtremeResultServer" and "IRobotExtremeValue (Structure providing access to information about the extreme value.)"
But I can't implement this correctly due to my inexperience. Is it even possible?
Thanks for the help.
Example for bars
Dim s As RobotSelection Dim sc As RobotSelection Set s = RobApp.Project.Structure.Selections.Create(I_OT_BAR) Set sc = RobApp.Project.Structure.Selections.Create(I_OT_CASE) s.AddText ("54") sc.AddText ("1") Dim es As RobotOM.RobotExtremeParams Set es = RobApp.CmpntFactory.Create(I_CT_EXTREME_PARAMS) es.ValueType = I_EVT_FORCE_BAR_MY es.BarDivision = 10000 es.Selection.Set I_OT_BAR, s es.Selection.Set I_OT_CASE, sc Dim v As String Dim p As String Dim b As String Dim c As String b = Str(RobApp.Project.Structure.Results.Extremes.MinValue(es).Bar) v = Str(RobApp.Project.Structure.Results.Extremes.MinValue(es).Value) p = Str(RobApp.Project.Structure.Results.Extremes.MinValue(es).Position) c = Str(RobApp.Project.Structure.Results.Extremes.MinValue(es).Case) MsgBox " MyMin = " & v & " at " & p & " (case " & c & ")", vbOKOnly b = Str(RobApp.Project.Structure.Results.Extremes.MaxValue(es).Bar) v = Str(RobApp.Project.Structure.Results.Extremes.MaxValue(es).Value) p = Str(RobApp.Project.Structure.Results.Extremes.MaxValue(es).Position) c = Str(RobApp.Project.Structure.Results.Extremes.MaxValue(es).Case) MsgBox " MyMAX = " & v & " at " & p & " (case " & c & ")", vbOKOnly, "Results"