Hello all,
I wrote the code below and it works pretty well, the problem I am running into is that I have to switch my units to decimal and then switch the decimal place to "0" so that the text appears correctly. (notn feet and inches)
Is there a way within a lisp to tell ACAD to keep the units decimal and then once the command i sthrough go back to arch?
Thank you all in advance,
Andre
Code:
(defun c:cfm (/ currlay sqft inspt ocfmpersqft curros)
(command "undo" "begin")
(setvar "CMDECHO" 0)
(setq curros (getvar "osmode"))
(setvar "osmode" 64)
(if (not cfmpersqft) (setq cfmpersqft (+ 0 0)))
(setq ocfmpersqft cfmpersqft)
(setq cfmpreview (rtos ocfmpersqft))
(if
(= (setq cfmpersqft (getreal (strcat "\enter CFM per sq ft number: <" cfmpreview ">:"))) nil)
(setq cfmpersqft ocfmpersqft)
)
(setq currlay (getvar "Clayer"))
(setq sqft (getreal "\nenter room square foot: "))
(setvar "clayer" "M-QUCO-CHCK")
(command ".text" "j" "mc" pause "2.25" 0 (strcat (rtos (* sqft cfmpersqft))""))
(setq roomcfm (* sqft cfmpersqft))
(setvar "clayer" currlay)
(setvar "osmode" curros)
(command "undo" "end")
(setvar "CMDECHO" 1)
(princ (strcat roomcfm))
(princ))