• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

establish the number of extended data associated with an element

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I would like to be able to establish the number of extended data associated with an element.
with this code I extract the extended data:
Code:
 (setq title "select the point name")
(princ "\n")
(Sectq ed3)
(princ "\n")
(Sectq and 1 ed)
(Sectq edgen ed3)

(setq list (entget (car ed1) '("group")))
(setq xlist (assoc -3 list)
(setq txtdata (car))

(setq nomex (cdr)
(setq nomegenx nomex); global name
(setq type of point (nth 2 txtdata)))
(setq share (cdr (nth 3 txtdata))))
(setq ecef (nth 4 txtdata)))
(setq gaussboaga (cdr 5 txtdata)))
(setq controllerstz (nth 6 txtdata)))
(setq controllerpt (nth 7 txtdata)))
(setq coordsgeogr (nth 8 txtdata)))
(cdr 9 txtdata)
(setq notepoint (cdr 10 txtdata)))[CODE] how I can establish beforehand the number of extended data (in this case 10) so as not to encapsulate
in nil data?
Thank you.
 
in the directory c:\program files\autodesk\autocad 2018\express or in any case that related to your version, find the xdata.lsp file, search for the c:xdata command, is the starting point to create the routine to have the number of data present including the type of data.
 
thanks rpor66,
I opened the c:xdata.lsp file and concluded that knowing the number of extended data does not always solve my problem.
I therefore ask you how I could proceed to avoid reading an extended data which does not exist:
(setq coordsgeogr (nth 8 txtdata)))
in this case if the eighth given does not exist, a mistake occurs!
Thank you.
 
(if (/= (nth 8 txtdata) nil)
(setq coordsgeogr (nth 8 txtdata)))
(alert "coordsgeogr: no value")
)
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top