VBA and Multiple dwg files

VBA and Multiple dwg files

Anonymous
Not applicable
566 Views
4 Replies
Message 1 of 5

VBA and Multiple dwg files

Anonymous
Not applicable
Hello,

Is there a method in VBA to work with multiple drawings programmatically?

I have approximately 800 files that I have to open by hand to update
values(Parcel ID numbers) based on values within each drawing. Rether than
open each drawing by hand, I'd prefer to handle under code control.

VBA doesn't seem to like opening and closing drawings very cleanly when
iterating through a list of file names. Would I be better to drop to full VB
and handle it there?

TIA

Tom
0 Likes
567 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Hi Tom,

Post the code you're using.

I've had no problems opening and closing files with VBA.

--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com
"Tom Homan" wrote in message
news:5763545@discussion.autodesk.com...
Hello,

Is there a method in VBA to work with multiple drawings programmatically?

I have approximately 800 files that I have to open by hand to update
values(Parcel ID numbers) based on values within each drawing. Rether than
open each drawing by hand, I'd prefer to handle under code control.

VBA doesn't seem to like opening and closing drawings very cleanly when
iterating through a list of file names. Would I be better to drop to full VB
and handle it there?

TIA

Tom
0 Likes
Message 3 of 5

Anonymous
Not applicable
Please describe more deails on "VBA doesn't seem to like opening and closing
drawings very cleanly".

If you are convinced on that, then full VB doesn't do any better than VBA in
Acad does.



"Tom Homan" wrote in message
news:5763545@discussion.autodesk.com...
Hello,

Is there a method in VBA to work with multiple drawings programmatically?

I have approximately 800 files that I have to open by hand to update
values(Parcel ID numbers) based on values within each drawing. Rether than
open each drawing by hand, I'd prefer to handle under code control.

VBA doesn't seem to like opening and closing drawings very cleanly when
iterating through a list of file names. Would I be better to drop to full VB
and handle it there?

TIA

Tom
0 Likes
Message 4 of 5

Anonymous
Not applicable
Never mind, fat fingers got the better of me. Thanks anyway. -t
"Tom Homan" wrote in message
news:5763545@discussion.autodesk.com...
Hello,

Is there a method in VBA to work with multiple drawings programmatically?

I have approximately 800 files that I have to open by hand to update
values(Parcel ID numbers) based on values within each drawing. Rether than
open each drawing by hand, I'd prefer to handle under code control.

VBA doesn't seem to like opening and closing drawings very cleanly when
iterating through a list of file names. Would I be better to drop to full VB
and handle it there?

TIA

Tom
0 Likes
Message 5 of 5

Anonymous
Not applicable
Hi:
I have used this macro. In this example I have a text file with path and
names of some drawings (c:\volumenes.txt).
This program open "volumenes.txt" and it catch the first file, open the
drawing, aply the function "adosmil", close drawing and open the next file,
this while volumenes.txt isn't eof.



Function adosmil()
camino = ThisDrawing.Path + "\acad2000\" + ThisDrawing.Name
ThisDrawing.SaveAs camino, ac2000_dwg
ThisDrawing.Close
End Function


Sub RepiteTarea()
procesoenlotex = "bai"
If procesoenlotex = "bai" Then
archivo = "c:\volumenes.txt"
Open archivo For Input As #1
Do
Input #1, reg
fichactual = LTrim(RTrim(reg))
ThisDrawing.Application.Documents.Open fichactual
adosmil
Loop Until EOF(1)
Else
adosmil
End If
MsgBox ("tarea terminada...")
Close #1
End Sub
"Tom Homan" escribió en el mensaje
news:5763545@discussion.autodesk.com...
Hello,

Is there a method in VBA to work with multiple drawings programmatically?

I have approximately 800 files that I have to open by hand to update
values(Parcel ID numbers) based on values within each drawing. Rether than
open each drawing by hand, I'd prefer to handle under code control.

VBA doesn't seem to like opening and closing drawings very cleanly when
iterating through a list of file names. Would I be better to drop to full VB
and handle it there?

TIA

Tom
0 Likes