See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: puzzled! eWasOpenForWrite error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2012-09
    Posts
    2
    Login to Give a bone
    0

    Default puzzled! eWasOpenForWrite error

    hello,everybody!
    I get a error 'eWasOpenForWrite' in the code below, can anyone tell me how to tackle this problem?
    thanks.

    Code:
            private static void CheckInference(List<Solid3d> solids) {
                Database db = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
                using (Transaction tran = db.TransactionManager.StartTransaction()) {
                    BlockTable blockTable = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
                    BlockTableRecord blockRecord = tran.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
    
                    for (int i = 0; i < solids.Count - 1; i++) {
                        Solid3d solid1 = solids[i];
                        for (int j = i + 1; j < solids.Count; j++) {
                            Solid3d solid2 = solids[j];
                            if (solid1.Layer != solid2.Layer) {
                                if (solid1.CheckInterference(solid2)) {
                                    Solid3d copySolid1 = solid1.Clone() as Solid3d;
                                    copySolid1 .BooleanOperation(BooleanOperationType.BoolIntersect, solid2.Clone() as Solid3d);//------eWasOpenForWrite error occured here
                                    copySolid1 .ColorIndex = 1;
                                    blockRecord.AppendEntity(copySolid1 );
                                    tran.AddNewlyCreatedDBObject(copySolid1 , true);
                                    tran.Commit();
                                }
                            }
                        }
                    }
                }
            }
    Last edited by 289924688488291; 2012-09-11 at 07:39 AM.

Similar Threads

  1. eWasOpenForWrite
    By cadprog in forum Dot Net API
    Replies: 3
    Last Post: 2012-04-10, 08:51 AM
  2. Replies: 7
    Last Post: 2009-05-26, 04:51 PM
  3. eWasOpenForWrite
    By cristiandabu in forum Dot Net API
    Replies: 1
    Last Post: 2009-01-21, 08:11 PM
  4. Puzzled roof (warpped)
    By david_peterson in forum ACA General
    Replies: 10
    Last Post: 2008-02-29, 01:12 PM
  5. Puzzled by mpedit?
    By ddempsie in forum AutoCAD General
    Replies: 2
    Last Post: 2007-11-12, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •