AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

Reply
New Member
vatorres
Posts: 2
Registered: ‎12-12-2012
Message 1 of 4 (338 Views)
Accepted Solution

Problem with SSGET when filtering string content

338 Views, 3 Replies
12-12-2012 04:59 AM

Hi all,

I don;t know what the *** happen with this piece of code, I have checked it a million of times and seems to be well done. I'm trying to filter a previous selection and select Text or Mtext objects that are in the layer COTREF, and that contain the strings "%%c" AND "L" at the same time. The problem is that the code it's not selecting objects with the "L" included.

Here's the code:

 

(setq grupo1 (ssget "" '((0 . "TEXT,MTEXT")(8 . "COTREF")(-4 . "<AND")(1 . "*%%c*")(1 . "*L*")(-4 . "AND>"))))

 

The most unreasonable thing it's that I have 2 text objects exactly the same and when using this filter codes just one object it's selected (cyan cloud), check included DWG file.

 

Any idea ?????

I'v been searching abouit it and seems some persons are having problems with ssget filters in the newer versions of AutoCAD, I'm using 2012. I'm also suspecting fo the caracter "%" which could be working as a wild-card, but as far as I know it is not.

Thanks for any help about it.

This selects some:

(command "change" (ssget '((0 . "TEXT,MTEXT")(8 . "COTREF")(-4 . "<AND")(1 . "*%%c*")(1 . "*L*")(-4 . "AND>")))"" "p" "c" "1" "")

 

This selects the rest:

(command "change" (ssget '((0 . "TEXT,MTEXT")(8 . "COTREF")(-4 . "<AND")(1 . "*%%C*")(1 . "*L*")(-4 . "AND>")))"" "p" "c" "1" "")

 

Can you spot the difference?

*Expert Elite*
dbroad
Posts: 1,601
Registered: ‎08-16-2007
Message 2 of 4 (323 Views)

Re: Problem with SSGET when filtering string content

12-12-2012 10:55 AM in reply to: vatorres

This selects some:

(command "change" (ssget '((0 . "TEXT,MTEXT")(8 . "COTREF")(-4 . "<AND")(1 . "*%%c*")(1 . "*L*")(-4 . "AND>")))"" "p" "c" "1" "")

 

This selects the rest:

(command "change" (ssget '((0 . "TEXT,MTEXT")(8 . "COTREF")(-4 . "<AND")(1 . "*%%C*")(1 . "*L*")(-4 . "AND>")))"" "p" "c" "1" "")

 

Can you spot the difference?

New Member
vatorres
Posts: 2
Registered: ‎12-12-2012
Message 3 of 4 (314 Views)

Re: Problem with SSGET when filtering string content

12-13-2012 01:55 AM in reply to: dbroad

Man, you are a genious !!!!

Thanks so much for take your time and help me, so simple now that I understand it ...

Regards

*Expert Elite*
dbroad
Posts: 1,601
Registered: ‎08-16-2007
Message 4 of 4 (306 Views)

Re: Problem with SSGET when filtering string content

12-13-2012 06:51 AM in reply to: vatorres

You're welcome.  Be sure to mark the post that worked with "accept solution"

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.