+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Feb 2012
    Posts
    3

    Default Export properties ("measurement") of "Aligned Dimension" to Excel

    Registered forum members do not see this ad.

    hello, everybody
    i have a following problem :
    i want to export properties of aligned dimension ( that is "measurement")
    to excell
    when i click to choose the aligned dimensions and enter(click),
    the properties of aligned dimension ( that is "measurement", ex: 45,48,78...)
    will be exported to excel.
    Help me and thanks !
    (have a attach file(help.docx))
    Attached Files

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,705

    Default

    Look into the DATAEXTRACTION command.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,586

    Default

    Try this program
    Code:
     
    ;;----------------------------ALDIMTXL.LSP-------------------------------;;
    ;; fixo (02012 * all rights released
    ;; 3/1/12
    (defun C:ALDIMTXL (/ *error* col data dm elist en fname row sset xlapp xlbook xlbooks xlcells xlsheet xlsheets)
    (defun *error* (msg)
    (if
    (vl-position
    msg
    '("console break"
    "Function cancelled"
    "quit / exit abort"
    )
    )
    (princ "Error!")
    (princ msg)
    )
    (princ)
    )
    ;;;local defun
    (defun setcelltext(cells row column value)
    (vl-catch-all-apply
    'vlax-put-property
    (list cells 'Item row column
    (vlax-make-variant
    (vl-princ-to-string value) 8)))
    )
     
    ;;; main part
    (if (setq sset (ssget (list (cons 0 "dimension"))))
    (progn
    (while (setq en (ssname sset 0))
    (setq elist (entget en))
    (if (member "AcDbAlignedDimension" (mapcar 'cdr elist))
    (progn
    (if (eq "" (cdr (assoc 1 elist)))
    (setq dm (rtos (cdr (assoc 42 elist)) 2 (getvar "dimdec")))
    (setq dm (cdr (assoc 1 elist)))
    )
    (setq data (cons dm data))
    )
    )
    (ssdel en sset)
    )
    (alert "Wait...")
    (setq xlapp (vlax-get-or-create-object "Excel.Application")
    xlbooks (vlax-get-property xlapp 'Workbooks)
    xlbook (vlax-invoke-method xlbooks 'Add)
    xlsheets (vlax-get-property xlbook 'Sheets)
    xlsheet (vlax-get-property xlsheets 'Item 1)
    xlcells (vlax-get-property xlsheet 'Cells)
    )
     
    (vla-put-visible xlapp :vlax-true)
    (setq row 1)
    (setq col 1)
     
    (foreach dim data
    (setcelltext xlcells row col dim)
     
    (setq row (1+ row)
    )
    )
    )
    )
     
     
    (vlax-invoke-method
    (vlax-get-property xlsheet 'Columns)
    'AutoFit)
     
    (setq fname (strcat (getvar "dwgprefix")(vl-string-right-trim ".dwg" (getvar "dwgname")) ".xlsx"))
    (vlax-invoke-method
    xlbook
    'SaveAs
    fname 
    nil
    nil
    nil
    :vlax-false
    :vlax-false
    1
    2
    )
    (vlax-invoke-method
    xlbook 'Close)
    (vlax-invoke-method
    xlapp 'Quit)
    (mapcar '(lambda (x)
    (vl-catch-all-apply
    '(lambda ()
    (vlax-release-object x)
    )
    )
    )
    (list xlcells xlsheet xlsheets xlbook xlbooks xlapp)
    )
    (setq xlapp nil)
    (gc)(gc)(gc)
    (alert (strcat "File saved as:\n" fname))
    (*error* nil)
    (princ)
    )
    (prompt "\n\t\t---\tStart command with ALDIMTXL\t---\n")
    (princ)
    (vl-load-com)
    (princ)
    ;;----------------------------code end-------------------------------;;
    ~'J'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  4. #4
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Feb 2012
    Posts
    3

    Default

    thanks "lee mac", but "data extraction" isn't available on CAD2007

  5. #5
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Feb 2012
    Posts
    3

    Default

    thanks "fixo" so much !
    your lisp is very good !
    thanks !

  6. #6
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,586

    Default

    To be honestly this isn't so good
    Change it to get a robust result

    ~'J'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  7. #7
    Full Member
    Using
    AutoCAD 2007
    Join Date
    Jan 2010
    Posts
    95

    Default

    Mr fixoYour lisp very good thank you very much

  8. #8
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,586

    Default

    Quote Originally Posted by wrha View Post
    Mr fixoYour lisp very good thank you very much
    Not so good as you think,
    keep varnish them to your suit

    Cheers
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  9. #9
    Forum Newbie
    Using
    Mechanical 2011
    Join Date
    Jan 2013
    Posts
    1

    Default

    Registered forum members do not see this ad.

    your moduls takes just nominal value
    can I EXPORT dimensions with tolerances,?
    example value : 11,20-11.60 nominal dimension (11.40)
    Thanks I hope explain my problem.

Similar Threads

  1. Replies: 1
    Last Post: 10th Nov 2011, 02:26 pm
  2. "Hidden" line turns to "continuous" in layout view
    By jeck in forum AutoCAD General
    Replies: 12
    Last Post: 19th Jun 2011, 12:44 pm
  3. Replies: 3
    Last Post: 8th Jan 2011, 09:17 pm
  4. (command "dim" "DIMLDRBLK" "" |) is not working
    By bijoyvm in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 17th Oct 2010, 12:15 pm
  5. Replies: 1
    Last Post: 25th Nov 2009, 06:35 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