Jump to content

Recommended Posts

Posted

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

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • prabhathjp

    15

  • Tharwat

    12

  • SLW210

    1

Posted

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 )

Posted

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)

Posted

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 .

Posted

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

Posted

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)
)

Posted

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

Posted

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 .

Posted

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

Posted
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 ?

Posted

I deleted your identical thread, please create only one thread per question.

Posted

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

Posted

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 .

Posted

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)

Posted

i am using auto cad 2010 and excel 2007 on win 7

Posted
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

Posted
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 ?

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...