下午的Cadders,
我想在过滤层时忽略字母,只过滤包含某些数字的层,即层名称:grid510,只按数字510过滤,而不是按整个层名称过滤。欢迎任何建议!!
这是我目前用来过滤我的图层的代码,这是Lee Mack从之前发布的问题中提供的。
- (defun test ( / ss ) (vl-load-com)
- (if (setq ss (ssget (setq l '((8 . "ti grid re510,ti grid re520,ti grid re540,ti grid re560,ti grid re570,ti grid re580,ti grid tx150,ti grid type 1,ti grid type 2,ti grid type 3,ti grid type 4")))))
- (
- (lambda ( l / i e sym )
- (repeat (setq i (sslength ss))
- (ssadd (setq e (ssname ss (setq i (1- i))))
- (cond
- (
- (eval
- (setq sym
- (read
- (strcat "ss"
- (
- (lambda ( j )
- (vl-some
- (function
- (lambda ( x ) (setq j (1+ j))
- (if (wcmatch (strcase (cdr (assoc 8 (entget e)))) (strcase x))
- (itoa j)
- )
- )
- )
- l
- )
- )
- 0
- )
- )
- )
- )
- )
- )
- ( (set sym (ssadd)) )
- )
- )
- )
- )
- (LM:str->lst (cdar l) ",")
- )
- )
- )
|