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

Database.Filename return autosave filename .sv$

1 REPLY 1
SOLVED
Reply
Message 1 of 2
wesbird
983 Views, 1 Reply

Database.Filename return autosave filename .sv$

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

  

Windows 10 64 bit, AutoCAD (ACA, Map) 2023
1 REPLY 1
Message 2 of 2
Matti72
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; }
}

 

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