View Full Version : TO FILTER TEXT
jitesh789
2007-10-21, 06:40 AM
HI
I HAVE TRIED TO FILTER TEXT I WANT TO FILTER STRING VALUES AND NUMERICAL VALUES FROM THE SAME LAYER CAN ANY ONE HELP
'gile'
2007-10-21, 11:18 AM
Hi,
You can use this, but it is case sensitive.
(setq ss (ssget "_X"
(list '(0 . "*TEXT")
(cons 8 layer_name)
'(-4 . "<OR")
(cons 1 text_string_1)
(cons 1 text_string_2)
(-4 . "OR>")
)
)
)
If you want your code not to be case sensitive, you have to scan all selection set using strcase :
(setq ss (ssget "_X"
(list '(0 . "*TEXT")
(cons 8 layer_name)
)
)
)
(setq n 0)
(while (setq txt (ssname ss n))
(if (and (/= (strcase (cdr (assoc 1 (entget txt))))
(strcase text_string_1)
)
(/= (strcase (cdr (assoc 1 (entget txt))))
(strcase text_string_1)
)
)
(ssdel txt ss)
)
(setq n (1+ n))
)
ron_09812001
2007-10-21, 03:49 PM
hi, you may issue the find command, then select all the text which is your selection set, then type the string you are looking for, then press "enter" once, and when youve done that, the "select all" button will not be grayed out anymore, so you can use it. it will select all the text entities with your string even its on the same layer.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.