Dear Lee and other veterans,
I have an AUTOCAD drawing which contains thousands of contours in "CONTOURLINES" layer. All the vertices of each contour line are equal to the elevation of that particular contour.
Also, there are many polylines (each depicting a drain) in "DRAIN" layer. Note that all the vertices of these polylines have same elevation.
I want to find out the profile of each drain polyline by its intersection with various contours.
Going by Lee's method in which for each segment of each drain, all the segments of each contour are processed and a new list of intersection points is created. I have accomplished this code but this code takes lot of time.
Number of calculations = (sum of total number of line segments in all contour polylines) x (sum of total number of line segments in all drain polylines)
I have found a QUICKPROFILE routine on internet (
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=113&lngWId=13) in which each of the contour polylines are first modified (by ENTMOD) to the elevation of the current "drain" polyline and then the intersection points are found (using (vlax-invoke-method 'IntersectWith")) and the elevation of contour polyline is reversed back.
This method works very fast as compared to Lee's method.
My both above methods are working fine but I want to ask why is the QUICKPROFILE method so fast as compared to Lee's code ?