Commandobill 发表于 2022-7-5 19:40:36

Easier way of doing this - Whi

Basically, while running my program I need to find out which segment of a polyline my point is on. I am using grread and vlax-curve-getclosestpointto to get my point.
 
My idea was to find the equation of the points in each segment and find out if that point lies on the line to identify which line segment, but I feel like there is an easier way.

Tharwat 发表于 2022-7-5 19:57:09

Hi,
 
The segment of the polyline would be between the two param numbers p1 and p2.
 

(setq p1 (fix (vlax-curve-getparamatpoint obj pt))   p2 (1+ p1)   )

Commandobill 发表于 2022-7-5 20:09:13

Thanks Thwart! I knew it was something simple.

Tharwat 发表于 2022-7-5 20:13:14

You should've payed more concern about writing my name correctly as best as I did when I gave you that "simple" thing as you have called it.

Commandobill 发表于 2022-7-5 20:20:51

 
My apologies, Tharwat, for the misspelling of your name. It happens to me all the time, so I should have used more caution.
 
As far as you being offended by my use of the word "simple": I should have used the terms "straight forward" or "less complicated" than what I was attempting to do, but I didn't realize you would take offence to it.

Tharwat 发表于 2022-7-5 20:36:35

No offense to the use of the word simple but you gave a bad meaning word in lieu of my name .

Commandobill 发表于 2022-7-5 20:41:02

Thwart does not have to be a bad thing. You can thwart evil plans.
 
What does your name mean? Is it an actual last name or is there something deeper behind it?
 
Again, I apologize for the changing of your name, especially after you saved me quite a bit of work.
页: [1]
查看完整版本: Easier way of doing this - Whi