Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting Object Data from an Entity..

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
petervose
4589 Views, 2 Replies

Getting Object Data from an Entity..

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)

2 REPLIES 2
Message 2 of 3
CADaSchtroumpf
in reply to: petervose

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

Try this:

 

 

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

 

 

Message 3 of 3
petervose
in reply to: CADaSchtroumpf

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)
)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost