I HAVE A LISP(NOT MY CODE I DO NOT KNOW WHERE IT CAME FROM) THAT I WOULD LIKE TO USE FOR SQUARE FOOTAGE CALCULATIONS. THE ROUTINE RETRIEVES THE SQUARE FOOTAGE A THE PRINTS IT ON THE SCREEN AT A USER PICKED POINT. I WOULD LIKE THE ROUTINE TO PRINT "SQ. FT." AFTER THE SQARE FOOTAGE NUMBER. IT WILL DO THIS IF I ENTER IT AT THE PROMPT "ENTER THE TYPE OF UNITS. BELOW IS THE CODE.
;
(defun C:AC (/ #ENT #AA #CV #UN #PT #TXT #ECHO #OLDERR @NEWERR)
(defun @NEWERR (%A)
(setq *error* #OLDERR)
(setvar "cmdecho" #ECHO)
(cond
((= %A "Function cancelled") nil)
(T (princ (strcat "\nerror: " %A ":\n"))))
(princ))
(setq #OLDERR *error*)
(setq #ECHO (getvar "cmdecho"))
(setq *error* @NEWERR)
(setvar "cmdecho" 0)
(setq #ENT (car (entsel "\nPick an object for an area: ")))
(if #ENT
(if (member (cdr (assoc 0 (entget #ENT)))
(list "ELLIPSE" "CIRCLE" "LWPOLYLINE" "POLYLINE" "REGION"))
(progn
(command "_.area" "_o" #ENT)
(setq #AA (getvar "area")
#CV (getreal "\nEnter a conversion factor: <1.0> ")
#UN (getstring T "\nEnter the type of units: ")
#PT (getpoint "\nSpecify start point of text: "))
(if (not #CV)
(setq #CV 1.0))
(if (/= #UN "")
(setq #TXT (strcat (rtos (* #AA #CV)) " " #UN))
(setq #TXT (rtos (* #AA #CV))))
(entmake (list (cons 0 "TEXT")
(cons 10 #PT)
(cons 40 (getvar "TEXTSize"))
(cons 1 #TXT))))))
(setq *error* #OLDERR)
(setvar "cmdecho" #ECHO)
(princ))
(princ "\n\nType AC to start.")
(princ)
;
(defun C:AC (/ #ENT #AA #CV #UN #PT #TXT #ECHO #OLDERR @NEWERR)
(defun @NEWERR (%A)
(setq *error* #OLDERR)
(setvar "cmdecho" #ECHO)
(cond
((= %A "Function cancelled") nil)
(T (princ (strcat "\nerror: " %A ":\n"))))
(princ))
(setq #OLDERR *error*)
(setq #ECHO (getvar "cmdecho"))
(setq *error* @NEWERR)
(setvar "cmdecho" 0)
(setq #ENT (car (entsel "\nPick an object for an area: ")))
(if #ENT
(if (member (cdr (assoc 0 (entget #ENT)))
(list "ELLIPSE" "CIRCLE" "LWPOLYLINE" "POLYLINE" "REGION"))
(progn
(command "_.area" "_o" #ENT)
(setq #AA (getvar "area")
#CV (getreal "\nEnter a conversion factor: <1.0> ")
#UN (getstring T "\nEnter the type of units: ")
#PT (getpoint "\nSpecify start point of text: "))
(if (not #CV)
(setq #CV 1.0))
(if (/= #UN "")
(setq #TXT (strcat (rtos (* #AA #CV)) " " #UN))
(setq #TXT (rtos (* #AA #CV))))
(entmake (list (cons 0 "TEXT")
(cons 10 #PT)
(cons 40 (getvar "TEXTSize"))
(cons 1 #TXT))))))
(setq *error* #OLDERR)
(setvar "cmdecho" #ECHO)
(princ))
(princ "\n\nType AC to start.")
(princ)