Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
petervose
Posts: 309
Registered: ‎10-02-2003
Message 1 of 3 (1,182 Views)
Accepted Solution

Getting Object Data from an Entity..

1182 Views, 2 Replies
10-15-2010 01:21 AM

Having Managed to Create Additional Object Data Fields (using ADEATTACHDATA>Define>NewTable), and populating those resulting attributes in the Properties Table, I am now struggling to retieve those values back out into a lisp variable.  In my Properties list, I can now see a new set of Attributes and data under the heading 'OD:GIS_OBJECT_DATA', which is fully populated with loads of good info (see jpg attachment), but try as I might I can't work out how to get my hands on it (programatically).  The only difference I can see between an element that has the additional data is that the 'hasextensiondictionary' property is set at '-1' for the populate entities, and '0' for the non-populated entities.  I've tried things like (vlax-get-property (vla-item (vla-getextensiondictionary (vlax-ename->vla-object (car (entsel)))) 0)), but, being a vlisp novice, I just can't seem to grasp how to drive down into this additional object data and get the values out.  If anyone can assist that'd be great

(Using Acad Map 3D 2011)

Great!! - That was exactly the pointer I needed. Had a solution 5 minutes after reading your post. (after struggling for several hours).  Thanks VM.

 

(defun od_value (attr_name / tname mo)
 (setq tname (nth 0 (ade_odgettables (setq mo (car (entsel))))))
 (ade_odgetfield mo tname attr_name 0)
)

Valued Mentor
CADaStroumph
Posts: 332
Registered: ‎10-15-2008
Message 2 of 3 (1,145 Views)

Re: Getting Object Data from an Entity..

10-15-2010 07:34 AM in reply to: petervose

See the help for (ade_od"function") especially for Acad Map

Try this:

 

 

(mapcar 'ade_odtabledefn (ade_odgettables (car (entsel))))

 

 

Distinguished Contributor
petervose
Posts: 309
Registered: ‎10-02-2003
Message 3 of 3 (1,125 Views)

Re: Getting Object Data from an Entity..

10-16-2010 03:14 AM in reply to: CADaStroumph

Great!! - That was exactly the pointer I needed. Had a solution 5 minutes after reading your post. (after struggling for several hours).  Thanks VM.

 

(defun od_value (attr_name / tname mo)
 (setq tname (nth 0 (ade_odgettables (setq mo (car (entsel))))))
 (ade_odgetfield mo tname attr_name 0)
)

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.