Autolisp:利用AuoCAD之Lisp编程案例之自动智能获取所选对象的面积并标注在指定位置

Autolisp:利用AuoCAD之Lisp编程案例之自动智能获取所选对象的面积并标注在指定位置

 

目录

输出结果

实现代码


 

 

 

 

输出结果

Autolisp:利用AuoCAD之Lisp编程案例之自动智能获取所选对象的面积并标注在指定位置

 

 

实现代码

;; write area value of a close polygon to drawing
(DEFUN C:EA(/ OLDOS PT STA QAREA)
;;
  (setq olderr *error*)
  (setq *error* myerr)
  (SETVAR "CMDECHO" 0)
  (SETQ OLDOS (GETVAR "OSMODE"))
;;
  (SETVAR "OSMODE" 0)
  (SETQ STA (CAR (ENTSEL)))
  (COMMAND "AREA" "E" STA)
  (SETQ QAREA (RTOS (GETVAR "AREA") 2 2))
  (SETQ PT (GETPOINT"\nPick the point you want to write area:"))
  (COMMAND "TEXT" PT "" "" QAREA)
;;  
  (SETVAR "OSMODE" OLDOS)
  (SETVAR "CMDECHO" 1)
  (setq *error* olderr)
  (PRINC)
)

 

上一篇:CF451E Devu and Flowers


下一篇:Charpter 1 Introduction