Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help me write a autolisp export drawing dimensions to excel?

6 REPLIES 6
Reply
Message 1 of 7
minhphuong.humg
1470 Views, 6 Replies

Help me write a autolisp export drawing dimensions to excel?

I have a drawing with dimensions and number (number and text number). I want ouput (Can select each oject) to a file excel. Please, write a lisp do.

Thank you very much.

6 REPLIES 6
Message 2 of 7
Patchy
in reply to: minhphuong.humg

Message 3 of 7
minhphuong.humg
in reply to: Patchy

Dir Patchy,

My attempt to as the following way you guide. But does not been ra output as expected (file attach). You can guide me non (can you a segment video)?

Describe how I did:

1: Load TEXT2CSV.VLX

(because demo I select 3 object)

2. Select 3 object in the order:

select: 1

select: H8.5

select: 37

3: Enter (because demo, I select 3 object)

However, file result don't expected. Please, Patchy guide help me.

Thank you very much.

Message 4 of 7
Patchy
in reply to: minhphuong.humg

Minh Phuong, try this:

 

;;******************* Text in autacad to excel *************************

;1. copy/paste to command prompt.
;2. specify a filename like c:\whatever.csv
;3. pick text for first row, use RETURN to specify new row
;4. pick next row of text entities in sequence, use RETURN to specify new row, etc etc
;5. use 2 RETURNs to exit
;6. launch Excel, open CSV file, use comma delimiter.


(defun C:TCSV ()
(setvar "cmdecho" 0)
(setq txta "")
(setq fnam (getstring "\nEnter export filename: "))
(setq f (open fnam "w"))
(setq enta (car (entsel "\nPick text to export: ")))
(while enta
(while enta
(setq ea (entget enta) txt (cdr (assoc 1 ea)))
(if (= (strlen txta) 0) (setq txta txt) (setq txta (strcat txta "," txt)))
(setq enta (car (entsel "\nPick text to export or for new line: ")))
)
(write-line txta f) (prompt "\nNew line.") (setq txta "")
(setq enta (car (entsel "\nPick text to export or to exit: ")))
)
(close f)
(princ)
)

Message 5 of 7
minhphuong.humg
in reply to: Patchy

Thank Patchy,

Thank you wrote good autolisp for me. But, this lisp is quite difficult to manipulate, perform. Because, I picking (text 1, text2, tex3), I had to go back to typing RETURN. Doing this makes me feel very long. With hundreds of text drawings, I felt very tired to pick picks each text.

Can you write help me? Instead of typing RETURN(other new row), the right mouse button. To that end we have to double click the right mouse button not?

Please, Patchy help me.

Thank you very much.

Message 6 of 7
Patchy
in reply to: minhphuong.humg

I didn't write it, I found it here at the forum.

You need to ask the Customization Group about this question.

Good luck.

 

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/bd-p/130

Message 7 of 7
minhphuong.humg
in reply to: Patchy

Well, thank you for help me. Good luck for Patchy. I will change my question to forum http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/bd-p/130.

Thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost