AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

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

Problem with SSGET when filtering string content

376 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,647
Registered: ‎08-16-2007
Message 2 of 4 (361 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 (352 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,647
Registered: ‎08-16-2007
Message 4 of 4 (344 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
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.