全,全个鬼啊,你贴的代码,defun都没有!
这个也是我发的
算了,给你把
- (defun c:tt1(/ ent ent_get entdata kye n ptlst)
- (setq n 0 kye T)
- (while key
- (if (setq ent_get (ssget (list '(0 . "LWPOLYLINE") '(90 . 4) '(70 . 1))))
- (repeat (sslength ent_get)
- (setq ptlst nil entdata (entget (ssname ent_get n)))
- (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))))
- (setq n (+ n 1))
- )
- (progn
- (setq kye nil)
- (alert "选择错误,请选择封闭的四边形!")
- )
- )
-
- )
- (prin1)
- )
|