@AlexKDJ24 wrote:
I would be very grateful if you could assist with a Lisp routine,
Attached a first rough draft of a LISP (after loading the .lsp file start with SLOPE).
Obviously you calculate the X in the slope 1:X with horizontal distance divided by the vertical distance of the both points. I'd do it reciprocal - vertical distance divided by the horizontal distance. But that's your choice. You only need to change the line
slope_num (/ delta_xy delta_z)
to
slope_num (/ delta_z delta_xy)
(and choose an appropriate number of decimals
slope_str (rtos slope_num 2 0)
change to
slope_str (rtos slope_num 2 3).
Of course you can (should) refine this draft to your needs.
(defun c:slope (/)
(setq p1 (getpoint "\nFirst point: ")
p2 (getpoint "\nSecond point: ")
p2_ (list (car p2) (cadr p2) (caddr p1))
delta_z (- (caddr p2) (caddr p1))
delta_xy (distance p1 p2_)
angle_xy (angle p1 p2_)
halfway (polar p1 angle_xy (/ delta_xy 2))
slope_num (/ delta_xy delta_z)
slope_str (rtos slope_num 2 0)
slope_txt (strcat "1:" slope_str)
)
(command "text"
"_J"
"_BC"
halfway
3.5
(/ (* 180 angle_xy) PI)
slope_txt
)
(princ)
)
Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
