I don't understand LISP enough to write my own Code, but I have cut and copied and altered existing code to perform to my liking. I came across a LISP that I wanted to better meet our needs at the office. I would like this LISP to Select the Upper Slope Point, the Lower Slope Point, stretch the line to both points, and draw the Solid Triangle aligned with the line. The text above should be user input of slope ratio (i.e. 4:1). The variable "usserr1" is set by our Company Script routines that run a drawing setup for varying scales (i.e. 30, 40, 50 scales). Any assistance or just a push in the right direction as always is much appreciated.
Dan
;;
;; SI - slope indicator symbol for ponds and such
;;
(defun rtd (a)
(* (/ a 3.14159) 180)
)
(defun c:si3 (/ osm tst cmd sz pt1 pt2 pt3 ang ang2 sht ratio)
(setq osm (getvar "osmode"))
(setq tst (getvar "textstyle"))
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq sz (getvar "userr1")
(setq ratio (getstring "\nEnter Slope (4:1): "))
(setq pt1 0)
(while (/= pt1 nil)
(setq pt1 (getpoint "\nPick UPPER Slope: "))
(if (/= pt1 nil)
(progn
(setq pt2 (getpoint pt1 "\nPick LOWER Slope: "))
(setvar "osmode" 0)
(setq ang (angle pt1 pt2))
(command "solid" (polar pt1 (+ ang (/ pi 2.0)) (* 0.045 sz))
(polar pt1 (+ ang (+ pi (/ pi 2.0))) (* 0.045 sz))
(polar pt1 ang (* 0.09 sz)) "" "")
(setq pt3 (list (car pt2)(cadr pt1)))
(setq ang2 (angle pt1 pt3))
(command "pline" pt1 "w" "0" "" pt2 "")
(setq sht (cdr (assoc 40 (tblsearch "style" tst))))
(if (<= sht 0)
(if (> ang2 0)
(command "text" "j" "bc" (polar pt1 ang (/ (distance pt1 pt2) 2)) (getvar "textsize") (rtd (+ pi ang)) ratio)
(command "text" "j" "bc" (polar pt1 ang (/ (distance pt1 pt2) 2)) (getvar "textsize") (rtd ang) ratio)
)
(if (> ang2 0)
(command "text" "j" "bc" (polar pt1 ang (/ (distance pt1 pt2) 2)) (rtd (+ pi ang)) ratio)
(command "text" "j" "bc" (polar pt1 ang (/ (distance pt1 pt2) 2)) (rtd ang) ratio)
)
)
)
)
)
(setvar "cmdecho" cmd)
(setvar "osmode" osm)
(PRINC)
)
Sorry Dan, had to change your text. I couldn't read in green. Daron