Using ACT, how can I retrieve stress results?
Best Answer

The following code can be used to retrieve all components of the stress tensor on one element:
model=ExtAPI.DataModel.Project.Model # refer to model reader = model.Analyses[0].GetResultsData() # get results data of first analysis in the tree StressResults = reader.GetResult('S') # obtain stress results StressElement1 = StressResults.GetElementValues(1) # retrieve results on element n°1
To retrieve the values in one direction only, the following code can be used:
model=ExtAPI.DataModel.Project.Model # refer to model reader = model.Analyses[0].GetResultsData() # get results data of first analysis in the tree StressResults = reader.GetResult('S') # obtain stress results StressResults.SelectComponents(["X"]) # select direction StressXElement1=StressResults.GetElementValues(1) # retrieve results on element n°1
0
Answers

Hi, using the first method for result extraction in a thermalelectric simulation in Ansys WB 2022R2 I get the following error "Error HRESULT E_FAIL has been returned from a call to a COM component.". The error appears in the third line when reader.GetResult is called for results like "Temperature", " Electric Voltage" , and it works only for one result called "EF" which is the directional electric field intensity. All results are from the same analysis. Do you know how to overcome this issue?
0 
Hi @Luiza , this error typically happens when asking for a result that is not in the result file. To check which results are available and get their names, you can use
reader.ResultNames
.Hope this helps!
0