回复 露水2 的帖子
- ;;;坐标范围选择,有点类似(ssget "c" p1 p2 filter),但本函数在屏幕外的也可选择
- ;;;测试 (tt (getpoint) (getpoint) '((0 . "insert")))
- (defun tt (p1 p2 filter / minX minY maxX maxY)
- (setq minX (min (car p1) (car p2))
- minY (min (cadr p1) (cadr p2))
- maxX (max (car p1) (car p2))
- maxY (max (cadr p1) (cadr p2))
- )
- (if filter
- (ssget "x"
- (append (list '(-4 . "<and")
- '(-4 . ">=,>=,*")
- (list 10 minX minY 0)
- '(-4 . "<=,<=,*")
- (list 10 maxX maxY 0)
- )
- (append filter '((-4 . "and>")))
- )
- )
- (ssget "X"
- (list '(-4 . "<and")
- '(-4 . ">=,>=,*")
- (list 10 minX minY 0)
- '(-4 . "<=,<=,*")
- (list 10 maxX maxY 0)
- '(-4 . "and>")
- )
- )
- )
- )
|