.NET

Reply
Active Contributor as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 1 of 5 (136 Views)

Event Handler

136 Views, 4 Replies
09-20-2005 03:01 AM
I want to create a Event Handler wich starts a routine when a drawing is opened or a new one is created. The .NET dll is loaded with the acad.lsp.

Can somebody give me a hint how to get this started ?

Harold van Aarsen
Active Contributor as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 2 of 5 (136 Views)

Re: Event Handler

09-20-2005 05:20 AM in reply to: as
This is the code I have created till now:
It gets loaded, give no error on the try, but still gives no response. what can be the error. The promptMessage is a routine that writes to the commandline of autocad.

#Region " Event Handlers "

Friend Function Set_Handlers() As Boolean
Dim db As Database = HostApplicationServices.WorkingDatabase

Try
AddHandler db.DwgFileOpened, New DatabaseIOEventHandler(AddressOf objDwgFileOpened)
PromptMessage("DwgFileOpened Handler added")
Return True

Catch ex As Exception
Message(ex.ToString)
Return False

End Try

End Function

Sub objDwgFileOpened(ByVal sender As Object, ByVal e As DatabaseIOEventArgs)
PromptMessage("Drawing opened !")
End Sub

#End Region
Active Contributor as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 3 of 5 (136 Views)

Re: Event Handler

09-29-2005 03:16 AM in reply to: as
Is there really no one who can help me out, maybe someone who is programming in C# ?

Harold
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 4 of 5 (136 Views)

Re: Event Handler

09-29-2005 07:20 AM in reply to: as
Try looking at the ObjecARx2006\samples\dotnet\EventsWatcher sample.

That will show you how to handle all events, but it is in C#.
Active Contributor as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 5 of 5 (136 Views)

Re: Event Handler

09-29-2005 07:26 AM in reply to: as
thanks, i will trie directly tommorow morning
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.