Error Message - Opening Invalid Files
Hey everyone,
When opening a invalid file, Bricscad shows an alert dialog. Is there a way to accept (by-pass) the message using code? I'm using the following C# code to open the file. With valid files it works just fine. The invalid files are not in other formats, they are corrupt DWG files.
public static void OpenDWG()
{
foreach (FileInfo file in DWGsSource)
{
DocumentCollection docCol = Application.DocumentManager;
try
{
docCol.Open(file.FullName, false);
docCol.CloseAll();
}
catch
{
//when opening an invalid file the catch is called,
//but only after manually click the button in the alert dialg
//It gotta go to catch block in an automatic way
}
}
}
When opening a invalid file, Bricscad shows an alert dialog. Is there a way to accept (by-pass) the message using code? I'm using the following C# code to open the file. With valid files it works just fine. The invalid files are not in other formats, they are corrupt DWG files.
public static void OpenDWG()
{
foreach (FileInfo file in DWGsSource)
{
DocumentCollection docCol = Application.DocumentManager;
try
{
docCol.Open(file.FullName, false);
docCol.CloseAll();
}
catch
{
//when opening an invalid file the catch is called,
//but only after manually click the button in the alert dialg
//It gotta go to catch block in an automatic way
}
}
}
0
Comments
-
maybe you can use db.ReadDwgFile first to test the file0