@k_ngo-quoc wrote:
Thanks for transforming in m². But it missed the second click (%).
Thanks in advance for your help.
Sorry about that, misunderstanding. I got it back.
; **** LEADER VERSION **** ; + CONVERSION MM TO M
(vl-load-com)
(defun c:LabelAreaPercM ( / dst ang obj sel obj aro ari pnt)
(and (setq dst 1500.00
ang 0.79)
(vl-cmdf "_.-DIMSTYLE" "_Restore" "Test")
(setq sel (nentsel "\nSelect outer area: "))
(setq obj (vlax-ename->vla-object (car sel)))
(or (not (vl-catch-all-error-p (setq aro (vl-catch-all-apply 'vla-get-area (list obj)))))
(prompt "\nWrong selection. Area property is not available!"))
(vl-cmdf "_.LEADER"
"_none" (setq pnt (osnap (cadr sel) "_nea"))
"_none" (polar pnt ang dst)
"_none" "@550,0"
""
(strcat (rtos (/ aro 1000000) 2 1) "m2")
"")
(while (setq sel (nentsel "\nSelect inner area: "))
(and (setq obj (vlax-ename->vla-object (car sel)))
(or (not (vl-catch-all-error-p (setq ari (vl-catch-all-apply 'vla-get-area (list obj)))))
(prompt "\nWrong selection. Area property is not available!"))
(vl-cmdf "_.LEADER"
"_none" (setq pnt (osnap (cadr sel) "_nea"))
"_none" (polar pnt ang dst)
"_none" "@550,0"
""
(strcat (rtos (/ ari 1000000) 2 1) "m2 - " (rtos (* 100 (/ ari aro)) 2 0) "%")
""))))
(princ)
)