• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD 2010/2011/2012 DWG Format

    Reply
    New Member
    Posts: 2
    Registered: ‎12-12-2012
    Accepted Solution

    Problem with SSGET when filtering string content

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

    Please use plain text.
    *Expert Elite*
    Posts: 848
    Registered: ‎08-16-2007

    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?

    Please use plain text.
    New Member
    Posts: 2
    Registered: ‎12-12-2012

    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

    Please use plain text.
    *Expert Elite*
    Posts: 848
    Registered: ‎08-16-2007

    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"

    Please use plain text.