本帖最后由 fangmin723 于 2017-8-31 16:44 编辑
- (defun c:tt(/ ent entdata ptlst)
- (if (and (= "LWPOLYLINE" (cdr (assoc 0 (setq entdata (entget (setq ent (car (entsel)))))))) (= 4 (cdr (assoc 90 entdata))) (= 1 (cdr (assoc 70 entdata))))
- (progn
- (setq ptlst nil)
- (foreach x entdata
- (if (= (car x) 10) (setq ptlst (cons (cdr x) ptlst)))
- )
- (setq ptlst (reverse ptlst))
- (entmake (list '(0 . "LINE") (cons 10 (car ptlst)) (cons 11 (caddr ptlst))))
- (entmake (list '(0 . "LINE") (cons 10 (cadr ptlst)) (cons 11 (cadddr ptlst))))
- )
- (alert "选择错误,请选择封闭的四边形!")
- )
- (prin1)
- )
|