.NET

Reply
Active Contributor
inner
Posts: 33
Registered: ‎07-26-2005
Message 1 of 1 (64 Views)

handling events from dll

64 Views, 0 Replies
07-26-2005 11:11 AM
im developing a NET dll working as COM (using usual autocad library, not managed code cos it must work on acad2004)

i have writte code to let user change active document selecting its name from a combobox list

[CODE]
xAcad = GetObject(, "AutoCAD.Application.16")
ThisDrawing = xAcad.ActiveDocument

Dim drawing As AcadDocument
For Each drawing In ThisDrawing.Application.Documents
ComboBoxDibujos.Items.Add(drawing.Name)
Next drawing
ComboBoxDibujos.SelectedText = ThisDrawing.Name
sDocumentoActivo = ThisDrawing.Name
....
Private Sub ButtonCambiarDibujo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCambiarDibujo.Click

ThisDrawing = xAcad.Application.Documents.Item(sDocumentoActivar)
ThisDrawing.Application.Documents.Item(sDocumentoActivar).Activate()
sDocumentoActivo = ThisDrawing.Name
End Sub

Private Sub ComboBoxDibujos_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxDibujos.SelectedIndexChanged
sDocumentoActivar = ComboBoxDibujos.Text
End Sub
[/CODE]

but, lets suppose the user add or close a drawing, so i must catch this event and reset and fill again the combobox items list

how could i do this? anyone have tried?

thanks in advance
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.