Results 1 to 4 of 4

Thread: Help with exporting data from AutoCAD drawings into excel spreadsheet

  1. #1
    Member
    Join Date
    2002-02
    Posts
    8
    Login to Give a bone
    0

    Default Help with exporting data from AutoCAD drawings into excel spreadsheet

    The problem:

    I have an AutoLISP routine that I use to compile data created and embedded in drawings that are electrical cable block diagrams. The data that is extracted is information of the pinning of and the type of cable connectors of both ends of the cable. The AutoLISP routine can extract the data from cables on one drawing sheet or many drawing sheets that are xreferenced in a temporary drawing. This AutoLISP routine outputs the data as 8 ½” x 11” cable connection sheets in AutoCAD drawing format.

    What I need this AutoLISP routine to do now is output the same data in the same format into one (1) Excel file with all of the cable connection sheets tabbed.

    Can anyone help me and or lead me in the right direction?

    I can provide copies of the cable block drawing(s), the AutoLISP routine and the 8 ½” x 11” cable connection sheets.

    Thank you for your time, it is most appreciated,

    Chris

    c_l_maiden@yahoo.com

  2. #2
    Login to Give a bone
    0

    Post Re: Help with exporting data from AutoCAD drawings into excel spreadsheet

    Chris,
    I can’t help you with the specifics to write your program, but I can offer you a utility to help you get started.
    Here is a general purpose function for (Excel to AutoCAD) and (AutoCAD to Excel) applications. Special credit to Gilles Chanteau from Marseille, France for his sub-functions ColumnRow, Alpha2Number and Number2Alpha.
    Here are two examples of how it works. Notice in the second example; it requires OpenExcel, one or more calls to PutCell, and ends with CloseExcel.
    Code:
    (defun c:Get-Example ( )
      ;GetExcel - Stores the values from Excel into *ExcelData@ list
      ;Syntax: (GetExcel ExcelFile$ SheetName$ MaxRange$)
      (GetExcel "C:\\Folder\\Filename.xls" "Sheet1" "L30");<-- Edit Filename.xls
      ;GetCell - Returns the cell value from the *ExcelData@ list
      ;Syntax: (GetCell Cell$)
      (GetCell "H21");Or you can just use the global *ExcelData@ list
    );defun
    
    (defun c:Put-Example ( )
      ;OpenExcel - Opens an Excel spreadsheet
      ;Syntax: (OpenExcel ExcelFile$ SheetName$ Visible)
      (OpenExcel "C:\\Folder\\Filename.xls" "Sheet1" nil);<-- Edit Filename.xls
      ;PutCell - Put values into Excel cells
      ;Syntax: (PutCell StartCell$ Data$) or (PutCell StartCell$ DataList@)
      (PutCell "A1" (list "GP093" 58.5 17 "Base" "3'-6 1/4\""));Repeat as required
      ;CloseExcel - Closes Excel session
      ;Syntax: (CloseExcel ExcelFile$)
      (CloseExcel "C:\\Folder\\Filename.xls");<-- Edit Filename.xls
      (princ)
    );defun
    For your project just use the format in the Put-Example function above.
    There are several other options of the arguments explained in the function headings in the program.
    Attached Files Attached Files

  3. #3
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: Help with exporting data from AutoCAD drawings into excel spreadsheet

    If you use a comma delimited ascii text file it will open in excell.
    OPEN WRITE-LINE and CLOSE will do the job.

  4. #4
    Woo! Hoo! my 1st post
    Join Date
    2014-06
    Posts
    1
    Login to Give a bone
    0

    Default Re: Help with exporting data from AutoCAD drawings into excel spreadsheet

    Thank you very much for your post.

Similar Threads

  1. Importing data from an Excel spreadsheet
    By spacepig62 in forum AutoLISP
    Replies: 25
    Last Post: 2012-09-13, 03:48 PM
  2. Exporting to Excel spreadsheet
    By KellyR in forum Inventor - General
    Replies: 1
    Last Post: 2007-09-15, 10:15 PM
  3. Replies: 2
    Last Post: 2007-04-12, 11:40 AM
  4. Bring Excel data in AutoCAD drawings
    By cosnobum02 in forum AutoCAD General
    Replies: 8
    Last Post: 2006-10-18, 04:34 PM
  5. Formatting of Numeric data when exporting Hole Tables to Excel in AutoCAD Mechanical
    By roger.brown in forum AutoCAD Mechanical - Wish List
    Replies: 0
    Last Post: 2006-02-10, 02:45 PM

Posting Permissions

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