.NET

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

handling events from dll

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

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.