@shijomon_josephBCZCE hi,
Here is my suggestion to think of 😀
create a layer (say call it "geo_layer") draw\trace using pline wall faces. set each pline with elevation (as wall height) use properties palette
warp the following program in calarea.lsp file than load it in your drawing.
run the lisp: CALAREA and select all plines (only on geo_layer) 'boom' you will get all areas.
you can control a few properties in code (starting from line# 32)
; define some constants
(setq GEOLAYER "geo_area") ; the layer the plines will be found , set it any color you like
(SETQ TARLAYER "text_area") ; the layer text (cal area) will be laid , set it any color you like
(SETQ TEXTSIZE 0.3) ; text height in meters
(setq TEXTOFSET 3) ; text offset factor
the program use the current text style, so make sure you set the right one.
enjoy
Moshe
;;; calarea.lsp
;;; by Moshe-A
;;; SEP 2025
(vl-load-com) ; load activex support
(defun c:calarea (/ cal_text_pos readable_text ; local functions
GEOLAYER TARLAYER TEXTSIZE TEXTOFSET
adoc layers modelSpace ss ename AcDbPLine plen hgt mpx mp0 mp1 p0 p1 p2 AcDbText)
(defun cal_text_pos (t0 t1 t2)
(polar t2 (+ (angle t0 t1) (* pi 0.5)) (* 0.3 3))
); cal_text_pos
(defun readable_text (t0 t1 / a0)
(setq a0 (angle t0 t1))
(if (and (> a0 (* pi 0.5)) (< a0 (* pi 1.5)))
(+ a0 pi)
a0
); if
); readable_text
; here start c:calarea
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(vla-startUndomark adoc)
(setq layers (vla-get-layers adoc))
(setq modelSpace (vla-get-modelspace adoc))
; define some constants
(setq GEOLAYER "geo_area") ; const
(SETQ TARLAYER "text_area") ; const
(SETQ TEXTSIZE 0.3) ; const
(setq TEXTOFSET 3) ; const
(if (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list layers TARLAYER))))
nil
(vla-add layers TARLAYER)
)
(if (setq ss (ssget (list '(0 . "lwpolyline") (cons '8 GEOLAYER))))
(foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(setq AcDbPLine (vlax-ename->vla-object ename))
(setq plen (vla-get-length AcDbPLine)) ; pline length
(setq hgt (vla-get-elevation AcDbPLine)) ; elevation
(setq mpx (* (vlax-curve-getEndParam ename) 0.5)) ; middle param
(setq mp0 (fix mpx))
(setq mp1 (1+ (fix mpx)))
(setq p0 (vlax-curve-getPointAtparam ename mp0))
(setq p1 (vlax-curve-getPointAtParam ename mp1))
(setq p2 (vlax-curve-getPointAtParam ename mpx))
(setq AcDbText (vla-addText modelSpace (strcat (rtos (* plen hgt)) "m" (chr 178)) (vlax-3d-point p2) 0.3))
(vla-put-rotation AcDbText (readable_text p0 p1))
(vla-put-alignment AcDbText acAlignmentMiddle)
(vla-put-textAlignmentPoint AcDbText (vlax-3d-point (cal_text_pos p0 p1 p2)))
(vla-put-layer AcDbText TARLAYER)
(vlax-release-object AcDbText)
(vlax-release-object AcDbPLine)
); foreach
); if
(vlax-release-object modelSpace)
(vlax-release-object layers)
(vla-endUndoMark adoc)
(vlax-release-object adoc)
(princ)
); c:calarea