Jump to content

Recommended Posts

Posted

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,

Posted

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.

Posted

Remember, (1 . "ABC") is case-sensitive.

Posted
Remember, (1 . "ABC") is case-sensitive.

Hello,

 

I wonder if there is any difference between yours and mine !!!!

 

Thanks.

Posted
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.

Posted
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.

Posted
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)

Posted
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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...