获取点程序:
- (defun c:getcorner( / pt ss ent ent_lst pt_corners)
- (setq pt (getpoint "点击区域:"))
- (command "_.boundary" "a" "o" "r" "" pt "")
- (command "_.explode" (entlast))
- (setq ss (ssget "_p" '((0 . "line"))))
- (if (not ss)
- (progn (princ "选择区域错误") (exit))
- )
- (command "pedit" (ssname ss 0) "y" "j" ss "" "")
- (setq ent (entlast))
- (setq ent_lst (entget ent))
- (while (setq pt (assoc 10 (cdr ent_lst)))
- (setq pt_corners (append pt_corners (list(cdr pt))))
- (setq ent_lst (member pt ent_lst))
- )
- pt_corners
- )
|