- UID
- 110608
- 积分
- 328
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-3-7
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
;_2005.06.06.12.26_______________________
;_选择过滤器__作者wkai改进BY__wujimmy_Lin.TY________
;_在选择物体时,可以通过透明方式('ss)调用
(defun c:ss (/ filter e p myss)
(while (not e)
(princ "\n样板物体::")
(setq e (car (entsel)))
)
(print (setq e (entget e)))
(setq p (getstring "\n选择过滤组码(可以多选,间隔以逗号):"))
(princ (convert_string_to_int_lst_ss p))
(if p
(foreach n (convert_string_to_int_lst_ss p)
(if (assoc n e)
(setq filter (append filter (list (cons n (cdr (assoc n e))))))
(princ (strcat "\n"(itoa n)"为无效组码,没有进入过滤器。"))
)
)
)
(if filter
(progn
(princ "\n通过过滤器")
(princ filter)
(princ "选择物体")
(setq myss (ssget filter))
;;;这里是改进的地方,根据filter改进的,可以在没有执行命今的时候,高亮选择集
(if (/= "" (getvar "cmdnames"))
myss
(progn
(if (and (equal (getvar "pickfirst") 1)
myss
(equal 'PICKSET (type myss))
) ;and
(sssetfirst myss myss)
) ;if
(princ)
;;;shhhhh
) ;progn else
)
)
)
)
;________________________________________________________
(defun convert_string_to_int_lst_ss (str / lst n s1 cha)
(setq s1 ""
n 0
)
(repeat (strlen str)
(setq cha (substr str (setq n (1+ n)) 1))
(if (= "," cha)
(setq lst (append lst (list (atoi s1)))
s1 ""
)
(setq s1 (strcat s1 cha))
)
)
(setq lst (append lst (list (atoi s1))))
) |
|