;;区域面积
(defun c:AreaOfBoundary	(/ la pt reg)
  (cond	((setq pt (getpoint "\n选取区域内部一点:"))
	 (setq la (entlast))
	 (vl-cmdf ".BOUNDARY" "A" "O" "R" "" "NON" pt "")
	 (setq reg (entlast))
	 (if (equal la reg)
	   (princ "\n没有找封闭区域,程序退出....")
	   (progn
	     (command "._area" "o" reg)
	     (princ "\n所选区域面积为：")
	     (princ (rtos (getvar "area")))
	     (redraw reg 3)
	     (if (setq pt (getpoint "\n标记位置："))
	       (entmake	(list
			  (cons 0 "TEXT") ;实体类型
			  (cons 10 pt)	;插入位置
			  (cons 40 (getvar "textsize")) ;文字高度
			  (cons 1 (rtos (getvar "area"))) ;文字内容
			  (cons 7 (getvar "textstyle")) ;文字样式
			)
	       )
	     )
	     (entdel reg)
	   )
	 )
	)
  )
  (princ)
)