Message 1 of 4
documentcollection ??
Not applicable
03-01-2011
06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi to everybody,
i'm pretty new to .NET customization for AutoCAD, i've just made some small VBA tools for previous ACAD versions, so i hope somebody could help me with my problem ![]()
I have a Form with a "combobox" and i want to assign the names of the opened DWG's to that "combobox".
In an old VBA tool i'm using that code:
Dim DWGCount As Integer
DWGCount = ThisDrawing.Application.Documents.Count
Dim mThisDwgName As String
mThisDwgName = ThisDrawing.Name
Dim DWGIndex As Integer
Dim mDwgName As String
For DWGIndex = 0 To DWGCount - 1
mDwgName = ThisDrawing.Application.Documents(DWGIndex).Name
If mThisDwgName <> mDwgName Then Me.cmbDWGSelection.AddItem.mDwgName
Next DWGIndex
and in .NET ;
Dim DWGCount As Integer = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Count
Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim mThisDWGName As String
Dim DWGindex As Integer
Dim mDWGName As String
mThisDWGName = acDoc.Name
For DWGindex = 0 To DWGCount - 1
mDWGName = XXX (i dodnt know, what to do here....)
If mThisDwgName <> mDwgName Then cmbModelDwg.Items.Add(mDwgName)
Next
as you can see, i dont know, how to get the opend drawings, to iterate them and get the name.....
Greetings
Manuel