How i can hook into BeginDwgOpen event of autocad.

How i can hook into BeginDwgOpen event of autocad.

Anonymous
Not applicable
1,204 Views
2 Replies
Message 1 of 3

How i can hook into BeginDwgOpen event of autocad.

Anonymous
Not applicable

Hi

 i am tring to open a document from recent documents list of Autocad and want to hook into BeginDwgOpen to access the full path of the dwg before opening it.

 

 or is there any other way to achive this.

 

Any Help will be great.

Thanks

0 Likes
1,205 Views
2 Replies
Replies (2)
Message 2 of 3

Norman_Yuan
Mentor
Mentor

Since you post in .NET group, I assume your interest in in ACad's .NET API.

 

Unfortunately, there is not event called BeginDwgOpen for you to hook up to.

 

The DocumentCollection class has DocumentCreated/DocumentCreatedStarted event that might be of your interest. If they are, then something like:

 

DocumentCollection docManager=Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;

docManager.DocumentCreateStarted += new DocumentCollectionEventHandler(Doc_CreateStarted);

 

void Doc_CreateStarted(object sender, DocumentCollectionEventArgs e)

{

    string fileName=e.Document.Name;

}

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi thasnks for your reply

 

I am using the DocumentCreateStarted method but the Name property of e.Document is empty. is ther any other way to get file path before opening it.

 

thanks

 

0 Likes