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

How can I automatically get filename when open a dwg file ?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Jyh2003
387 Views, 2 Replies

How can I automatically get filename when open a dwg file ?

Is it possible to open a dwg file to add the filename into log file ? I don't want to click a button or command, and then get the filename.
2 REPLIES 2
Message 2 of 3
Keith.Brown
in reply to: Jyh2003

Yes,

 

You should monitor the DocumentCreated event of the DocumentCollection.  It should fire when a new drawing is either created or an existing drawing is opened.  Once that happens you can write the Database.FileName to a file.

 

AutoCAD Help File: http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-E619BB54-D531-4640-BB74-B61E6CA13238

 

Some extra information about Database.Filename:  http://forums.autodesk.com/t5/net/database-filename-return-autosave-filename-sv/td-p/4401703

 

How to write to a file c#: https://msdn.microsoft.com/en-us/library/8bh11f1k.aspx

 

Check if a newly created drawing has been named: http://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/AutoCA...

 

 

Message 3 of 3
Jyh2003
in reply to: Keith.Brown

Thanks for your help.

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