Hello
I am doing a huge number of automatic geometry generation and analysis through C# in Robot. I need to get the extreme values of each bar for the moments and forces, but Robot does not seem to store theese anywhere. This means I have to search with a selected subdivision through every bar and every loadcase to get what I want, and that takes a long time when robot is limited to only run on 1 core in the modelling and post-processing face.
Is there any way of dumping the extreme values for all my bars in one LC to a table? Or to get the values faster? My code looks like the code underneath here for one value;
Can anyone help with this?
Regards,
Knut-Ola
//====================================================
// Extreme-value MZ
//====================================================
RobotExtremeParams EPMZ = new RobotExtremeParams();
EPMZ.ValueType = IRobotExtremeValueType.I_EVT_FORCE_BAR_MZ;
EPMZ.Selection.Set(IRobotObjectType.I_OT_BAR, barEP);
EPMZ.Selection.Set(IRobotObjectType.I_OT_CASE, loadEP);
EPMZ.BarDivision = 11;
RobotExtremeValue MZmax = str.Results.Extremes.MaxValue(EPMZ);
RobotExtremeValue MZmin = str.Results.Extremes.MinValue(EPMZ);
if (Math.Abs(MZmax.Value) > Math.Abs(MZmin.Value))
{
MZ = MZmax.Value;
}
else
{
MZ = MZmin.Value;
}
I fail to see the difference in what is being done in the code you copied and in the code I am already using. The problem is that is is extremely slow.
Is there no way to dump extreme values for each bar to a textfile for example? Even that would be faster than running through each element each time I need the results.
I fail to see the difference in what is being done in the code you copied and in the code I am already using. The problem is that is is extremely slow.
post 2, point 4 - query mechanism
Is there no way to dump extreme values for each bar to a textfile for example?
So dump it either by your own or open such table (by API) and save it as text file (csv)
Dim RT As RobotTable Set RT = RobApp.Project.ViewMngr.CreateTable( ....) 'if needed add columns ' RT.AddColumn (....) RT.Select I_ST_BAR, barsel RT.Select I_ST_CASE, casesel Path = "c:\results.txt" RT.Printable.SaveToFile Path, I_OFF_TEXT
Ok now I see.
Do you believe that there is computational time to gain by using a query like that to get the envelope results in stead of searching through the bar with a number of divisions?
In fact this loop
Do
Res = RobApp.Project.Structure.Results.Query(RobResQueryParams, RobResRowSet)
Dim ok As Boolean
ok = RobResRowSet.MoveFirst()
While ok
v = RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(5))
If (min > v) Then min = v
If (max < v) Then max = v
ok = RobResRowSet.MoveNext()
End While
Loop While Res = RobotOM.IRobotResultQueryReturnType.I_RQRT_MORE_AVAILABLE
is more time consuming then internal loop in Robot while using Extremes