.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bringing autocad events in C#

1 REPLY 1
Reply
Message 1 of 2
shajuspecial
1658 Views, 1 Reply

Bringing autocad events in C#

Hi All,
            In my C# windows application ,I am using autocad plugin..and trying to track autocad events in my .Net Application and succeeded to track the document activated and document destroyed events...and now i need to track the autocad save as dialoge box save event in my .Net application...for example  if one is saving a file in autocad ...then it will display "saved"  message box , that is from my .Net application
       anybody could help me.....my current code look like this

1 REPLY 1
Message 2 of 2
norman.yuan
in reply to: shajuspecial

Are you saying that you want to use an external EXE app to track events raised inside AutoCAD?

 

I read your code. It is just managed IExtensionApplication, which handles a few DocumentCollection events and save the some drawing information to database.

 

There are a few ways for the external world to be notified for these events occur inside AutoCAD:

 

1. Keep your IExtensionApplication plugin as is. That is, whenever the events happens, a record is written to dababase. Then create an app that either polls the database every a while (seconds/minutes) to see if there is new record saved; or with SQL Server2005/8, you can set up Notification Service to notify whenerver a new record is saved/updated.

 

2. Wrap up the events with your own events, and expose your code as COM-able. Then, use external app to communicate with AutoCAD via COM to subcribe your custom event.

 

3. Create an external .NET app to host a WCF service (it could be an Win form app, console, or better yet, a Windows service). In your IExtensionApplication, in the event handler, you make WCF service call. Then it is up to the WCF service app to do whatever you want (notification by email, save data to DB, shows a popup in the system tray...). In order to minimize the impact to AutoCAD due to runing code in the event handler, you can make one-way only service call to the WCF service. So the saving drawing data to db process would not happen inside the event handler, but on the service side.

 

As developer, I'd like to do 3, which I'd have more control as what to do.

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost