prabhathjp Posted October 12, 2013 Posted October 12, 2013 Dear Friends I have a ground beam layout with 15 type of beams and different lengths (GB1,GB2 .......) I need to prepare a excel sheet to quantify the conc volumes etc. I put dimensions each and every beams and taking these to excel file manually . Are there any routing to do this easily.....???? as a example....once I click the text "GB1" that should go to a cell in the "TYPE OF BEAM" column and next i will click the relevant dimension ant it should go to the Relevant cell in the "LENGHTH" column is it possible....?????? Prabhath Quote
Tharwat Posted October 12, 2013 Posted October 12, 2013 Hi , Can you upload a sample drawing with a sample Excel sheet showing how the result supposed to be . ( this is helpful for all users to know what you're after ) Quote
prabhathjp Posted October 12, 2013 Author Posted October 12, 2013 pl see the attachements sample.xlsx S11-12-13 Ground beam layout.dwg Quote
Tharwat Posted October 12, 2013 Posted October 12, 2013 What about the columns : Width , height and Volume values ? Quote
prabhathjp Posted October 12, 2013 Author Posted October 12, 2013 IF I can get data for Type of beam and length columns others will be calculated automatically (every beam type has specific width and height so that columns can be filled automatically when the first two columns are filled) Quote
Tharwat Posted October 12, 2013 Posted October 12, 2013 Actually we would not write the data to an existed Excel file , but would create a new one and we can write the data for the last three above mentioned columns if you want to . Quote
prabhathjp Posted October 12, 2013 Author Posted October 12, 2013 I need the data for first 2 columns only type of beam and length ......doing manually is consume more time that's why i asked that ...Thank you very much for replying me.... if you can suggest me any other pl. let me know. my exercise is find the conc. volume .....area of formwork and area of screeds Thanks & Regards Quote
Tharwat Posted October 12, 2013 Posted October 12, 2013 Try this routine , and you should select one text which represent name of beam and one Dimension otherwise the selected items won't be written to the Excel file . (defun c:Test (/ *error* i j f o ss sn l a b) ;; Tharwat Al Shoufi ;; ;; Dated : 12. October. 2013 ;; (defun *error* (u) (if o (close o) ) (princ "\n *Cancel*") ) (if (and (setq f (getfiled "Specify new file name ..." (getvar 'DWGPREFIX) "csv" 1 ) ) (setq o (open f "w")) (setq j 0) ) (progn (write-line (strcat "No" (chr 59) "Type of Beam" (chr 59) "Length" (chr 59) "Width" (chr 59) "Height" (chr 59) "Volume" ) o ) (while (progn (princ "\n Select Text and Dimension only [ 2 items only ] :" ) (setq ss (ssget '((0 . "*TEXT,*DIMENSION")))) ) (if (eq 2 (sslength ss)) (progn (setq i 2) (repeat i (setq sn (ssname ss (setq i (1- i)))) (if (wcmatch (cdr (assoc 0 (entget sn))) "*TEXT") (setq l (cons (cdr (assoc 1 (entget sn))) l)) (setq l (cons (cdr (assoc 42 (entget sn))) l)) ) ) (if (eq (type (car l)) 'STR) (setq a (car l) b (rtos (cadr l) 2 2) ) (setq b (rtos (car l) 2 2) a (cadr l) ) ) (write-line (strcat (itoa (setq j (1+ j))) (chr 59) a (chr 59) b) o ) (setq l nil) ) ) ) (close o) ) ) (princ) ) Quote
prabhathjp Posted October 12, 2013 Author Posted October 12, 2013 it writes in the excel file only the word type of beam ...length....width...volume no any values pl check i use the command as test Quote
Tharwat Posted October 12, 2013 Posted October 12, 2013 No , Actually when the codes ask you to select text and dimension just select one text and its related dimension in one shut which means two items only , otherwise nothing would be written to Excel file ( I have mentioned that in the previous post ). EDIT : press ENTER when you finish . Quote
prabhathjp Posted October 12, 2013 Author Posted October 12, 2013 Thanks soo much it is working the result is comming 1;GB2;1800 it is in same cell do you know any option to separate the result and enter to 3 separate cells Quote
Tharwat Posted October 12, 2013 Posted October 12, 2013 Thanks soo much it is working the result is comming 1;GB2;1800 it is in same cell do you know any option to separate the result and enter to 3 separate cells Did you change anything from the code or added anything to it ? Quote
SLW210 Posted October 12, 2013 Posted October 12, 2013 I deleted your identical thread, please create only one thread per question. Quote
prabhathjp Posted October 13, 2013 Author Posted October 13, 2013 Dear Tharwat I did not change any thing because I don'd have enough knowledge to change........any how I m trying to separate them using excell formulas Thanka Quote
Tharwat Posted October 13, 2013 Posted October 13, 2013 I did not change any thing because I don'd have enough knowledge to change........any how I m trying to separate them using excell formulas Download this VIDEO to see how to run the code and let me know . Quote
prabhathjp Posted October 13, 2013 Author Posted October 13, 2013 I watched the video and did same but result is like this 1;GB;1800 (in one cell) can you please up load your lsp file (when i copy paste to the note pad may be some thing happened) Quote
prabhathjp Posted October 13, 2013 Author Posted October 13, 2013 i am using auto cad 2010 and excel 2007 on win 7 Quote
Tharwat Posted October 13, 2013 Posted October 13, 2013 can you please up load your lsp file (when i copy paste to the note pad may be some thing happened) Here I am attaching the lisp file and rename to TDExcel i am using auto cad 2010 and excel 2007 on win 7 I just tested the code on the same version and everything is working normally . TDExcel.LSP Quote
prabhathjp Posted October 13, 2013 Author Posted October 13, 2013 Please see the attached excel file ...the result is comming like this ppppppppppp.csv Quote
Tharwat Posted October 13, 2013 Posted October 13, 2013 Please see the attached excel file ...the result is comming like this It is correct here , every symbol is in separate cell . What's wrong with it in your system ? Quote
Recommended Posts
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.