Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(API) FEM Results via query mechanism

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
a54249
1468 Views, 4 Replies

(API) FEM Results via query mechanism

Hello,

 

After creating a series of panels in RSA I was trying to get the membrane forces of each node (after running the calculation)  using an algorithm in VB. I have seen some topics in this forum about using the query mechanism (and others) but it's only for bars, and I'm having some trouble changing it to panels.

And another question, is possible to get the coordinates of the nodes at the same time?

Can anyone help?


Thanks in advance

4 REPLIES 4
Message 2 of 5
Rafal.Gaweda
in reply to: a54249

Some classes in this code snippets may not exist in Robot but it will give you idea how to do it

 

        protected RobotResultQueryParams CreateQueryParamsForSurfacesValues(List<SdxData.EPhysical> results, bool forAbsoluteMaximum)
        {
            RobotResultQueryParams queryParams = (RobotResultQueryParams)this.RobotKernel.CmpntFactory.Create(IRobotComponentType.I_CT_RESULT_QUERY_PARAMS);
            queryParams.ResultIds.SetSize(results.Count);
            for (int i = 0; i < results.Count; i++)
            {
                int id = (int)results[i];
                queryParams.ResultIds.Set(i + 1, id);
            }

            queryParams.Selection.Set(IRobotObjectType.I_OT_CASE, this.CreateSelectionLoadCase());

            queryParams.SetParam(IRobotResultParamType.I_RPT_MULTI_THREADS, true);
            queryParams.SetParam(IRobotResultParamType.I_RPT_THREAD_COUNT, 4);
            queryParams.SetParam(IRobotResultParamType.I_RPT_SMOOTHING, IRobotFeResultSmoothing.I_FRS_SMOOTHING_WITHIN_A_PANEL);
            queryParams.SetParam(IRobotResultParamType.I_RPT_LAYER, forAbsoluteMaximum ? 6 : (int)IRobotFeLayerType.I_FLT_MIDDLE);
            queryParams.SetParam(IRobotResultParamType.I_RPT_DIR_X_DEFTYPE, IRobotObjLocalXDirDefinitionType.I_OLXDDT_CARTESIAN);
            queryParams.SetParam(IRobotResultParamType.I_RPT_DIR_X, new double[] { 0, 0, 0 });

            return queryParams;
        }

        protected RobotSelection CreateSelectionLoadCase()
        {
            RobotSelection selector = this.RobotKernel.Structure.Selections.Create(IRobotObjectType.I_OT_CASE);
            foreach (string id in this.Header.LoadCaseNotEmptyIndices)
            {
                selector.AddText(id);
            }

            return selector;
        }



Getting results:


                RobotResultQueryParams queryParams = this.CreateQueryParamsForSurfacesValues(results, forAbsoluteMaximum);
                RobotResultRowSet rowSet = new RobotResultRowSet();
                IRobotResultQueryReturnType ret = IRobotResultQueryReturnType.I_RQRT_MORE_AVAILABLE;
                bool anythingCalculated = false;
                while (ret != IRobotResultQueryReturnType.I_RQRT_DONE)
                {
                    ret = this.RobotKernel.Structure.Results.Query(queryParams, rowSet);
                    bool isOk = anythingCalculated = rowSet.MoveFirst();

                    while (isOk)
                    {
                        RobotResultRow row = rowSet.CurrentRow;

   int nodeId = (int)row.GetParam(IRobotResultParamType.I_RPT_NODE);
                        int panelId = (int)row.GetParam(IRobotResultParamType.I_RPT_PANEL);

                            string idCase = ((int)row.GetParam(KernelOM.IRobotResultParamType.I_RPT_LOAD_CASE)).ToString();
                            foreach (SdxData.EPhysical item in results)
                            {
                                int id = (int)item;
                                if (row.IsAvailable(id))
                                {
double value = (double)row.GetValue(id);
                                }
                                else
                                {
                                    throw new Exception(string.Format(Properties.Resources.Error_ReadingElemNode, panelId, nodeId));
                                }
                            }
                        }

                        isOk = rowSet.MoveNext();
                    }
                }

 



Rafal Gaweda
Message 3 of 5
a54249
in reply to: Rafal.Gaweda

Thanks Rafal!
Message 4 of 5
smikaric
in reply to: Rafal.Gaweda

Can you tell me what is the content of variable resultes?

I am missing id number and how can find list of thoes values? 

 

  queryParams.ResultIds.SetSize(results.Count);
            for (int i = 0; i < results.Count; i++)
            {
                int id = (int)results[i];
                queryParams.ResultIds.Set(i + 1, id);
            }

 

Message 5 of 5
Rafal.Gaweda
in reply to: smikaric

Hi @smikaric

 

Please check Private Message



Rafal Gaweda

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report