×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ACAD 2006 - Import of CSV files

ACAD 2006 - Import of CSV files

ACAD 2006 - Import of CSV files

(OP)
I have a csv file I would like to import to autocad but not as excel, but to display it like the autocad tables which have appeared in 2006 (or was it 5).

I have used excel imports but have had fairly bad experinece producing output to pdf (loosing quality or getting a number of odd lines across the page (and problems with the interactive bit when it stopped communicating with excel)).

Either way is there a way to import information to tables in autocad in the way you can export from them.

RE: ACAD 2006 - Import of CSV files

Don't know if this helps, but what I do is to Edit/Copy in Excel and Edit/Paste in AutoCAD.  The Excel comes in as an OLE object that prints very nicely and looks good.  If I need to change it, I right-click the table in AutoCAD and pick OLE/Open and it appears in Excel.  When I exit Excel, the changes are apparent in AutoCAD.

RE: ACAD 2006 - Import of CSV files

(OP)
It is fine in principle but I've had a number of files which stop communicating back to excel.

Printing directly is fine too but when printed to PDF they become a bit odd.

Its the conversion from excel to autocad which I lack (rather than the use of excel within autocad).

Any other ideas?
Thanks.

RE: ACAD 2006 - Import of CSV files

Found at CADmonkey.com

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;  TABLE.LSP
;;;  This routine can read a comma seperated variable (CSV) file and import
;;;  them to AutoCAD drafting screen as a table.
;;;  Copyright 1997 Yuqun Lian, SimpleCAD   http://www.simplecad.com
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Set the global variables, you can freely edit them
(setq ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       x_distance     10
       y_distance     2
       text_height    1
       text_style     "complex.shx"
       text_align     "ml"     
) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun c:table(/ txt txt_lst x y)
 (setvar "cmdecho" 0)
 (setvar "blipmode" 0)
 (command "style" "txt_style" text_style text_height "1.0" "" "" "" "")
 (setq data_file (getfiled "Select a data file" "" "CSV" 0))
 (setq start_pt (getpoint "\nPick the left-upper corner for the table: "))
 (setq y (cadr start_pt))
 (setq fp (open data_file "r"))
 ;; read data
 (while (setq txt (read-line fp))
      (setq txt_lst (parse txt))
      (setq x (car start_pt))
      (print_lst txt_lst)
      (setq y (- y y_distance))
  )
 (close fp)
)

(defun parse(txt / n count word lst in_quart)
 (setq n (strlen txt) count 1  word "" in_quart nil lst nil)
 (while (<= count n)
  (setq char (substr txt count 1))

  (if (= char "\"")
     (if in_quart
        (setq in_quart nil)
        (setq in_quart T)
     )
  )

  (if (and (= char ",")(= in_quart nil))
   (progn
      (setq lst (append lst (list word)))
      (setq word "")
   )
   (progn
       (if (/= char "\"")
           (setq word (strcat word char))
       )
       (if (= count n)
          (setq lst (append lst (list word)))
       )
   )
  )
  (setq count (1+ count))
 )
 (setq lst lst)
)

(defun print_lst (lst / txt txt_pt)
  (foreach txt lst
    (setq txt_pt (list x y))
    (command ".text" "s" "txt_style" "j" text_align txt_pt "0" txt )
    (setq x (+ x x_distance))
  )
)

(princ "\nType TABLE to run")(princ)


"Everybody is ignorant, only on different subjects." — Will Rogers

RE: ACAD 2006 - Import of CSV files

This works in 2005...
In excel highlight the table, cntrl+c to copy. In acad, paste special >> as Autocad entities. Comes in as a table, won't be linked to the original excel file though.

____________________
Acad2005, Terramodel

RE: ACAD 2006 - Import of CSV files

(OP)
lpseifert - You are a super star. Thank you very much - just what I needed. Have a nice monday.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources