;===========================================================; ; ; ; HowHi.LSP by Michael Bulatovich, Feb.1, 2003 ; ; www.michaelbulatovich.ca ; ; ; ; A routine that uses leaders to label the elevation ; ; of points relative to the Y-axis of the current UCS. ; ; Uses the current dimstyle. Has variable accuracy, ; ; and some unit conversion capability. ; ; ; ;===========================================================; (defun c:howhi (/ hh-dwgunits) (defun hh-prompt (/ hh-reset) (if (not hh-acc)(setq hh-acc 0)) (initget "Change") (setq hh-reset (getkword (strcat "\nCurrent accuracy set to " (itoa hh-acc) " decimal places, and units are set to " hh-units ".\nDo you want to change settings? Change/:"))) (if (eq hh-reset "Change")(hh-settings)(hh-label)) );end defun (defun hh-settings (/ ) (initget 4) (if (not hh-acc)(setq hh-acc 0)) (setq temp-acc (getint(strcat "Set accuracy for height labels between 0 and 8 decimal places.<" (itoa hh-acc) ">:")) hh-flag T) (if temp-acc (setq hh-acc temp-acc)) (initget "Meters Feet Raw") (if (not hh-units)(setq hh-units "Raw")) (setq temp-units (getkword (strcat "Label elevations in [M]eters from millimeters, Decimal-[F]eet from Feet and Inches, or [R]aw units.<" hh-units ">:")) hh-dwgunits (getvar "lunits")) (if temp-units (setq hh-units temp-units)) (setq hh-factor (cond ((eq hh-units "Feet") 12) ((eq hh-units "Meters") 1000) ((eq hh-units "Raw") nil))) (hh-label) );end defun (defun hh-label (/ pt ht) (setq pt (getpoint "Pick point to label:")) (if hh-factor (setq ht (rtos (/ (cadr pt) hh-factor) 2 hh-acc)) (setq ht (rtos (cadr pt)))) (cond ((eq hh-factor 12)(setq ht(strcat ht "'"))) ((eq hh-factor 1000)(setq ht(strcat ht "m"))) ) (command "leader" pt pause "" ht "" "") );end defun (if (not hh-flag)(hh-settings)(hh-prompt)) (princ))