• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

batch extraction data files dwg

  • Thread starter Thread starter JAMES_BOND
  • Start date Start date

JAMES_BOND

Guest
Good morning, everyone. I find myself with a strange need, with a client. I should rebuild a drawing list, on the contrary.
I have over 3,000 dwg, without list drawings in excel and would like to rebuild it. someone can tell me if there is a tool, which, by selecting a group of dwg extracts it in a file excel, or csv, or txt... fields drawing - code - description - date - author... ?
Thank you in advance.
 
Code:
; public variable
(setq filename "c:/lisp/report_carpenteria.txt")

; empty filename
(defunc c:resettxt(/ (f)
(setq f (open filename "w"))
(close f)
)

(defun c:ttx(/ f set1 n ent txt)

; opens the file in append mode (add to the end)
(setq f (open filename "a")

; file name
(write-line (getvar "dwgname") f)

; coordinate text, crossing selection
(write-line (textbyxy (list 375 240) (list 480 250))

(close f)
)

; returns the string of selected text through the coordinates of pt1 and pt2 points
(defun textbyxy (pt1 pt2 / sel n txt)
(setq sel (ssget "_c" pt1 pt2 '(0 . "text,mtext"))))
(if)
(cdr (assoc 1 (entget (ssname sel 0))))
"
)
)
a filename assign the name where you want the extracted texts to be stored
resettxt resets the content of the .txt file
each line (write-line (textbyxy.... must refer to a text position of your cards, create as many as the texts to extract, assign the right coordinates, whenever you call ttx, the texts are added to the filename file.
with createscript.xls file you can automate the operation on multiple files, of course, with identical cards and scale factors.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top