+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Table Export

  1. #1
    Senior Member Primal Scientist's Avatar
    Using
    Topobase 2010
    Join Date
    Sep 2007
    Location
    London
    Posts
    174

    Default Table Export

    Registered forum members do not see this ad.

    Hi,

    Does anyone know how I could export a table that contains co-ordinates and levels from a drawing I am working on and import it in to Excel so that it can be manipulated.

    Thanks in advance.

    Primal.

  2. #2
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    nah, I only know how to export to a text (ascii) file.

  3. #3
    Senior Member Primal Scientist's Avatar
    Using
    Topobase 2010
    Join Date
    Sep 2007
    Location
    London
    Posts
    174

    Default

    Yeah thats okay to Alan!!

  4. #4
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    Okay, I have written a lisp program that will take any text (table text) and export it to a ascii text file. If you want it, just yell.

  5. #5
    Senior Member Primal Scientist's Avatar
    Using
    Topobase 2010
    Join Date
    Sep 2007
    Location
    London
    Posts
    174

    Default

    Yeah, that would be great thanks Alan.

    Can I have it?

  6. #6
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    Stand by, I'll set it up. Have you ever tried to anything serious with a bloody Viking breathing down your neck? I have to get Tiger away for a bit. She's still going on about Rays????

    Oh, the intro should explain how it works, I hope. Otherwise, get back to me.

  7. #7
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    Okay, I found it, here you go:

    Code:
    ;;---------------------------------------------------------------------------
    ;;  TXT2ASCI.LSP                   OUTPUT SELECTED TEXT TO ASCII TEXT FILE
    ;;===========================================================================
    ;; DESCRIPTION:
    ;;     This routine will write out an ascii text file of the selected text
    ;;
    ;;     The text lines are sorted by either:
    ;;     1. as to their vertical location, and are then
    ;;        placed in paragraph form, the text line with the highest 'y' value will
    ;;        be the first line, followed by the text line with the next highest 'y'
    ;;        value, and so on...
    ;;     2. sorted by order of text line selection.
    ;;
    ;; Start Command:  txtout
    ;;
    ;;
    ;; Written by:     Alan Cullen                     July 1998
    ;;
    ;;--------------------------------ERROR HANDLER------------------------------
    (defun clerr (s)
      (if (/= s "Function cancelled")
        (if (= s "quit / exit abort")
          (princ)
          (princ (strcat "\nError: " s))
        )
      )
      (command "_.UNDO" "_BACK")
      (setq a nil)
      (setq ss1 nil)
      (setvar "CMDECHO" ocmd)
      (if olderr (setq *error* olderr))
      (princ "\nERROR...CONSOLE BREAK...ALL TEXT CHANGES HAVE BEEN UNDONE...")
      (princ)
    )
    ;;-----------------------------MAIN PROGRAM------------------------------
    (defun c:txtout ( )
      (setq ocmd (getvar "CMDECHO"))
      (setvar "CMDECHO" 0)
      (setq olderr *error* *error* clerr)       ;; Set new error handler
      (princ "\n EXPORT SELECTED TEXT TO ASCII TEXT FILE  -  July 1998 - Alan CULLEN")
      (princ "\n Select text lines in the order required for output file line number")
      (print)
      (setq outname (getstring "\n Enter name of OUTPUT FILE     (include extension).....: "))
      (setq dwgpath (getvar "dwgprefix"))
      (setq outname (strcat dwgpath outname))
      (setq output (open outname "w"))
      (setq sstxt (ssget
        '((0 . "TEXT")))
      )
      (setq n (sslength sstxt))
      (setq index 0)
      (repeat n
       (setq entname (entget (ssname sstxt index)))
       (setq txtgrp (assoc 1 entname))
       (setq txt (cdr txtgrp))
       (write-line txt output)
       (setq index (+ 1 index))
      )
      (close output)
      (princ (strcat  "\nText has been placed in file \""outname"\""))
      (setvar "CMDECHO" ocmd)
      (setq *error* olderr)              ;; Reset old error handler
      (princ)
      (princ)
    )

  8. #8
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Enterprise 64 bit
    Computer:
    Dell Precision M4500
    CPU:
    Intel Core i5 2.40GHz
    RAM:
    8GB
    Graphics:
    NVIDIA Quadro FX 880M
    Primary Storage:
    280 GB
    Monitor:
    2 x Samsung SyncMaster 2443 24''
    Using
    AutoCAD 2012
    Join Date
    Nov 2006
    Location
    Sthlm, Sweden
    Posts
    4,595

    Default

    Quote Originally Posted by Alan Cullen View Post
    Stand by, I'll set it up. Have you ever tried to anything serious with a bloody Viking breathing down your neck? I have to get Tiger away for a bit. She's still going on about Rays????
    Yes folks, I am that good at breathing - he feels my breath all the way across the globe. It's a natural talent, don't bother to try and learn it, it takes a professional for that kind of breathing!
    Life doesn't suck, although we all go through periods when it may be easier to think that, than to discern the solution to whatever problem is the most formidable
    at the moment in one's personal UCS.
    Go to PLAN view instead. - Dadgad

  9. #9
    Senior Member Primal Scientist's Avatar
    Using
    Topobase 2010
    Join Date
    Sep 2007
    Location
    London
    Posts
    174

    Default

    Is the breathing heavy?



    Thanks Alan, thats great!!

  10. #10
    Forum Deity
    Using
    Civil 3D 2008
    Join Date
    Sep 2006
    Location
    Pittsburgh, PA, USA
    Posts
    3,581

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Primal Scientist View Post
    Hi,

    Does anyone know how I could export a table that contains co-ordinates and levels from a drawing I am working on and import it in to Excel so that it can be manipulated.

    Thanks in advance.

    Primal.
    Tableexport command

Similar Threads

  1. Table top
    By spacefly in forum AutoCAD General
    Replies: 6
    Last Post: 13th Dec 2007, 02:34 pm
  2. Add a table
    By REDHEADEDCHIMP in forum Autodesk Inventor
    Replies: 3
    Last Post: 2nd Nov 2007, 06:56 pm
  3. Using a Table for a BOM?
    By Luvrbcs in forum AutoCAD Drawing Management & Output
    Replies: 13
    Last Post: 13th Feb 2007, 07:22 pm
  4. Replies: 0
    Last Post: 2nd Nov 2006, 11:51 pm
  5. hyperlinks in a table
    By fuccaro in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 3rd May 2006, 05:23 am

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