lisp for calculating vertical distance between lines
lisp for calculating vertical distance between lines
(OP)
Hi,
I have to calculate the vertical distance between two lines or plines and account for ranges (0-2, 2-4, 4-6, etc). Is there a way to do this in lsp?
Thanks,
Roberttx
I have to calculate the vertical distance between two lines or plines and account for ranges (0-2, 2-4, 4-6, etc). Is there a way to do this in lsp?
Thanks,
Roberttx





RE: lisp for calculating vertical distance between lines
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: lisp for calculating vertical distance between lines
These lines are not parell, are somehow horizontal. I have to calculate the difference in vertical profile for ground elevation and proposed sewer line, but both changes in slope and the calculation is depths of 0-2 feet, 2-4 feet and so on. We used to do it manually for few lines, but it's cumbersome with dozens of lines. Any pointers?
Thank you,
Roberttx
RE: lisp for calculating vertical distance between lines
it gives you the :
Distance, Angle in XY Plane, Angle from XY Plane
Delta X, Delta Y, & Delta Z
RE: lisp for calculating vertical distance between lines
(defun GetVertDist
(/ DIST END LINL PT1 PT1X PT1Y PT2Y PTA PTB PTC PTD START)
(setq PT1 (getpoint "\nSelect Point On First Line:")
PT1X (car PT1)
PT1Y (cadr PT1)
PTA (list PT1X 0.0)
PTB (list PT1X 1.0)
)
(while (not (setq LIN2 (entsel "\nSelect Second Line:"))))
(setq LINL (entget (car LIN2))
START (assoc 10 LINL)
END (assoc 11 LINL)
PTC (list (cadr START) (caddr START))
PTD (list (cadr END) (caddr END))
)
(setq PT2Y (cadr (inters PTA PTB PTC PTD nil))
DIST (rtos (abs (- PT1Y PT2Y)) 2 3)
)
(prompt (strcat "\nVertical Distance: " DIST)
)
)
"Everybody is ignorant, only on different subjects." — Will Rogers