.NET

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

Event Handler

132 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 (132 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 (132 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 (132 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 (132 Views)

Re: Event Handler

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