.NET

.NET

Reply
Distinguished Contributor
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 1 of 2 (165 Views)
Accepted Solution

Database.Filename return autosave filename .sv$

165 Views, 1 Replies
09-05-2013 12:12 PM

Hi, 

  here is my code 

 

public static class Active
{
    public static Document Document
    {
        get { return Application.DocumentManager.MdiActiveDocument; }
    }

    public static Database Database
    {
        get { return Document.Database; }
    }

    public static string Name
    {
        get { return Database.Filename; }
    }
}

 Active.Name some return the autosave filename, e.g. 

C:\Documents and Settings\Davisas\local settings\temp\TDB0157-006A-FP00_1_1_1030.sv$

the correct one should be

C:\Documents and Settings\Davisas\local settings\temp\TDB0157-006A-FP00.dwg

 

Is this a bug? how to avoid it? 

 

 

Thank you so much.

Wes

  

Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014

No bug... the database is after the autosave associated to the temp file... so the answer from the database is correct.

 

You should use the name of the document instead. This would give you the desired Information.

public static string Name
{
get { return Document.Name; }
}

 

Contributor
Matti72
Posts: 25
Registered: ‎09-28-2004
Message 2 of 2 (142 Views)

Re: Database.Filename return autosave filename .sv$

09-06-2013 02:18 AM in reply to: wesbird

No bug... the database is after the autosave associated to the temp file... so the answer from the database is correct.

 

You should use the name of the document instead. This would give you the desired Information.

public static string Name
{
        get { return Document.Name; }
}

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.