BDYCAD发表于2004-5-15 8:21:00我在書上找到一個, 也是蠻不錯的哦. 給大火參考參考 呵呵(defun c:lsp_45() (setvar \"cmdecho\" 0) (setq pt (getpoint \"\n選取點:\")) (wh... 有点bug,当点中实体或非封闭区域,后面就不正常了。修改一下:- (defun c:aaa(/ oc occ enl pt en)
- (mapcar 'set '(oc occ) (mapcar 'getvar '("cmdecho" "cecolor")))
- (mapcar 'setvar '("cmdecho" "cecolor") '(0 "1"))
- (setq enl (entlast))
- (while (setq pt (getpoint "\n选点:"))
- (if (and (vl-cmdf "bpoly" pt "")(not(equal enl (setq en (entlast)))))
- (progn (command "area" "o" en)
- (alert (strcat "面积=" (rtos (getvar "area") 2)))
- (entdel en)
- )
- )
- )
- (mapcar 'setvar '("cmdecho" "cecolor") (list oc occ))
- (princ)
- )
|