Active Contributor
33 Posts
0 Kudos
Registered: ‎07-26-2005
Post 1 of 1

handling events from dll

67 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

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

Dim drawing As AcadDocument
For Each drawing In ThisDrawing.Application.Documents
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)
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

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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post