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) Inaccurate results using the extreme results server

20 REPLIES 20
Reply
Message 1 of 21
Anonymous
1315 Views, 20 Replies

(API) Inaccurate results using the extreme results server

Hi, I'm currently trying to get the maximum principal stress on two finite elements panelsl from Excel with VBA. I'm getting the results with robApp.Project.Structure.Results.FiniteElems.MaxValue(extParams).Value and I'm feeding it withfollowing parameters extParams.ElementSel = objPanel.FiniteElems 'Where objPanel is the corresponding RobotObjObject extParams.CaseSel = CStr(loadCase) extParams.Smoothing = I_FRS_NO_SMOOTHING extParams.resultID = valType 'Here, this is equal to I_FRT_PRINCIPAL_S1 extParams.Layer = I_FLT_UPPER 'I'd have the maximal, minimal or absolute max but the values doesn't seem available... Each time I call this function I get the same results as displayed in RSA for the first panel but the results for the second one are almost always wrong (eg I get 16 Mpa in excel for 3 Mpa displayed in RSA). I noticed that I could get the same results in Excel as in RSA if I close RSA and reopen the model, then call the function from excel without having run the model again. Do you know where this problem comes from ? PS : I posted in another topic about the method using the query mechanism but I got an error 429 and I read it might be even longer to run. To the admin team, I had problems seeing the topic list inside the board page and posting with firefox and IE. Now I can post using Chrome but still no topics appear in the board page. Thanks, Regards.
20 REPLIES 20
Message 2 of 21
Anonymous
in reply to: Anonymous

Sorry for the poor formatting of the last post, I don't kown why this happens sometimes. It should have come out like this :

 

Hi,

I'm currently trying to get the maximum principal stress on two finite elements panelsl from Excel with VBA.

 

I'm getting the results with robApp.Project.Structure.Results.FiniteElems.MaxValue(extParams).Value and I'm feeding it with the following parameters :

 

extParams.ElementSel = objPanel.FiniteElems 'Where objPanel is the corresponding RobotObjObject
extParams.CaseSel = CStr(loadCase)
extParams.Smoothing = I_FRS_NO_SMOOTHING
extParams.resultID = valType 'Here, this is equal to I_FRT_PRINCIPAL_S1
extParams.Layer = I_FLT_UPPER 'I'd have the maximal, minimal or absolute max but the values doesn't seem available...

 

Each time I call this function I get the same results as displayed in RSA for the first panel but the results for the second one are almost always wrong (eg I get 16 Mpa in excel for 3 Mpa displayed in RSA).

I noticed that I could get the same results in Excel as in RSA (thie right one I hope) if I close RSA and reopen the model, then call the function from excel without having run the model again.

 

Do you know where this problem comes from ?

 

Thanks, Regards.

PS : I posted in another topic about the method using the query mechanism but I got an error 429 and I read it might be even longer to run, so I'm back trying to make this method work.

Message 3 of 21
Rafal.Gaweda
in reply to: Anonymous

MaxValue MinValue may present wrong values if more than 1 panel in model
Acknowledged.
Must be checked by developers.
Thank you for reporting

I will check resultsquery, but I need one more information :
have you compiled it as 64 bit application?



Rafal Gaweda
Message 4 of 21
Anonymous
in reply to: Rafal.Gaweda

Hi,

 

Thanks for your answer. I'm looking forward to know where this comes from.

Regarding the problem with query, I'm running a Windows 64bits with RSA 2014 64bits and Excel in 32bits.

 

Regards.

 

Message 5 of 21
Rafal.Gaweda
in reply to: Anonymous

Excel 32 bit VBA + RSA 64 bit
Need to be checked by me



Rafal Gaweda
Message 6 of 21
Rafal.Gaweda
in reply to: Rafal.Gaweda

Unfortunately resultsquery requires full compatibility between softwares - I mean it can be used only in 64bit enviroment

So you need MS Office 64 bit or make VB or C# or... program compiling it with 64 bit architecture

 

resultsquery.jpg



Rafal Gaweda
Message 7 of 21
Anonymous
in reply to: Rafal.Gaweda

Hi,

 

Thanks for your help, I'll try to switch to Office 64bits.

 

Regards.

Message 8 of 21
Rafal.Gaweda
in reply to: Anonymous

Use

 

ExtParams.PanelSel = RobApp.Project.Structure.Objects.Get(i).Number

 

