Where do I incorporate this routine:
(defun c:DTBL_SIMPLEX60 ( / inspnt txtht)
(command "-style"
"simplex0" ; name of text style
"simplex" ; font name
"0" ; height of text
"1" ; width factor
"0" ; obliquing angle
"" ; text backwards
"" ; text upside-down
)
(while (> (getvar "CMDACTIVE") 0)(command "")) ; Vertical
(prompt "\nCurrent Style set to Simplex ")
(setq inspnt (getpoint"\nPick point for text: "))
(setq txtht (* 0.06 (getvar "dimscale")))
(command "dtext"
inspnt
txtht
)
(princ)
)
into this routine:
(defun c:inv (/ elev run slope ang end_elev conv oldsnap clay)
(defun get_num (/ num elst ent)
(while
(not (cond ((setq num
(getreal
"\n*** Enter a starting elevation: <Enter to pick text>"
)
)
num
)
((setq ent
(entsel
"\n>>--> Select starting elevation: <Enter to type number>"
)
)
(setq elst (entget (car ent)))
(if (wcmatch (cdr (assoc 0 elst)) "*TEXT")
(if (> (setq num (atof (cdr (assoc 1 elst)))) 0)
num
)
)
)
)
)
)
num
)
;;;
(defun getx (object prop)
(if (= (type object) 'ename)
(setq object (vlax-ename->vla-object object))
)
(vlax-get object prop)
)
;;;
(defun entlen (obj)
(if (= (type obj) 'ename)
(setq obj (vlax-ename->vla-object obj))
)
(vlax-curve-getdistatparam obj (vlax-curve-getendparam obj))
)
;;;
(defun Radian->Degrees (nbrOfRadians) (* 180.0 (/ nbrOfRadians pi)))
;;;
(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq oldsnap (getvar "osmode"))
(setq clay (getvar "clayer"))
(setq elev (get_num))
(prompt "\nSelect point: ")
(setvar "osmode" 0)
(setvar "osmode" 545)
(command "_.pline")
(while (> (getvar "cmdactive") 0) (command pause))
(setq run (entlen (entlast)))
(initget 1)
(setq slope (getreal "\nEnter slope (in percentage): "))
(initget 1)
(setq ang (Radian->Degrees (getangle "\nPick text angle: ")))
(prompt "\nSelect insertion point of slope text: ")
(if (> (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))) 0)
(command "_text" "j" "bc" pause ang (strcat (rtos slope 2 2) "%"))
(command "_text"
"j"
"bc"
pause
""
ang
(strcat (rtos slope 2 2) "%")
)
)
(setq conv (/ slope 100))
(setq end_elev (+ (* conv run) elev))
(setq ang (Radian->Degrees (getangle "\nPick text angle: ")))
(prompt "\nSelect insertion point of Elev: ")
(if (> (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))) 0)
(command "_text" "j" "Tc" pause ang (strcat (rtos end_elev 2 2)))
(command "_text"
"j"
"Tc"
pause
""
ang
(strcat (rtos end_elev 2 2))
)
)
(setvar "CMDECHO" usercmd)
(setvar "osmode" oldsnap)
(princ)
)
(prompt "nInvert Loaded, enter INV to run.")
(princ)