Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks to @CADbloke 's CADtest, I seem to be able to get Civil 3D automated testing to work! But now I have an issue though, in my test case, I need to load the existing drawing content to the database at the active MDI Document via the method ReadDwgFile.
protected void RunTestAction(string drawingPath, Action<Database> action)
{
Assert.IsTrue(File.Exists(drawingPath));
Document doc = Application.DocumentManager.MdiActiveDocument;
using (doc.LockDocument())
{
using (var db = new Database(false, false))
{
db.ReadDwgFile(drawingPath, FileOpenMode.OpenForReadAndWriteNoShare, true, null);
using (new WorkingDatabaseSwitcher(db))
{
action(db); //this is where the testing and Assert occurs
}
}//database
}//lock document
}
My issue is that is there anyway to clear the database properly after I ReadDwgFile ( and do the necessary testing)? This is so that the Document's Database will be reset to the original state, so that it can be used for the next test case.
##########
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Solved! Go to Solution.