getting all the items from an xdata association list.

Discussion in 'AutoCAD' started by Nauman Myso, Dec 20, 2004.

  1. Nauman Myso

    Nauman Myso Guest

    I need to get all the 1005 information from the xdata that I pull from
    the object. I am having a hard time running it through assoc,
    and I even tried foreach-cdrs (someone posted it I forget who gets the
    credit) and it bombs as well on it. I would appreciate if someone can
    help me out . I think what bombs it is that what I get is not a TRUE
    doted pair list as the "AFM10" is not a dottect pair

    what I am looking for is a list with the handles from 1005.
    ("6B03D" "6B03E")

    thanks


    (setq xd (assoc -3 (entget ent2change (list "AFM10"))))

    (-3 ("AFM10" (1070 . 3) (1000 . "rm") (1002 . "{") (1000 . "03") (1000 .
    "02")
    (1000 . "2553") (1002 . "}") (1000 . "0302PL") (1000 . "58BB7") (1000 . "")
    (1010 824.184 -133.438 0.0) (1040 . 20.0) (1040 . 0.0) (1070 . 5) (1002
    .. "{")
    (1005 . "6B03D") (1005 . "6B03E") (1002 . "}")))


    (setq rr (cdr xd))
    (("AFM10" (1070 . 3) (1000 . "rm") (1002 . "{") (1000 . "03") (1000 . "02")
    (1000 . "2541AF") (1002 . "}") (1000 . "0302PL") (1000 . "58D17") (1000
    .. "")
    (1010 -3.69062 -42.0113 0.0) (1040 . 14.0) (1040 . 0.0) (1070 . 13) (1002 .
    "{") (1005 . "6B125") (1005 . "6B126") (1002 . "}")))

    Command: (foreach-cdrs 1005 rr)
    nil
     
    Nauman Myso, Dec 20, 2004
    #1
  2. Nauman Myso

    Jeff Mishler Guest

    You need a few more levels into the list:

    (setq rrr (cdr (car rr)))

    With the result from that you can use the foreach-cdrs.....
     
    Jeff Mishler, Dec 20, 2004
    #2
  3. Nauman Myso

    M_Dobek Guest

    try this:

    (setq exlist (assoc -3 (entgetent2change (list "AFM10"))))
    (setq thexdata (cdr (car (cdr exlist)))) ;tutaj lista znaków
    (setq e2 (vl-remove-if-not '(lambda (x) (= (car x) 1005)) thexdata))
    (setq lst (list) j 0) (repeat (length e2) (setq lst (append lst (list(cdr
    (nth j e2)))) j (+ 1 j)))
    lst


    Marcin Dobek
     
    M_Dobek, Dec 20, 2004
    #3
  4. Nauman Myso

    Nauman Myso Guest

    Thank you VERY MUCH!


     
    Nauman Myso, Dec 20, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.