Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Save drawing list

17 REPLIES 17
Reply
Message 1 of 18
Anonymous
346 Views, 17 Replies

Save drawing list

Any suggestions as to how I can save/print a list of drawings in a folder (&
sub-folders) which would also include the path, date and "owner"
(loginname)? ...dos, windows, lisp, vba, etc
17 REPLIES 17
Message 2 of 18
devitg
in reply to: Anonymous

There is , at least, any file at the main folder?, any kind , if dwg better

Message 3 of 18
Anonymous
in reply to: Anonymous


Could you please elaborate on your
response?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
There
is , at least, any file at the main folder?, any kind , if dwg
better

Message 4 of 18
andrew.nao
in reply to: Anonymous

it only writes the file name and path to a text file but feel free to use and modify this to suit your needs


(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

Message 5 of 18
Anonymous
in reply to: Anonymous


This is a start...

Can anyone modify
this routine to include the

face=Arial>"owner" (loginname

face=Arial>)? 
Message 6 of 18
EC-CAD
in reply to: Anonymous

Change:
(write-line (strcat path name) o_fil)
To:
(write-line (strcat path name " " (getvar "loginname")) o_fil)

Bob
Message 7 of 18
Anonymous
in reply to: Anonymous


Just exactly how do I use this routine to work on a
selected folder and subfolders?
Message 8 of 18
andrew.nao
in reply to: Anonymous

you 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
Message 9 of 18
Anonymous
in reply to: Anonymous



That's not exactly what I was looking for. I have
project folders which contain drawings which have been edited by many users at
various times. I was hoping to create a current list of all the drawing in a
folder (& subfolders) which contains the dwg file name,

face=Arial size=2>path, date and "owner" (loginname) not just the drawings I
worked on.

 

Using lisp is fine but any approach would be
helpful ... dos, windows (except
print-screen), lisp, vba, etc

size=2>.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
you
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
Message 10 of 18
ronnyh%C3%A5
in reply to: Anonymous

Any luck with that lisp? I've been looking for the exact same thing.

This is my scenario: - lots of drawings in a folder - need drawing data (drawing number, drawing name, drawn date, drawn by, scale, current revision a.s.o.) - list must be importable to excel............. The big problem is that our production management system saves all drawings to a location unknown and unaccessible to us directly. The only way to get to the drawings is to request them through the system. A copy of the drawing is then saved locally on my machine and reserved for me only until I release it back to the system. We therefore - LOCALLY - have ONE folder with ALL drawings saved in it: C:\Work\Acad\....... This is the folder I want to get the lisp to scan. Since there can be hundreds of drawings in this folder, the lisp would need to be able to weed out the drawings containing a specific value for a specific line, i.e. Project=JA-00116 which would give me all the drawings for this specific project......Simple, huh? If this is entirely impossible, another approach would be to sort the list made by the lisp according to project. Then I'd be able to copy-paste this data from there to our standardized forms. Yeay!..... Anyone?
Message 11 of 18
scot-65
in reply to: Anonymous

http://www.download.com/JR-Directory-Printer/3000-2248_4-10065501.html?cdlPid=10 207368

There are others out there, some you have to pay for...

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 12 of 18
ronnyh%C3%A5
in reply to: Anonymous

Thanks 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...
Message 13 of 18
Anonymous
in reply to: Anonymous

Hi ronnyh%C3%A5,

What you're asking is entirely possible with a number of coding methods.

What you need to realise is that for a program to work to extract data
from a drawing the data has to be in consistent places.

You have to tell the programmer what these places are.

e.g.

is it the value of a text item on layer 0 at coordinates 20,30?
is it the values of attribute "DrawingName" in block insert "MyTitleBlock"?

The program will then be able to identify the source of the data and
read it. Putting the data out to Excel or CSV file format is trivial.


If all the data you want is in the attributes of a block, then it is a
simple exercise for you to use the built attribute extraction tools to
write a CSV file. All you need to it look at the help file and follow
the steps to do it.

Regards


Laurie Comerford

ronnyh%C3%A5 wrote:
> Thanks 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...
Message 14 of 18
Anonymous
in reply to: Anonymous


AutoCAD Data Extraction (EATTEXT command) can do what

you need, assuming you're running a
release that supports it.


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
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...
Message 15 of 18
ronnyh%C3%A5
in reply to: Anonymous

OK, now we're getting places...



The data I need to get is from the company title block and these are the names for the different fields within that block:



GEN-TITLE-NR{12.3} - which is the drawing number

GEN-TITLE-DES1{24.5} - which is the description

AS1 - which is the customer

GEN-TITLE-NAME{14.9} - which is the person who created the drawing

GEN-TITLE-REV{22.6} - which is the current revision number

GEN-TITLE-SCA{12.7} - which is the scale

A9 - which is the project number



File location and/or certain files should be selectable on execution of the code, then opened and have the code write a list containing previously mentioned data. We already have standardized Excel-sheets which contains this data, but the job of updating them is done manually and as you can amagine the chance of getting something wrong when dealing with sometimes hundreds of drawings per project is quite huge.

As I mentioned earlier every single file I open from the system is stored locally on my machine in a single folder no-matter the project. BUT the DWGLIST and COPYLISTs are stored on a local server with seperate folders for every project. This is where I want to choose which in project and in what folder (or subfolder) the CAD data list created should be stored.



Step 2 will probably be getting the data straight to our DWGLIST and COPYLIST without the need to save it as separate file.



Thanks,


ronnyh

(%C3%A5 = swedish vowel: a with ring, but for some reasons this forum does not recognize it and gives me this instead)

For education on this subject see: http://en.wikipedia.org/wiki/Å
Message 16 of 18
ronnyh%C3%A5
in reply to: Anonymous

Great 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
Message 17 of 18
Anonymous
in reply to: Anonymous


Unofortunately, I don't think there's a way to fill-in
specific

cells or ranges in a spreadsheet, but that could always
be

done by an Excel macro.


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Great
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
Message 18 of 18
andrew.nao
in reply to: Anonymous


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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost