Michaels Posted August 8, 2010 Posted August 8, 2010 How can I look for a text by its contents ? The text is for example : abc The following code is not selecting the text .... why ? (sssetfirst nil (ssget "_x" '((0 . "TEXT,MTEXT")(1 . "ABC")))) Thanks, Quote
rkmcswain Posted August 8, 2010 Posted August 8, 2010 It works for me. Are you perhaps trying to select text/mtext that "contains" the string ABC? If so, look into using wildcards in your string comparison. Also the string comparison is case sensitive. Quote
Michaels Posted August 8, 2010 Author Posted August 8, 2010 Remember, (1 . "ABC") is case-sensitive. Hello, I wonder if there is any difference between yours and mine !!!! Thanks. Quote
Michaels Posted August 8, 2010 Author Posted August 8, 2010 It works for me. Are you perhaps trying to select text/mtext that "contains" the string ABC?If so, look into using wildcards in your string comparison. Also the string comparison is case sensitive. But it isn't working in my versions, Autocad 2011 and the old one Autocad 2009. Quote
alanjt Posted August 8, 2010 Posted August 8, 2010 Hello, I wonder if there is any difference between yours and mine !!!! Thanks. Meaning? Right now, your selection will only select Text and/or MText that includes the exact string of "ABC". While the 1 code in he filtering portion does randomly work, I find it's almost better to just make your selection and filter from there. Especially since MText can have multiple string codes, if it exceeds the designated amount. Quote
Michaels Posted August 8, 2010 Author Posted August 8, 2010 Meaning?Right now, your selection will only select Text and/or MText that includes the exact string of "ABC". This is exactly what I want, but the codes are not selecting the texts that are (abc) Quote
Lee Mac Posted August 8, 2010 Posted August 8, 2010 Bear in mind that "ABC" and "abc" are not the same thing. Quote
Michaels Posted August 8, 2010 Author Posted August 8, 2010 Bear in mind that "ABC" and "abc" are not the same thing. That's right, it should be like this ; (sssetfirst nil (ssget "_x" '((0 . "TEXT,MTEXT")(1 . "abc")))) Thanks Lee Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.