Author Topic: Determine Y value of a point along a polyline with a known X value.  (Read 1440 times)

0 Members and 1 Guest are viewing this topic.

Eddie D.

  • Newt
  • Posts: 29
Using Autolisp, I need to determine the Y value of the coordinates of a point on a polyline where I already know the X value.
What I have is a list of X values and a "depth" associated with each. I want to locate a point on a polyline for each X value and insert a block at the "depth" below that point.
Does this make sense???

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Determine Y value of a point along a polyline with a known X value.
« Reply #1 on: June 12, 2009, 12:22:41 PM »
You can draw an xline, and then find the intersecting points with that and the polyline ( using the ActiveX method ' IntersectWith ' ), or you can use the ' inters ' lisp function, and test each polyline section to see if the two vertexes that define the section, and the two points along your x axis intersect.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Eddie D.

  • Newt
  • Posts: 29
Re: Determine Y value of a point along a polyline with a known X value.
« Reply #2 on: June 12, 2009, 12:46:38 PM »
Thanks! Tim.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Determine Y value of a point along a polyline with a known X value.
« Reply #3 on: June 12, 2009, 12:47:01 PM »
Nice method tim - I was wondering how this would be answered.

My first thought would have been to move along the line with vlax-get-PointatParam/Dist and find a point whose x-value was within a tolerance of the desired value. But I much prefer your method.

Lee

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Determine Y value of a point along a polyline with a known X value.
« Reply #4 on: June 12, 2009, 01:01:15 PM »
Glad you guys like.   :-D
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.