+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Forum Newbie
    Computer Details
    samsudeenmanoos's Computer Details
    Operating System:
    windows
    Discipline
    Surveying
    samsudeenmanoos's Discipline Details
    Occupation
    Draftsman
    Discipline
    Surveying
    Using
    Map 3D 2016
    Join Date
    Aug 2017
    Location
    qatar
    Posts
    3

    AutoCAD How to extract xdata into excel or txt

    Registered forum members do not see this ad.

    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

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,748

    Default

    Registered forum members do not see this ad.

    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.

    Code:
    ; 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")
    )
    )
    Last edited by BIGAL; 17th Aug 2017 at 05:55 am.
    A man who never made mistakes never made anything

Similar Threads

  1. extract area of block to excel
    By amir0914 in forum AutoLISP, Visual LISP & DCL
    Replies: 25
    Last Post: 29th Mar 2016, 06:37 pm
  2. Extract block & attributes to Excel
    By stevesfr in forum AutoLISP, Visual LISP & DCL
    Replies: 18
    Last Post: 5th Oct 2010, 07:52 am
  3. extract dimesions from dwg to excel
    By shamsam1 in forum AutoLISP, Visual LISP & DCL
    Replies: 24
    Last Post: 14th Jun 2010, 10:34 am
  4. extract point from excel files
    By janka83 in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 15th Jan 2010, 05:34 pm
  5. extract block attributes to excel
    By silviu30 in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 19th Feb 2009, 04:31 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts