samsudeenmanoos Posted August 16, 2017 Share Posted August 16, 2017 Dear friends, I need your help to extract some Xdata from the attached drawing if you want to check Xdata you can just type xdlist in Autocad and check.Drawing with xdata.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 17, 2017 Share Posted August 17, 2017 (edited) 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 August 17, 2017 by BIGAL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.