Attaching object data within LISP

Attaching object data within LISP

Anonymous
Not applicable
1,123 Views
3 Replies
Message 1 of 4

Attaching object data within LISP

Anonymous
Not applicable
I am writing a lisp routine that will attach data associated to a polygon to a point that I create. Unfortunately, AutoCAD will not allow me to use the "_ADEATTACHDATA" command within LISP. Is there an equivalent within LISP that anyone knows about? I have tried searching on the net, but i can only come up with a command to add a record to an existing table.

Phil
0 Likes
1,124 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Try 'ade_odaddrecord'. To get a description, from the AutoCAD Map Help menu,
choose Programming Interfaces, Visual lisp..., Interface Functions, Data
Extension Functions, then Object Data Functions.

as an example:

(setq atb_nm (ssname atb_ss 0); entity name
(setq atb_get (entget atb_nm)); get entity data
(setq atb_lyr (cdr (assoc 8 atb_get))); layer name
(if (= (ade_odgettables atb_nm) nil); if there is no table
(ade_odaddrecord atb_nm "NewTable")); attach table
(ade_odsetfield atb_nm "NewTable" "Layer" 0 atb_lyr); populate record


Eric Smallwood
"pj3768" wrote in message
news:f0a0285.-1@WebX.maYIadrTaRb...
> I am writing a lisp routine that will attach data associated to a polygon
to a point that I create. Unfortunately, AutoCAD will not allow me to use
the "_ADEATTACHDATA" command within LISP. Is there an equivalent within LISP
that anyone knows about? I have tried searching on the net, but i can only
come up with a command to add a record to an existing table.
> Phil
>
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks! I actually found the answer myself after about 2 hours of searching. I came back to post my findings, but you had already answered it. Thanks again.
Phil
0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi Phil,

 

Do you have an example code of how you are using it?  I'd like to grab all objects on a given layer and add a specific od table to it and even fill out some of the fields if possible.  I'm a newb at lisp so any help is appreciated.

 

Scott

0 Likes