ssget 是选择集 后面代码也是选择集的写法 我觉得你是想象之前那样 单个的绘制
- (defun c:cdc (/ ff lst lst1 lst2 p pt_xy str ty)
- (defun pt_xy (e / s)
- (if (setq s
- (mapcar 'cdr
- (vl-remove-if-not '(lambda (x) (= (car x) 10))(entget e))
- )
- )
- (if (= 1 (length s))(car s)s)
- )
- )
- (defun ff(lst)
- (entmakex (append (list '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbPolyline")
- '(62 . 256)
- (cons 90 (length lst))
- (cons 70 0)
- )
- (mapcar '(lambda (pt) (cons 10 pt)) lst)
- )
- )
- )
- (setq str "1000X1000")
- (setq p (getpoint "\n插入点"))
- (command "_.Rectang" "non" p "non" (strcat "@" (vl-string-translate "X" "," str)))
- (setq ty (entlast))
- (command "rotate" ty "" p)
- (command pause)
- (setq lst(pt_xy ty))
- (setq lst1(list(car lst ) (caddr lst )))
- (setq lst2(list(cadr lst )(cadddr lst )))
- (ff lst1)
- (ff lst2)
- (princ)
- )
|