Message 1 of 6
ReadDwgFile - eFileSharingViolation
Not applicable
09-25-2007
11:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
A Question: I'm getting a eFileSharingViolation when I use the method "ReadDwgFile" if the selected drawing is open.
Is it not possible to use a open drawing with this method?
If so, any idea on a workaround for this?
A Caddie
A Question: I'm getting a eFileSharingViolation when I use the method "ReadDwgFile" if the selected drawing is open.
Is it not possible to use a open drawing with this method?
If so, any idea on a workaround for this?
using (DocumentLock docLock = Application.DocumentManager.MdiActiveDocument.LockDocument())
{
using (Database db = new Database(false, false))
{
db.ReadDwgFile(fname, System.IO.FileShare.Read, true, null);
using (Transaction t = doc.TransactionManager.StartTransaction())
{
ObjectId idBTR = doc.Database.Insert(BlockName, db, false);
t.Commit();
}
}
}
A Caddie