AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Object Data to Text or Attributes

2 REPLIES 2
Reply
Message 1 of 3
rehyes
425 Views, 2 Replies

Object Data to Text or Attributes

How can the object data values of a point be converted into text that is located at each point? How can object data values be accessed by LISP or VBA?
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: rehyes

Attach the dwg, query, alterproperties, text, and select the field and OD table. Look into the help files on each step it should walk you thru most of it. As far as accessing the OB tables/vaules in lisp you use the "ade_od*****" functions. It gets a little confusing at times but if I can work my way around in there anyone should be able to.

..........Murph
Message 3 of 3
Anonymous
in reply to: rehyes

"rehyes" wrote in message
news:f090289.-1@WebX.maYIadrTaRb...
How can the object data values of a point be converted into text that is
located at each point? How can object data values be accessed by LISP or
VBA?

I'm not certain what you're asking for here, but I pieced together a few
sections of code that perform different functions, and somewhere in there
you might find an answer your question.

assuming "PointTable" is an existing Object Data Table, and
assuming "XY" is a character field in the OD table, and
assuming (pt_ss) is a selection set of points...

(setq pt_unit (getvar "lunits")); units
(setq pt_prec (getvar "luprec")); precision
(setq pt_table "PointTable"); od table
(setq pt_fld "XY"); odt field

(setq pt_no 0)
(while (and pt_ss (setq pt_nm (ssname pt_ss pt_no))); loop through point ss
(setq pt_get (entget pt_nm))
(setq pt_ins (aso 10 pt_get)); x,y
(setq pt_xr (nth 0 pt_ins)); x coord
(setq pt_yr (nth 1 pt_ins)); y coord
(setq pt_x (rtos pt_xr pt_unit pt_prec)); x to string
(setq pt_y (rtos pt_yr pt_unit pt_prec)); y to string
(setq pt_xy (strcat pt_x "," pt_y)); x,y string
(if (= (ade_odgettables pt_nm) nil); attach od table, if not already
attached to point
(ade_odaddrecord pt_nm pt_table))
(ade_odsetfield pt_nm pt_table pt_fld 0 pt_xy); add xy string to field
(setq pt_text (ade_odgetfield pt_nm pt_table pt_fld 0)); extract xy from
table
(command "_text" "mc" pt_ins "1" 0 pt_text); write to text
(setq pt_no (1+ pt_no))
);end while


Eric Smallwood

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

Post to forums  

Autodesk Design & Make Report

”Boost