instead of 

 

ExtParams.ElementSel = RobApp.Project.Structure.Objects.Get(i).FiniteElems


Rafal Gaweda
Message 9 of 21
Anonymous
in reply to: Rafal.Gaweda

I already tried that a while ago and I don't think I had an error, I'm gonna try again.

 

As I couldn't find a solution to quickly get the max stress, I tried a "brute force" solution that loops on every finite element in the provided panel and keeps the max stress that could be found.

 

This is much much longer that using the MaxValue and MinValue and I noticed I had the same problem than before : The VBA code read a stress of 24.36MPa for the second panel whereas I read 10.1MPa in RSA for the exact same load case.

I'm kind of afraid cause on one run, I even saw the 24.36Mpa displayed in robot and when I rebooted RSA, it was back at 10.1 MPa.

Unfortunately, the model file had an error and I couldn't open it again to review it...

 

Do you have more information on why the result is wrong on the second panel ? Have you been able to replicate the bug ?

 

Regards.

Message 10 of 21
Rafal.Gaweda
in reply to: Anonymous

It should not be any problem (or at least I have not seen it) while using
panel selection (ExtParams.PanelSel) instead of ElementSel


Rafal Gaweda
Message 11 of 21
Rafal.Gaweda
in reply to: Rafal.Gaweda

IN case of getting results "in elements centers" you should use:

ExtParams.ElementSel = RobApp.Project.Structure.Objects.Get(i).FiniteElems
and
ExtParams.Smoothing = I_FRS_IN_ELEMENT_CENTER



Rafal Gaweda
Message 12 of 21
Anonymous
in reply to: Rafal.Gaweda

Hi,

 

I looked a bit deeper in the problem, without changing the process for getting the results, but it's actually a bit more complicated than I expected.

My VBA code runs several iterations during wich it changes the second panel's thickness, runs the calculation and extract the stress.

 

I just found out that the stress I get in VBA is the stress corresponding exactly to the previous thickness :

 

vba_stress = robot_stress * newthick^2 / oldthick^2

I checked several different thickness and the result is still exactly the same so that can't be a coincidence.

 

This means that eventhough the calculation has been run with the new thickness (I made sure of that by displaying the thickness in Robot), the results fetched from VBA (regardless of the process used to get the results) still take in account the previous thickness.

 

I figured it could be the results were not updated yet, but the result status is "available" from VBA and even if I wait for 30 seconds and extract the stress again, it gives the same result.

 

Maybe there's something that doesnt update the results each time the calculation runs....

 

Regards.

 

Message 13 of 21
Rafal.Gaweda
in reply to: Anonymous

Add this line before line running calculation

RobApp.Project.CalcEngine.GenerateModel

then check results



Rafal Gaweda
Message 14 of 21
Anonymous
in reply to: Rafal.Gaweda

Hi,

 

I thought the model was automatically generated when running a calculation.

I added this line anyway but I didn't get any further : The result I get without adding I_FRS_IN_ELEMENT_CENTER is different from the usual wrong value I get but if I use id, it's back to the "right" wrong value.

 

Anyway, I find odd that the model wasn't generated before because the result displayed in Robot was right (so the new thickness was taken in account somewhere).

 

Just to confirm, I saved the model, closed robot and reopened it, then tried to extract the results again.

The function to get the results was way faster than before closing and gave the true right value, as displayed in robot.

 

By the way, I tried to use Panel selection instead of Element and that runs the same without an error so that must have been something else at the time I tried before.

 

Regards.

Message 15 of 21
Rafal.Gaweda
in reply to: Anonymous

Send me part of your code


Rafal Gaweda
Message 16 of 21
Anonymous
in reply to: Rafal.Gaweda

Just sent it to you in PM.

 

Message 17 of 21
Anonymous
in reply to: Anonymous

Hi Rafal,

 

Did you have the time to take a look at the code I sent you ?

 

Thanks.

Regards.

Message 18 of 21
Rafal.Gaweda
in reply to: Anonymous

Not yet.
I plan it for this week


Rafal Gaweda
Message 19 of 21
Anonymous
in reply to: Rafal.Gaweda

Ok. Thanks.

Message 20 of 21
Rafal.Gaweda
in reply to: Anonymous

My test, my test files attached

 



Rafal Gaweda

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

Post to forums  

Autodesk Design & Make Report