API - fails to get loadcase and loadcombination

API - fails to get loadcase and loadcombination

klavs
Contributor Contributor
385 Views
2 Replies
Message 1 of 3

API - fails to get loadcase and loadcombination

klavs
Contributor
Contributor

When trying to extract loadcombinations, my model gets wrong results.

 

Some loadcases gets the analysis flag IRobotCaseAnalizeType.I_CAT_COMB

and my load combinations just throws this error

 

"Error HRESULT E_FAIL has been returned from a call to a COM component"

 

 

           RobotCaseCollection RCC = (RobotCaseCollection)str.Cases.GetAll();

            RobotCaseCombination loadRecord;
            dictionaryOfLoadCombinations.Clear();

            int caseCounter = 0;

            for (int j = 1; j <= 100000; j++)
            {
                if (str.Cases.Exist(j) == -1)
                {
                    try
                    {
                        IRobotCase RC = (IRobotCase)RCC.Get(j);
                        IRobotCaseAnalizeType AT = RC.AnalizeType;
                        if (AT == IRobotCaseAnalizeType.I_CAT_COMB || AT == IRobotCaseAnalizeType.I_CAT_COMB_NONLINEAR)
                        {
                            IRobotCaseCombination c = (IRobotCaseCombination)RCC.Get(j);
                            dictionaryOfLoadCombinations.Add(c.Number, new LoadCombinations() { AnalysisType = AT.ToString(), IRobotCombinationType = c.CombinationType });
                        }
                        caseCounter += 1;
                        if (RCC.Count == caseCounter)
                        {
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        caseCounter += 1;
                    }
                }

 

0 Likes
Accepted solutions (1)
386 Views
2 Replies
Replies (2)
Message 2 of 3

Stephane.kapetanovic
Mentor
Mentor

hi @klavs 

most of your question is in this topic

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-get-load-combination-properties/m...

best regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 3 of 3

klavs
Contributor
Contributor
Accepted solution

OMG found the error. 

Why is this API all ****ed up.

 

RobotCase.Get() is from 1..n

 Where bars.Get() and nodes.Get() uses the bar and nodes index.

0 Likes