(defun C:slope ()
(setvar "OSMODE" 35)
(setq sel1 (getpoint "\n Select the first point: "))
(setq sel2 (getpoint "\n Select the next point: "))
(setq sel1x (car sel1))
(setq sel1y (cadr sel1))
(setq sel2x (car sel2))
(setq sel2y (cadr sel2))
(setq supl (* 100 (abs (/ (- sel1y sel2y) (- sel1x sel2x)))))
(setq supl (strcat (rtos supl 2 2) "%"))
(setvar "OSMODE" 0)
(setq txl (getpoint "\n Specify text insertion point: "))
(setq txangl (* (/ 180 pi) (atan (/ (- sel1y sel2y) (- sel1x sel2x)))))
(command "style" "arial" "arial.ttf" 0 "" "" "" "" "")
(command "text" "s" "arial" "c" txl 25.0 txangl supl)
(setq const (* (/ (abs (- sel1x sel2x)) (- sel1x sel2x)) (/ (abs (- sel1y sel2y)) (- sel1y sel2y))))
(command "leader" (list 0 0) (list (* const 2.2) 0) "" "" "n")
(setq leaxy (list (car txl) (- (cadr txl) 0.2)))
(command "move" "l" "" (list (* const 1.1) 0) leaxy)
(command "rotate" "l" "" leaxy txangl)
(command "osmode" 35)
(princ))
