style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<devitg> wrote in messageThere
href="news:6054269@discussion.autodesk.com">news:6054269@discussion.autodesk.com...
is , at least, any file at the main folder?, any kind , if dwg
better
(vl-load-com)
(defun c:copydwg ( / PT DATE TIME fDATE OFILE O_FIL PATH)
(setq fDATE (menucmd "M=$(edtime,$(getvar,date), MON DD YYYY)"))
(setq NAME (getvar "dwgname"))
(setq PATH (getvar "dwgprefix"))
(setq ofile (strcat "c:\\dwg-history" fdate ".txt")); output file
(setq o_fil (open ofile "A")); open file
(write-line (strcat path name) o_fil)
(close o_fil)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:dwghist (/ h_file i_fil rd_lin Flag dwg)
(setq fDATE (menucmd "M=$(edtime,$(getvar,date), MON DD YYYY)"))
(setq dwg (STRCAT (GETVAR "DWGPREFIX") (getvar "dwgname")))
(setq h_file (strcat "C:\\dwg-history" fdate ".txt"))
(if (findfile h_file) ; file exists
(progn
(setq i_fil (open h_file "r")) ; open log file
(setq Flag 0) ; default to not found
(while (setq rd_lin (read-line i_fil)) ; read input line
(if (vl-string-search dwg rd_lin)
(setq Flag 1) ; found
) ; if
) ; while
(close i_fil)
;; Now, check if User was found or not..
(if (= Flag 0) ; not on list
(c:copydwg)
) ; if
) ; progn
(c:copydwg)
) ; if
(princ)
) ; function
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<andrew.nao> wrote in messageyou
href="news:6056521@discussion.autodesk.com">news:6056521@discussion.autodesk.com...
save the code as a lisp file, then load the lisp file with your acaddoc.lsp it
will record every dwg you open to a separate text
file
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<ronnyh%C3%A5> wrote in messageThanks
href="news:6070280@discussion.autodesk.com">news:6070280@discussion.autodesk.com...
for the tip, but this was not what I needed. This program only gets the
filename and attributes in the file - not the attributes within the drawing,
i.e. drawn/checked/approved dates, scale, current revision or other data
assigned to either the title block or certain custom fields in the
drawing.
The program/lisp/code I need has to be executable in
AutoCAD, preferably as a background task with opening of multiple files
and exporting select data to a file which can be opened in Excel
(.xls/.csv/.txt or eq.)
Hope this clears things
up...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<ronnyh%C3%A5> wrote in messageGreat
href="news:6071580@discussion.autodesk.com">news:6071580@discussion.autodesk.com...
tool! Thanks.
It even lets me pick the files I want and where I want to
save the csv-file.
Do you know is there anyway of using a Excel
template or existing Excel file for arranging the data extracted in a certain
manner, e.g. Drawing number in cell
C20?
Thanks,
ronnyh
getting the login name of a user as far as im aware is a function that has to be called while in acad
and unless that user somehow opens the dwg i dont see how you can get the login name of who last edited the dwg
also lisp doesnt look in any sub folder unless specifically pointed to in the code.
so if you have many sub folders, coding lisp to look at all those sub folders is alot of work
again this is as far as im aware those with more advanced coding would know more on this
good luck
p.s. i have some code that was posted on the old board that will record the day, time, dwg location and dwg name and the user who last opened and closed the dwg
works similar to the code i posted before
post here if you are interested in it