get the first row of a path result
Drago
Member, Employee Posts: 17
✭✭✭
How I can get the first row of a path result. Supposed that the result is saved in stress, which is defined like this:
sol = Model.Analyses[0].Solution stress = sol.AddMaximumPrincipalStress() stress.ScopingMethod = GeometryDefineByType.Path
then I can access the data e.x with:
stress.PlotData.Values[3]
But the first three columns contain the coordinate, not what we see in Mechanical - the distances along the path. Thank you
Tagged:
0
Answers
-
import math x_coord = stress.PlotData.Values[0] y_coord = stress.PlotData.Values[1] z_coord = stress.PlotData.Values[2] x_diff = [x - x_coord[0] for x in x_coord] y_diff = [y - y_coord[0] for y in y_coord] z_diff = [z - z_coord[0] for z in z_coord] dist = [math.sqrt(x*x + y*y + z*z) for x,y,z in zip(x_diff,y_diff,z_diff)]
4