.NET

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

Event Handler

99 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
Posts: 41
Registered: ‎04-27-2005
Message 2 of 5 (99 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
Posts: 41
Registered: ‎04-27-2005
Message 3 of 5 (99 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
Posts: 311
Registered: ‎07-29-2004
Message 4 of 5 (99 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
Posts: 41
Registered: ‎04-27-2005
Message 5 of 5 (99 Views)

Re: Event Handler

09-29-2005 07:26 AM in reply to: as
thanks, i will trie directly tommorow morning

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community