TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: curmudgeon on December 23, 2010, 12:08:21 AM

Title: add variable extended data
Post by: curmudgeon on December 23, 2010, 12:08:21 AM
all the way back to the autocad help files:
Code: [Select]
(setq exdata '((-3 ("NEWDATA" (1000 . "This is a new thing!")))))
(entmod (append (entget (entlast)) exdata) )

and
Code: [Select]
(entget (car (entsel)) '("NEWDATA"))does retrieve the stored data.

but the quote means the data added cannot have any statements which must be interpreted, I can't use
Code: [Select]
(cons 1000 "This is a new thing!")and have it fly.

without the quote, it interprets -3 or NEWDATA as a command and fails.
with the quote, I have not found a way to interpret the list so it can pass variables.

there is something simple I am missing.
 :cry:
Title: Re: add variable extended data
Post by: gile on December 23, 2010, 12:46:38 AM
Hi,

Code: [Select]
(list (list -3 (list "NEWDATA" (cons 1000 "This is a new thing"))))
Title: Re: add variable extended data
Post by: curmudgeon on December 23, 2010, 01:37:19 AM
Yes, thank you very much.