Jump to content

Get numbers from a Drawing to an Excel-sheet


ThomasT1976

Recommended Posts

Hello,

 

I've made a big calculation in a Pipe Stress Analysis program and the program has auto created 10 autocad drawings that is used to find points in the system.

The problem is that the program has random numbered (with no intelligence) and now I have a big report which for example points at a number some where in the 10 drawings, which is hopeless to find.

 

I have attached 1 of the 10 drawings. So you have an idea of what i'm talking about.

 

Can I somehow:

1. Find all numbers in this drawing.

2. Put them into Excel.

3. Sort them after size.

4. Add an extra column which tells which drawing I can find the number.

5. Last put all the numbers from all the drawing into one Excel sheet and sort them after size, now I have a number index, so I can find which number is in which drawing and that would be a BIG help.

 

My big problem is number 1: Can Autocad find all numbers in a drawing and let me copy them to Excel for editing?

 

Help will be REALLY appriciated, THANKS! :):)

Train D.dwg

Link to comment
Share on other sites

I think the command 'eattext' is the one you are looking for. It requires a little practice and Excel experience to work with it properly but it enables you to output almost everything in a drawing.

 

In this specific case you would only export text entities with their 'content' property and take the rest of the processing to Excel. You should even be able to select all 10 drawings at once in the eattext wizard and add the drawing name property to each entity, but I've never done that personally.

Link to comment
Share on other sites

An AutoLISP approach:

;;; Extract Report of Text (18-IV-2012)
(defun c:ERT( / index itemsText valueText )
(if (setq index 0
          itemsText (ssget "_X" '((0 . "TEXT"))))
 (repeat (sslength itemsText)
  (setq valueText (cdr (assoc 1 (entget (ssname itemsText index)))))
  (if (distof valueText)
   (prompt (strcat "\n" valueText "\t" (getvar "DWGNAME")))
  )
  (setq index (1+ index))
 )
)
(textscr)
(princ)
)

Use Copy / Paste to move the report to Excel.

Edited by MSasu
Modified the code
Link to comment
Share on other sites

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