DocumentCreateStarted event Name property is empty

DocumentCreateStarted event Name property is empty

Anonymous
Not applicable
667 Views
2 Replies
Message 1 of 3

DocumentCreateStarted event Name property is empty

Anonymous
Not applicable

Hi

 

I am opening a document by using Recent Document list of Autocad 2010.

I want to validate the file path of dwg before openning it, when i use the DocumentCreateStarted event of DocumentCollection and try to access the e.Document.Name for validation it shows an empty string. and if document is not available Autocad shows a message "Cannot find the specified drawing file....". i want to handle the event before this message and if file not avialble perform some other action rather than showing a messagebox.

 

Any help will be great

Thanks

0 Likes
668 Views
2 Replies
Replies (2)
Message 2 of 3

michael_robertson
Collaborator
Collaborator

How are you getting to the MRU list?

 

I'm assuming you have the filename before you try to open the document. If so you can use the .NET FileInfo class and use it's FileInfo.Exists method to see if the file exists before trying to open it.

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for your reply

 

I click the filename in recent documents list in Autocad Application Menu (Big A)which trigger the DocumentCreateStarted event where i want get the filepath from e.Document.Name property which is showing empty.

 

i dont have the filepath. thats wot i am tring to get at that point.

 

thanks

0 Likes