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.