tive29 Posted June 23, 2017 Posted June 23, 2017 Found this area lisp somewhere & did some minor edit. But there is a problem. if the area is example 0.11, the text ouput will be .11m2. Can some tell me what to amend to have it show as 0.11m2 thanks (defun drtxt (/ tx ls vl lt ht lb hb nr pt) (setq tx (strcat "";;;;add text between "";;;; (rtos (/ (getvar "area") 1000000) 2 2) "m²" ) ) (setq ls (list (cons 1 tx)) vl (textbox ls) vl (cadr vl) lt (car vl) ht (cadr vl) vl (grread T) nr (car vl) pt (cadr vl) ) (princ "\nInsert Point: ") (while (/= nr 3) (command "redraw") (grdraw pt (setq pt (polar pt 0 lt)) 7) (grdraw pt (setq pt (polar pt (* pi 0.5) ht)) 7) (grdraw pt (setq pt (polar pt pi lt)) 7) (grdraw pt (polar pt (* pi 1.5) ht) 7) (setq vl (grread T) nr (car vl) pt (cadr vl) ) ) ;end while function (command "-mtext" pt "w" 0 tx "") (redraw) ) ; end drtxt function (defun c:AA () (setvar "cmdecho" 0) (while (setq et (car (entsel "\nSelect polyline: ") ) ;end car function ) ;end setq function (command "area" "o" et) (drtxt) ) ; wnd while funtion (setvar "cmdecho" 1) (princ) ) ; end c:pla function Quote
rlx Posted June 23, 2017 Posted June 23, 2017 (defun drtxt (/ tx ls vl lt ht lb hb nr pt) (setq tx (strcat "";;;;add text between "";;;; (rtos (/ (getvar "area") 1000000) 2 2) "m²" ) ) (if (= (substr tx 1 1) ".")(setq tx (strcat "0" tx))) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.