Results 1 to 7 of 7

Thread: Filtering by Xdata

  1. #1
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Filtering by Xdata

    I know that the following
    Code:
    (setq #filter (ssget "x" '((8. "defpoints"))))
    would add to my selection set everything on the defpoints layer

    I would like to do simular but searching for custom xdata of a certain value like
    '((-3 ("CUSTOM" (1000 . "CUSTOMVALUE"))))

    I thought the following might do the trick but it doesn't
    Code:
    (setq #filter (ssget "x" '((-3. "CUSTOMVALUE))))
    Can anyone explain to me where I missed the target?

    Thanks,
    Jason Self

  2. #2
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Filtering by Xdata

    Quote Originally Posted by JSelf.65472
    . . .I thought the following might do the trick but it doesn't
    Code:
    (setq #filter (ssget "x" '((-3. "CUSTOMVALUE))))
    Can anyone explain to me where I missed the target?

    Thanks,
    Jason Self
    Yes, you are missing characters marked in red
    Code:
    (setq #filter (ssget "x" '((-3. ("CUSTOMVALUE")))))
    : ) Happy Computing !

    kennet

  3. #3
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Filtering by Xdata

    THANK YOU KENNET!
    That makes me feel alot better about my understanding of using selection sets and entity data. the " was a typo but the ( ) I wasn't aware that I needed.

  4. #4
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Filtering by Xdata

    Ok, well that didn't seem to work out for me... I will try to clarify my situation, hopefully that will help.

    This is the entity I am wanting to be added to my selection set when I run my filter. I want it to grab this object based on the (-3 ("KEYKEEPER_INDEX" (1000. "KK0001"))) data.

    ((-1 . <Entity name: 7ed35150>) (0 . "INSERT") (330 . <Entity
    name: 7ed24cf8>) (5 . "C432") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8
    . "D-EL-POWR-T") (100 . "AcDbBlockReference") (66 . 1) (2 . "MIS3") (10
    -43540.6 33624.1 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71
    . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0) (-3 ("KEYKEEPER_INDEX" (1000 .
    "KK0001"))))

    Code:
     (ssget "x" '((-3. ("KK0001"))))
    gets me the error ; error: bad SSGET list

  5. #5
    I could stop if I wanted to jspartz's Avatar
    Join Date
    2015-12
    Posts
    361
    Login to Give a bone
    0

    Default Re: Filtering by Xdata

    It's not possible to search for a xdata value straight through the ssget function. You can only get the xdata app name through ssget, like so:

    Code:
    (setq ss (ssget "X" '((-3 ("KEYKEEPER_INDEX")))))
    There was someone who wrote a xdata value searcher a long time ago. It was on 4d-technologies.com, but they must have taken it down. It was called ssget_xd. I would write them for it if you really need it.

    You can also speed it up, but filtering for the type of object it is attached to, or layer. So, if your xdata is only attached to blocks, you can speed it up by only looking through blocks, like so:

    Code:
    (setq ss (ssget "X" '((0 . "INSERT") (-3 ("KEYKEEPER_INDEX")))))
    Last edited by jspartz; 2006-10-27 at 03:59 PM.

  6. #6
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Filtering by Xdata

    Quote Originally Posted by JSelf.65472
    . . .This is the entity I am wanting to be added to my selection set . . .
    Select all objects with ssget "_x" that belong to the application "KEYKEEPER_INDEX"
    then iterate trough them to find objects marked with "KK0001"
    and add those objects to your selectionset.

    : ) Happy Computing !

    kennet

  7. #7
    Woo! Hoo! my 1st post
    Join Date
    2014-11
    Posts
    1
    Login to Give a bone
    0

    Default Re: Filtering by Xdata

    Thanks jspartz! The code for ssget_xd is at

Similar Threads

  1. Replies: 6
    Last Post: 2015-08-31, 04:05 PM
  2. Help me with xdata
    By rdogomes in forum AutoLISP
    Replies: 13
    Last Post: 2010-09-16, 06:42 PM
  3. xdata
    By san_k4 in forum VBA/COM Interop
    Replies: 3
    Last Post: 2005-09-19, 10:29 PM
  4. xdata
    By fletch97 in forum AutoLISP
    Replies: 1
    Last Post: 2005-08-31, 05:52 PM
  5. Possible xdata?
    By whdjr in forum AutoLISP
    Replies: 7
    Last Post: 2004-08-25, 03:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •