Jump to content

How to extract xdata into excel or txt


samsudeenmanoos

Recommended Posts

This will get you started. This retrieves the data and output to a txt file or excel would happen where the Alert is. There is a lot of variables and depending on object xdata varies so it will require further coding to match what it is you want to exactly output.

 

; xdata retrieve example by Alan H Aug 2017
;;;
(defun c:test ( / ent vals x codes datas)
(setq ent (entget (car (entsel "select an object"))))
(vla-GetXData (vlax-ename->vla-object (cdr (assoc -1 ent))) "" 'codes 'datas)
(if (/= datas nil)
(progn
(setq vals (vlax-safearray->list datas))
(setq ans "Xdata is\n\n")
(repeat (setq x (length vals))
(setq ans (strcat ans   (vlax-variant-value (nth (setq x (- x 1)) vals)) "\n"))
)
(alert ans)
)
(alert "Please pick again object has no xdata")
)
)

Edited by BIGAL
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...