写得很罗嗦,请包涵- (vl-load-com)
- (defun c:test1 (/ ss lst lst1 x y a b)
- (setq ss (ssget '((0 . "lwpolyline"))))
- (defun ss->lst (ss / n lst)
- (repeat (setq N (sslength ss))
- (setq LST (cons (ssname SS (setq N (1- N))) LST))
- )
- )
- (setq lst (ss->lst ss)
- lst1 (mapcar '(lambda (x)
- (mapcar 'cdr
- (vl-remove-if-not
- '(lambda (y) (= 10 (car y)))
- (entget x)
- )
- )
- )
- lst
- )
- )
- (mapcar '(lambda (x y)
- (if (wcmatch (apply 'strcat x) "*挖方*")
- (vla-put-color y 1)
- )
- )
- (mapcar '(lambda (a)
- (mapcar '(lambda (b) (cdr (assoc 1 (entget b))))
- (ss->lst (ssget "cp" a '((0 . "text"))))
- )
- )
- lst1
- )
- (mapcar 'vlax-ename->vla-object lst)
- )
- )
|