Blog ng Ambisyosong Manunulat...

Total Pageviews

Tuesday, April 1, 2014

Computing Area of a Polygon with Text Label

(defun c:car ( / o1 ipt opp parea)
(setq clyer(getvar"clayer"))
(command "layer" "m" "polyline boundary" "")
(command "layer" "c" "2" "polyline boundary" "")
(command "color" "bylayer")
(setq ipt (getpoint "\n Select Internal Point: "))
(command "-Boundary" ipt"" "")
(setq o1 (entlast))
(redraw o1 3)
(command "area" "O" "L")
(setq opp (getvar "area"))
(initget 1)
(setq parea(getpoint"\n where to put area text"))
(command "layer" "m" "area text" "")
(command "layer" "c" "81" "area text" "")
(command "color" "bylayer")
(initget 1)
(command "text" parea "1"0 (rtos opp 2 2))
(setq elast(entlast))
(command "scale" elast"" parea)
(setvar"clayer"clyer)

)

No comments:

Post a Comment