Catching Autocad events with Delphi
Posted on 2006-11-09
I'm writing an application with dephi 5 that control Autocad 2005. In term of getting Autocad to draw what I need its working just fine but I would like my application to be notify when either an application or a document event is trigged like " Application activate" or "Begin save" . I read on the web that I have to write "an event sink generator" for which I need code example. For now my application crash when I try the following code :
AutoCADApplication := CreateOleObject('AutoCAD.Application')as IAcadApplication;
AutoCADApplication.Visible := true;
AcadDoc.ConnectTo(AutoCADApplication.ActiveDocument); // This is the problematic line....