How to obtain the location on the line
Akane Ito
Member Posts: 26
**
in Structures
I want to obtain the position of a point on a line where Y has an arbitrary value.
For example, I want to obtain the position of the point on the arc (the red dot) when Y equals 4.
Tagged:
0
Answers

Here is something crude to get you started:
edge = ExtAPI.SelectionManager.CurrentSelection.Entities[0] tolerance = .01 # 1% y_value = .01 points = [edge.Points[3*i:3*i+3] for i in range(int(len(edge.Points)/3))] ps = [p for p in points if p[1]>y_value*(1tolerance) and p[1]<y_value*(1+tolerance)]
To get more refined, I think you would want to find the two points closest to the Yline and then do an interpolation to get the intersection.
1