getting all the items from an xdata association list.
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
getting all the items from an xdata association list.

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Nauman Myso
Guest





Posted: Mon Dec 20, 2004 10:09 pm    Post subject: getting all the items from an xdata association list. Reply with quote

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

Back to top
Jeff Mishler
Guest





Posted: Mon Dec 20, 2004 10:42 pm    Post subject: Re: getting all the items from an xdata association list. Reply with quote

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
check out www.cadvault.com
"Nauman Myso" <cadologist.NOSP@NOSPcadbazaar.NOSP.com> wrote in message
news:41c70746$1_1@newsprd01...
Quote:


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



Back to top
M_Dobek
Guest





Posted: Mon Dec 20, 2004 10:58 pm    Post subject: Re: getting all the items from an xdata association list. Reply with quote

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

Uzytkownik "Nauman Myso" <cadologist.NOSP@NOSPcadbazaar.NOSP.com> napisal w
wiadomosci news:41c70746$1_1@newsprd01...
Quote:


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





Back to top
Nauman Myso
Guest





Posted: Mon Dec 20, 2004 11:23 pm    Post subject: Re: getting all the items from an xdata association list. Reply with quote

Thank you VERY MUCH!


M_Dobek wrote:

Quote:
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

Uzytkownik "Nauman Myso" <cadologist.NOSP@NOSPcadbazaar.NOSP.com> napisal w
wiadomosci news:41c70746$1_1@newsprd01...


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






Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB