Here is updated version
Point of text insertion is the one you pick inside bounding elements.
Text height is replaced with textsize variable.
I would stay with creation of temporary boundary element. There is option with pedit but it don't assure to collect and join all selected entities. Command join is also an option (better) but it modifies first entity in a set and don't create new entity. This seams to me is the fastest version.
Final area text string can be modified using autolisp strcat function with variable a that holds area string.
(defun c:cvol (/ *error* pt h a th)
(defun *error* ( msg )
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ)
)
(setvar 'cmdecho 1)
(princ)
)
(setvar 'cmdecho 0)
(setq th (getvar 'textsize))
(while (setq pt(getpoint "\nPick a point inside bounding elements >"))
(command "_.bpoly" pt "")
(setq
h (getreal "\nMold height >")
a (rtos(* h (vlax-get(vlax-ename->vla-object (entlast)) 'Area))2 2)
)
(entdel (entlast))
(entmake
(list
(cons 0 "TEXT")
(cons 10 pt)
(cons 40 th)
(cons 1 a)
)
)
)
(setvar 'cmdecho 1)
(princ)
)
Miljenko Hatlak

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.