Jump to content

Recommended Posts

Posted

Dear all of CADtutor Friend

I just new member, and need help from someone

Who have some autolisp or technic how to Convert AutoCAD (Text) to Excel, help me please

 

 

Posted

have you had a look through some of our old threads? I'm fairly certain we've been asked this before

 

it isn't a good idea to post your email address on the internet btw - it can be harvested and used for all kinds of things you don't want to receive!

Posted

Thank you very much Strix, Let me find that old question

Posted

A simpler way would be to output from AutoCAD in a so called CSV file. It can be opened in Excel too.

Posted

Dear Fuccaro

I found some Autolisp code below, But only 1 problem

this code read and sort from bottom to top

How I modify this code read Text from Autocad Then show to Excel

from top to Bottom

Thank and Regard Sir.

 

(defun c:ttx ( / xlCells xlSheet xlSheets xlBook xlBooks xlApp column row drac ss ent expo x)

 

(vl-load-com)

 

(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 column 1

row 1

drac -1

ss (ssget "_X" (list (cons 0 "*TEXT"))))

 

(repeat (sslength ss)

(setq ent (ssname ss (setq drac (1+ drac)))

expo (vla-get-textstring (vlax-ename->vla-object ent)))

(if (

(vlax-put-property xlCells "Item" row column expo)

(progn

(setq row 1

column (1+ column))

(vlax-put-property xlCells "Item" row column expo)

); /else progn

); /if

(setq row (1+ row))

); /repeat

 

(mapcar (function (lambda(x)

(vl-catch-all-apply

(function (lambda()

(progn

(vlax-release-object x)

(setq x nil)))))))

(list xlCells xlSheet xlSheets xlBook xlBooks xlApp))

 

(alert "Close Excel file manually")

 

(gc)(gc)

 

(princ)

 

)magic

Posted

You can use DATAEXTRACTION too , it will do all hard work.

 

No code needed

  • 1 year later...
Posted

Can you please tell me how this DATAEXTRACTION work?

?

Posted

Just follow de Dialog box instructions , and use the help

Type DATAEXTRACTION at the command line .

Posted

thank you, but it does not copy all the details to excel file and also the order is not what it should be.

what i need is to copy all the data in an autocad file and create a table in excel but dataextraction arranges all the values in single column which is not what is required. (formatting etc can be taken care of later).

please help

Posted

Can I get these details in coma separated format?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...