public void CopyData()
        {
            button1.Text = "Loading...";
            //this.WindowState = FormWindowState.Minimized;
            RobotApplication robapp = new RobotApplication();

            //-------------------------------------
            //Load Cases
            IRobotCaseCollection robotCaseCollection = robapp.Project.Structure.Cases.GetAll();
            int loadCase = 0;

            int FindCase(string casename)
            {
                int        number    = 1;
                IRobotCase robotCase = robapp.Project.Structure.Cases.Get(1);

                for (int i = 0; i < robotCaseCollection.Count; i++)
                {
                    robotCase = robapp.Project.Structure.Cases.Get(i);
                    if (robotCase != null)
                    {
                        if (robotCase.Name == casename)
                        {
                            number = i;
                            break;
                        }
                    }
                }
                loadCase = number;
                return(number);
            }

            //-------------------------------------
            //Get Number of Bars Selected
            RobotSelection barSel = robapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_BAR);
            //Get All Load Cases
            RobotSelection casSel = robapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_CASE);

            //Get Bar and Node Data
            IRobotBarServer  robotBarServer = robapp.Project.Structure.Bars;
            IRobotNodeServer inds           = robapp.Project.Structure.Nodes;

            //Get a List of the bars and Setup bar information Struct
            int[]            barSelArray = new int[barSel.Count];
            BeamDataStruct[] beamData    = new BeamDataStruct[barSelArray.Length];
            for (int i = 1; i < barSel.Count + 1; i++)
            {
                //Setup bar no. array
                barSelArray[i - 1] = barSel.Get(i);

                //Get node information from bar data
                IRobotBar  bar         = (IRobotBar)robotBarServer.Get(barSelArray[i - 1]);
                int        startNodeNo = bar.StartNode;
                int        endNodeNo   = bar.EndNode;
                IRobotNode startNode   = (IRobotNode)inds.Get(startNodeNo);
                IRobotNode endNode     = (IRobotNode)inds.Get(endNodeNo);

                //If a Beam, Skip
                if (startNode.Z == endNode.Z)
                {
                    continue;
                }

                //Which is highest node
                IRobotNode node = (startNode.Z > endNode.Z) ? startNode : endNode;

                //Populate beam data from node and bar data.
                beamData[i - 1].barNo            = barSelArray[i - 1];
                beamData[i - 1].section          = bar.GetLabel(IRobotLabelType.I_LT_BAR_SECTION).Name.ToString();
                beamData[i - 1].x                = node.X;
                beamData[i - 1].y                = node.Y;
                beamData[i - 1].z                = node.Z;
                beamData[i - 1].height           = bar.Length;
                beamData[i - 1].concreteStrength = bar.GetLabel(IRobotLabelType.I_LT_MATERIAL).Name.ToString();

                //textBox2.AppendText(beamData[i - 1].barNo.ToString() + "\t : " + beamData[i - 1].section.ToString() + "\t : " +
                //    beamData[i - 1].x.ToString("F3") + "\t : " + beamData[i - 1].y.ToString("F3") + "\t : " + beamData[i - 1].z.ToString("F3") + "\r\n");
            }

            textBox2.AppendText("\r\nSorting\r\n");
            beamData = beamData.OrderBy(x => x.z).ToArray();
            beamData = beamData.OrderBy(x => x.y).ToArray();
            beamData = beamData.OrderBy(x => x.x).ToArray();

            int group      = 1;
            int posInGroup = 0;

            for (int i = 0; i < beamData.Length; i++)
            {
                posInGroup = 0;


                for (int j = 0; j < beamData.Length; j++)
                {
                    if (beamData[i].x - beamData[j].x < 0.0001 && beamData[i].y - beamData[j].y < 0.0001 && beamData[i].barNo != beamData[j].barNo)
                    {
                        if (beamData[j].group != 0)
                        {
                            beamData[i].group = beamData[j].group;
                            for (int k = 0; k < beamData.Length; k++)
                            {
                                if (beamData[i].group == beamData[k].group && beamData[i].barNo != beamData[k].barNo)
                                {
                                    posInGroup++;
                                }
                            }
                            beamData[i].posInGroup = posInGroup;
                        }
                        else
                        {
                            beamData[i].group = group;
                            group++;
                        }
                        break;
                    }
                }
            }

            //Estimate Calculation time



            void QueryResults()
            {
                //RobotExtremeParams robotExtremeParams = robapp.CmpntFactory.Create(IRobotComponentType.I_CT_EXTREME_PARAMS);
                robapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_CASE).FromText(FindCase(listBox1.SelectedItem.ToString()).ToString());
                //robotExtremeParams.Selection.Set(IRobotObjectType.I_OT_CASE, casSel);
                //IRobotBarForceServer robotBarResultServer = robapp.Project.Structure.Results.Bars.Forces;

                for (int i = 0; i < beamData.Length; i++)
                {
                    robapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_BAR).FromText(beamData[i].barNo.ToString());
                    //robotExtremeParams.Selection.Set(IRobotObjectType.I_OT_BAR, barSel);

                    IRobotResultQueryReturnType res          = new IRobotResultQueryReturnType();
                    RobotResultQueryParams      queryParams  = new RobotResultQueryParams();
                    RobotResultRowSet           resultRowSet = new RobotResultRowSet();

                    queryParams = robapp.CmpntFactory.Create(IRobotComponentType.I_CT_RESULT_QUERY_PARAMS);
                    queryParams.Selection.Set(IRobotObjectType.I_OT_BAR, barSel);
                    queryParams.Selection.Set(IRobotObjectType.I_OT_CASE, casSel);

                    //queryParams.SetParam(IRobotResultParamType.I_RPT_BAR, );

                    queryParams.ResultIds.SetSize(3);
                    queryParams.ResultIds.Set(1, 167);
                    queryParams.ResultIds.Set(2, 168);
                    queryParams.ResultIds.Set(3, 169);

                    res = robapp.Project.Structure.Results.Query(queryParams, resultRowSet);

                    textBox2.AppendText(resultRowSet.CurrentRow.GetValue(resultRowSet.ResultIds.Get(2)).ToString());
                }
            }

            void CalculateResults()
            {
                textBox2.AppendText($"\r\nStarting calculation: {DateTime.Now.ToString("h:mm:ss tt")}");
                RobotExtremeParams robotExtremeParams = robapp.CmpntFactory.Create(IRobotComponentType.I_CT_EXTREME_PARAMS);

                robapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_CASE).FromText(FindCase(listBox1.SelectedItem.ToString()).ToString());
                robotExtremeParams.Selection.Set(IRobotObjectType.I_OT_CASE, casSel);
                IRobotBarForceServer robotBarResultServer = robapp.Project.Structure.Results.Bars.Forces;
                int  total     = beamData.Length;
                bool firstLoop = true;

                for (int i = 0; i < beamData.Length; i++)
                {
                    DateTime startTime = DateTime.Now;
                    textBox2.AppendText($"\r\nStart Calculation {i + 1} / {total} before bar selection: {DateTime.Now.ToString("h:mm:ss tt")}");
                    robapp.Project.Structure.Selections.Get(IRobotObjectType.I_OT_BAR).FromText(beamData[i].barNo.ToString());
                    robotExtremeParams.Selection.Set(IRobotObjectType.I_OT_BAR, barSel);


                    //MZ
                    robotExtremeParams.ValueType = IRobotExtremeValueType.I_EVT_FORCE_BAR_MZ;

                    if (Math.Abs(robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).Value) > Math.Abs(robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).Value))
                    {
                        beamData[i].mZForceServer    = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).CaseCmpnt, 1);
                        beamData[i].mZForceServerbtm = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).CaseCmpnt, 0);
                    }
                    else
                    {
                        beamData[i].mZForceServer    = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).CaseCmpnt, 1);
                        beamData[i].mZForceServerbtm = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).CaseCmpnt, 0);
                    }

                    if (Math.Abs(beamData[i].mZForceServer.MZ) > Math.Abs(beamData[i].mZForceServerbtm.MZ))
                    {
                        //do nothing
                    }
                    else
                    {
                        IRobotBarForceData holder = beamData[i].mZForceServer;
                        beamData[i].mZForceServer    = beamData[i].mZForceServerbtm;
                        beamData[i].mZForceServerbtm = holder;
                    }



                    //MY
                    robotExtremeParams.ValueType = IRobotExtremeValueType.I_EVT_FORCE_BAR_MY;

                    if (Math.Abs(robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).Value) > Math.Abs(robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).Value))
                    {
                        beamData[i].mYForceServer    = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).CaseCmpnt, 1);
                        beamData[i].mYForceServerbtm = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).CaseCmpnt, 0);
                    }
                    else
                    {
                        beamData[i].mYForceServer    = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).CaseCmpnt, 1);
                        beamData[i].mYForceServerbtm = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).CaseCmpnt, 0);
                    }

                    if (Math.Abs(beamData[i].mYForceServer.MY) > Math.Abs(beamData[i].mYForceServerbtm.MY))
                    {
                        //do nothing
                    }
                    else
                    {
                        IRobotBarForceData holder = beamData[i].mYForceServer;
                        beamData[i].mYForceServer    = beamData[i].mYForceServerbtm;
                        beamData[i].mYForceServerbtm = holder;
                    }



                    //FX
                    robotExtremeParams.ValueType = IRobotExtremeValueType.I_EVT_FORCE_BAR_FX;

                    if (Math.Abs(robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).Value) > Math.Abs(robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).Value))
                    {
                        beamData[i].fXForceServer    = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).CaseCmpnt, 1);
                        beamData[i].fXForceServerbtm = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MaxValue(robotExtremeParams).CaseCmpnt, 0);
                    }
                    else
                    {
                        beamData[i].fXForceServer    = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).CaseCmpnt, 1);
                        beamData[i].fXForceServerbtm = robotBarResultServer.ValueEx(beamData[i].barNo, loadCase, robapp.Project.Structure.Results.Extremes.MinValue(robotExtremeParams).CaseCmpnt, 0);
                    }
                    double totalTime = (DateTime.Now - startTime).TotalSeconds;
                    textBox2.AppendText($"\r\nEnd Calculation {i + 1} / {total} {DateTime.Now.ToString("h:mm:ss tt")} \r\nTime taken: {totalTime}");

                    if (Math.Abs(beamData[i].fXForceServer.FX) > Math.Abs(beamData[i].fXForceServerbtm.FX))
                    {
                        //do nothing
                    }
                    else
                    {
                        IRobotBarForceData holder = beamData[i].fXForceServer;
                        beamData[i].fXForceServer    = beamData[i].fXForceServerbtm;
                        beamData[i].fXForceServerbtm = holder;
                    }



                    if (firstLoop)
                    {
                        textBox2.AppendText($"\r\nEstimated finish time: {DateTime.Now.AddSeconds(total * totalTime).ToString("h:mm:ss tt")}");
                        firstLoop = false;
                    }
                }
            }

            int maxCol = 1;

            void WriteResults()
            {
                int column       = 1;
                int currentGroup = 0;

                for (int i = 0; i < beamData.Length; i++)
                {
                    if (beamData[i].group == currentGroup)
                    {
                        column = beamData[i].posInGroup;
                        if (column >= maxCol)
                        {
                            maxCol = column;
                        }
                    }
                    else
                    {
                        currentGroup++;
                        column = 0;
                    }

                    int row       = currentGroup + 2;
                    int columnPos = beamData[i].posInGroup + 1;
                    WriteCell(row, 0, columnPos.ToString());

                    WriteCell(row, 1 + 22 * column, beamData[i].section.ToString());
                    WriteCell(row, 2 + 22 * column, beamData[i].barNo.ToString());
                    WriteCell(row, 3 + 22 * column, beamData[i].concreteStrength.ToString());
                    WriteCell(row, 4 + 22 * column, beamData[i].group.ToString());
                    WriteCell(row, 5 + 22 * column, beamData[i].posInGroup.ToString());
                    WriteCell(row, 6 + 22 * column, beamData[i].height.ToString());

                    WriteCell(row, 7 + 22 * column, (beamData[i].fXForceServer.FX / 1000).ToString());
                    WriteCell(row, 8 + 22 * column, (beamData[i].fXForceServer.MY / 1000).ToString());
                    WriteCell(row, 9 + 22 * column, (beamData[i].fXForceServer.MZ / 1000).ToString());
                    WriteCell(row, 10 + 22 * column, (beamData[i].fXForceServerbtm.MY / 1000).ToString());
                    WriteCell(row, 11 + 22 * column, (beamData[i].fXForceServerbtm.MZ / 1000).ToString());


                    WriteCell(row, 12 + 22 * column, (beamData[i].mZForceServer.FX / 1000).ToString());
                    WriteCell(row, 13 + 22 * column, (beamData[i].mZForceServer.MY / 1000).ToString());
                    WriteCell(row, 14 + 22 * column, (beamData[i].mZForceServer.MZ / 1000).ToString());
                    WriteCell(row, 15 + 22 * column, (beamData[i].mZForceServerbtm.MY / 1000).ToString());
                    WriteCell(row, 16 + 22 * column, (beamData[i].mZForceServerbtm.MZ / 1000).ToString());


                    WriteCell(row, 17 + 22 * column, (beamData[i].mYForceServer.FX / 1000).ToString());
                    WriteCell(row, 18 + 22 * column, (beamData[i].mYForceServer.MY / 1000).ToString());
                    WriteCell(row, 19 + 22 * column, (beamData[i].mYForceServer.MZ / 1000).ToString());
                    WriteCell(row, 20 + 22 * column, (beamData[i].mYForceServerbtm.MY / 1000).ToString());
                    WriteCell(row, 21 + 22 * column, (beamData[i].mYForceServerbtm.MZ / 1000).ToString());
                }

                WriteCell(0, 0, currentGroup.ToString());
            }

            void PopulateHeaders()
            {
                for (int i = 0; i <= maxCol; i++)
                {
                    //Headers
                    WriteCell(1, 1 + 22 * i, "Cross Section");
                    WriteCell(1, 2 + 22 * i, "Bar No.");
                    WriteCell(1, 3 + 22 * i, "Concrete Strength");
                    WriteCell(1, 4 + 22 * i, "Group");
                    WriteCell(1, 5 + 22 * i, "Pos In Group");
                    WriteCell(1, 6 + 22 * i, "Length");

                    //FZ Max
                    WriteCell(1, 7 + 22 * i, "Fx (Max) [kN]");
                    WriteCell(1, 8 + 22 * i, "My (Top) [kNm]");
                    WriteCell(1, 9 + 22 * i, "Mz (Top) [kNm]");
                    WriteCell(1, 10 + 22 * i, "My (Btm) [kNm]");
                    WriteCell(1, 11 + 22 * i, "Mz (Btm) [kNm]");

                    //MX Max
                    WriteCell(1, 12 + 22 * i, "Fx (Max) [kN]");
                    WriteCell(1, 13 + 22 * i, "My (Top) [kNm]");
                    WriteCell(1, 14 + 22 * i, "Mz (Top) [kNm]");
                    WriteCell(1, 15 + 22 * i, "My (Btm) [kNm]");
                    WriteCell(1, 16 + 22 * i, "Mz (Btm) [kNm]");

                    //MY Max
                    WriteCell(1, 17 + 22 * i, "Fx (Max) [kN])");
                    WriteCell(1, 18 + 22 * i, "My (Top) [kNm]");
                    WriteCell(1, 19 + 22 * i, "Mz (Top) [kNm]");
                    WriteCell(1, 20 + 22 * i, "My (Btm) [kNm]");
                    WriteCell(1, 21 + 22 * i, "Mz (Btm) [kNm]");

                    //Headers
                    WriteCell(0, 9 + 22 * i, "Fx (Max)");
                    WriteCell(0, 14 + 22 * i, "Mz (Max)");
                    WriteCell(0, 19 + 22 * i, "My (Max)");
                }
            }

            WriteData();
            CalculateResults();
            WriteResults();
            PopulateHeaders();
            SaveExcel();
            CloseExcel();
            button1.Text = "Start";
            textBox2.AppendText("\r\nDone, view your documents for the file named 'Results for bars ~date~', you may close this window or select more columns and press 'Start'.");
            robapp           = null;
            this.WindowState = FormWindowState.Normal;
        }
        public async Task QueryResultsAndNodeCoord(string plates,
                                                   IProgress <ProgressModelObject <double> > progress,
                                                   CancellationToken ct)
        {
            IRobotResultQueryReturnType Res;

            var selecPlate = str.Selections.Create(IRobotObjectType.I_OT_PANEL);

            selecPlate.FromText(plates);

            RobotResultQueryParams parm = new RobotResultQueryParams();

            parm.Selection.Set(IRobotObjectType.I_OT_PANEL, selecPlate);

            parm.SetParam(IRobotResultParamType.I_RPT_ELEMENT, 11);
            parm.SetParam(IRobotResultParamType.I_RPT_NODE, 3);
            parm.SetParam(IRobotResultParamType.I_RPT_PANEL, 2);
            parm.SetParam(IRobotResultParamType.I_RPT_RESULT_POINT_COORDINATES, 31);

            parm.ResultIds.SetSize(8);

            parm.ResultIds.Set(1, (int)T_DATA_TYPES.T_FERA_NOD_LONG_UP);
            parm.ResultIds.Set(2, (int)T_DATA_TYPES.T_FERA_NOD_TRAN_UP);
            parm.ResultIds.Set(3, (int)T_DATA_TYPES.T_FERA_NOD_LONG_DOWN);
            parm.ResultIds.Set(4, (int)T_DATA_TYPES.T_FERA_NOD_TRAN_DOWN);
            parm.ResultIds.Set(5, (int)T_DATA_TYPES.T_NODE_COORD_CART_X);
            parm.ResultIds.Set(6, (int)T_DATA_TYPES.T_NODE_COORD_CART_Y);
            parm.ResultIds.Set(7, (int)T_DATA_TYPES.T_NODE_COORD_CART_Z);


            var t = new RSATableQueryingResult();

            Panel = await t.ReadFromTableAsync(plates.ToIntArrayFromRobotStringSelection(), progress, ct);

            if (Panel.Count == 0)
            {
                throw new SlabNotCalculatedExpetation("None of selected slabs are meshed and calculated");
            }


            RobotResultRowSet RobResRowSet = new RobotResultRowSet();

            Res = robot.Project.Structure.Results.Query(parm, RobResRowSet);
            bool ok;
            int  i = 0;

            ok = RobResRowSet.MoveFirst();

            progress.Report(new ProgressModelObject <double>
            {
                ProgressToString = "Getting reinforcements and node coordinations", Progress = 9 * 10
            });


            while (ok)
            {
                ///geting slab number
                int p = (int)RobResRowSet.CurrentRow.GetParam(IRobotResultParamType.I_RPT_PANEL);
                ///if already got in error list
                if (ErrorList.Any(g => g.Contains($"number {p} isn't")))
                {
                    goto ExitPlate;
                }

                var nodeId = (int)RobResRowSet.CurrentRow.GetParam(IRobotResultParamType.I_RPT_NODE);
                //var eeId = (int)RobResRowSet.CurrentRow.GetParam(IRobotResultParamType.I_RPT_ELEMENT);
                for (int x = 0; x < Panel.Count; x++)
                {
                    for (int y = 0; y < Panel[x].nodes.Count; y++)
                    {
                        if (Panel[x].nodes[y].NodeId == nodeId)
                        {
                            ///check if there is result for slab
                            if (!RobResRowSet.CurrentRow.IsAvailable(RobResRowSet.ResultIds.Get(3)))
                            {
                                ErrorList.Add($"Slabs with number {p} isn't calculated for reinforcement");
                                goto ExitPlate;
                            }

                            Panel[x].nodes[y].AX_BOTTOM = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(3)) * 10000, 3);
                            Panel[x].nodes[y].AY_BOTTOM = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(4)) * 10000, 3);
                            Panel[x].nodes[y].AX_TOP    = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(1)) * 10000, 3);
                            Panel[x].nodes[y].AY_TOP    = Math.Round((double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(2)) * 10000, 3);
                            Panel[x].nodes[y].X         = (double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(5));
                            Panel[x].nodes[y].Y         = (double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(6));
                            Panel[x].nodes[y].Z         = (double)RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(7));
                        }
                    }
                }
ExitPlate:
                i++;
                ok = RobResRowSet.MoveNext();
            }

            if (ErrorList.Count == ObjNumbers.Length)
            {
                throw new SlabNotCalculatedForReinfException
                          ("None of selected slabs are calculated for reinforcement");
            }

            progress.Report(new ProgressModelObject <double>
            {
                ProgressToString = "Done collectiong done!", Progress = 10 * 10
            });
            IsDataCollected = true;
        }
Beispiel #3
0
        /// <summary>
        /// Gets the FE meshes from a Robot model using the fast query method
        /// </summary>
        /// <param name="panel_ids"></param>
        /// <param name="coords"></param>
        /// <param name="vertex_indices"></param>
        /// <param name="str_nodes"></param>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public static bool GetFEMeshQuery(out int[] panel_ids, out double[][] coords, out Dictionary <int, int[]> vertex_indices, string filePath = "LiveLink")
        {
            RobotApplication robot = null;

            if (filePath == "LiveLink")
            {
                robot = new RobotApplication();
            }

            //First call getnodesquery to get node points
            double[][] nodeCoords = null;

            //Dictionary<int, BHoM.Structural.Node> _str_nodes = new Dictionary<int, BHoM.Structural.Node>();
            //RobotToolkit.Node.GetNodesQuery(project, filePath);
            //Dictionary<int, int> _nodeIds = new Dictionary<int, int>();
            //for (int i = 0; i < _str_nodes.Count; i++)
            //{
            //    _nodeIds.Add(_str_nodes.ElementAt(i).Value.Number, i);
            //}

            RobotResultQueryParams      result_params = (RobotResultQueryParams)robot.Kernel.CmpntFactory.Create(IRobotComponentType.I_CT_RESULT_QUERY_PARAMS);
            RobotStructure              rstructure    = robot.Project.Structure;
            RobotSelection              FE_sel        = rstructure.Selections.CreateFull(IRobotObjectType.I_OT_FINITE_ELEMENT);
            IRobotResultQueryReturnType query_return  = IRobotResultQueryReturnType.I_RQRT_MORE_AVAILABLE;
            RobotSelection              cas_sel       = rstructure.Selections.Create(IRobotObjectType.I_OT_CASE);

            try { cas_sel.FromText(robot.Project.Structure.Cases.Get(1).Number.ToString()); } catch { }

            if (cas_sel.Count > 0)
            {
                result_params.Selection.Set(IRobotObjectType.I_OT_CASE, cas_sel);
            }

            //result_params.Selection.Set(IRobotObjectType.I_OT_NODE, FE_sel);

            result_params.SetParam(IRobotResultParamType.I_RPT_MULTI_THREADS, true);
            result_params.SetParam(IRobotResultParamType.I_RPT_THREAD_COUNT, 4);
            result_params.SetParam(IRobotResultParamType.I_RPT_SMOOTHING, IRobotFeResultSmoothing.I_FRS_NO_SMOOTHING);
            result_params.SetParam(IRobotResultParamType.I_RPT_DIR_X_DEFTYPE, IRobotObjLocalXDirDefinitionType.I_OLXDDT_CARTESIAN);
            result_params.SetParam(IRobotResultParamType.I_RPT_DIR_X, new double[] { 1, 0, 0 });

            result_params.SetParam(IRobotResultParamType.I_RPT_NODE, 1);
            result_params.SetParam(IRobotResultParamType.I_RPT_PANEL, 1);
            result_params.SetParam(IRobotResultParamType.I_RPT_ELEMENT, 1);
            result_params.SetParam(IRobotResultParamType.I_RPT_RESULT_POINT_COORDINATES, 1);

            result_params.ResultIds.SetSize(2);
            result_params.ResultIds.Set(1, (int)IRobotFeResultType.I_FRT_DETAILED_MXX);
            result_params.ResultIds.Set(2, (int)IRobotFeResultType.I_FRT_DETAILED_MYY);

            RobotResultRowSet row_set = new RobotResultRowSet();
            bool           ok         = false;
            RobotResultRow result_row = default(RobotResultRow);

            List <int> _panel_ids = new List <int>();
            Dictionary <int, int[]> _vertex_indices = new Dictionary <int, int[]>();
            int kounta = 0;

            while (!(query_return == IRobotResultQueryReturnType.I_RQRT_DONE))
            {
                query_return = rstructure.Results.Query(result_params, row_set);
                ok           = row_set.MoveFirst();
                while (ok)
                {
                    //int panel_num = (int)row_set.CurrentRow.GetValue(1252);
                    //_panel_ids.Add(panel_num);

                    int nodeId = (int)row_set.CurrentRow.GetParam(IRobotResultParamType.I_RPT_NODE);
                    //int panelId = (int)row_set.CurrentRow.GetParam(IRobotResultParamType.I_RPT_PANEL);
                    int elementId = (int)row_set.CurrentRow.GetParam(IRobotResultParamType.I_RPT_ELEMENT);

                    //int number_of_indices = (row_set.CurrentRow.IsAvailable(567)) ? 4 : 3;
                    //int[] temp_indices = new int[number_of_indices];
                    //for (int i = 0; i < number_of_indices; i++)
                    //{
                    //    temp_indices[i] = (int)row_set.CurrentRow.GetValue(564 + i);
                    //}

                    var resultIds = row_set.ResultIds;

                    var xxxx = row_set.CurrentRow.GetParam(IRobotResultParamType.I_RPT_RESULT_POINT_COORDINATES);



                    //_vertex_indices.Add(kounta, temp_indices);
                    //kounta++;
                    ok = row_set.MoveNext();
                }
                row_set.Clear();
            }
            result_params.Reset();

            panel_ids      = _panel_ids.ToArray();
            vertex_indices = _vertex_indices;
            coords         = nodeCoords;
            //str_nodes = _str_nodes;
            return(true);
        }