opening multiple files in ACAD and making changes

opening multiple files in ACAD and making changes

Anonymous
Not applicable
336 Views
4 Replies
Message 1 of 5

opening multiple files in ACAD and making changes

Anonymous
Not applicable
Hi All,
Thank you for all your great suggestions.....They helped me.
Now I need some more of your expert suggestions.

I have this Array(named sFileArray) which stores the names of multiple files I select from a Dialog Box.Now I need to iterate through these files....i.e open each file & make modifications & then save them. I am not able to figure out how to do that.....
This is my code which I tried to write.....Please suggest correction to it.

Public Function OpenAcadInsert(ByRef sFileArray As Variant) As Boolean
Set objAcad = Application
Set objAcadDoc = objAcad.ActiveDocument
Set objAcadMs = objAcadDoc.ModelSpace
Dim i As Integer
Dim elem As Object
ThisDrawing.Application.Documents.Open (sFileArray)
For Each elem In ThisDrawing.ModelSpace
If Revision(Revnum, Date, DSN, CHK, APP, Revdes) = True Then 'function which is called to make changes to each open drawing
ThisDrawing.Close True
Else
ThisDrawing.Close False
End If
Next
OpenAcadInsert = mbool
End Function

Please help me with the code......
Thanks
Avantika
0 Likes
337 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Just because you open a drawing with the Open method does not mean that it
becomes ThisDrawing.

--
R. Robert Bell


wrote in message news:5212292@discussion.autodesk.com...
Hi All,
Thank you for all your great suggestions.....They helped me.
Now I need some more of your expert suggestions.

I have this Array(named sFileArray) which stores the names of multiple
files I select from a Dialog Box.Now I need to iterate through these
files....i.e open each file & make modifications & then save them. I am not
able to figure out how to do that.....
This is my code which I tried to write.....Please suggest correction to it.

Public Function OpenAcadInsert(ByRef sFileArray As Variant) As Boolean
Set objAcad = Application
Set objAcadDoc = objAcad.ActiveDocument
Set objAcadMs = objAcadDoc.ModelSpace
Dim i As Integer
Dim elem As Object
ThisDrawing.Application.Documents.Open (sFileArray)
For Each elem In ThisDrawing.ModelSpace
If Revision(Revnum, Date, DSN, CHK, APP, Revdes) = True Then
'function which is called to make changes to each open drawing
ThisDrawing.Close True
Else
ThisDrawing.Close False
End If
Next
OpenAcadInsert = mbool
End Function

Please help me with the code......
Thanks
Avantika
0 Likes
Message 3 of 5

Anonymous
Not applicable
Hi Robert,

Thanks for your suggestion..but I do not know what comes in its place. If possible can u give me the modified code for it.
I would appreciate you e help.

Thanks
Avantika
0 Likes
Message 4 of 5

Anonymous
Not applicable
This thread has some good sample projects attached.

http://discussion.autodesk.com/thread.jspa?messageID=5052607

good luck
0 Likes
Message 5 of 5

Anonymous
Not applicable
Look at the object model in the help files.

--
R. Robert Bell


wrote in message news:5212495@discussion.autodesk.com...
Hi Robert,

Thanks for your suggestion..but I do not know what comes in its place. If
possible can u give me the modified code for it.
I would appreciate you e help.

Thanks
Avantika
0 Likes