Guest
|
Posted:
Thu Mar 24, 2005 6:28 pm Post subject:
Running Mile (desperate for help) |
|
|
This may be a long shot, and difficult to explain, but:
Our company needs to count houses, buldings, etc. along a pipeline
route within an autocad drawing. This count will be the first mile of
pipe and a 660' offset each side of the pipeline. Then, continue to
count, moving down the pipeline every 10' feet or so. The main problem
is that the pipe is never a straight polyline and the total need to go
into a spreadsheet (excel). I believe I have Excel part figured out.
But the running mile count thing is killing me. Does anyone have any
idea how to write a VBA program to do this? Or do you think it may be
a mixture of VBA and Autolisp?
Thank you so much for any help you have.
Todd
|
|
Tim Arheit
Guest
|
Posted:
Fri Mar 25, 2005 7:14 pm Post subject:
Re: Running Mile (desperate for help) |
|
|
On 24 Mar 2005 05:28:57 -0800, tpc@heathweb.com wrote:
| Quote: | This may be a long shot, and difficult to explain, but:
Our company needs to count houses, buldings, etc. along a pipeline
route within an autocad drawing. This count will be the first mile of
pipe and a 660' offset each side of the pipeline. Then, continue to
count, moving down the pipeline every 10' feet or so. The main problem
is that the pipe is never a straight polyline and the total need to go
into a spreadsheet (excel). I believe I have Excel part figured out.
But the running mile count thing is killing me. Does anyone have any
idea how to write a VBA program to do this? Or do you think it may be
a mixture of VBA and Autolisp?
Thank you so much for any help you have.
Todd
|
First calculate the station and offset of each house (ie.the distance
along the polyline, and the distance right or left of the polyline).
Sort the list of houses by their station and offset and the running
count should be pretty easy.
Calculating the station/offset is the difficult part. You'll need to
use an algorithm that will calculate the perpendicular distance from a
point to a line, and the distance along the line. Then using that
algorithm check each segment of the polyline representing your
pipeline and select the segment the point is closest to and use the
distance along the polyline up to that point as the station.
You should then have station, offset pairs after sorting might look
like:
100, -500
300, 200
350, -260
1000, 600
1200, -200
etc...
(positive offsets being to the right of the pipeline, negative being
to the left)
From this list is pretty simple to calculate how many houses are in
the first 600 feet, etc.
-Tim |
|