n8wex
2009-09-15, 12:57 PM
Im using the DB.WblockCloneObjects which works fine if i set the new active doc.
When I run the code without setting the active document the objects only display after I close and reopen the drawing. Is there an update method Im missing?
Using acLckDoc As DocumentLock = objDoc.LockDocument()
Using acTrans1 As Transaction = acDB.TransactionManager.StartTransaction()
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans1.GetObject(acDB.BlockTableId, OpenMode.ForRead)
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans1.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForRead)
Dim acIdMap As IdMapping = New IdMapping()
acCurDb.WblockCloneObjects(acObjIdColl, acBlkTblRec.ObjectId, acIdMap, DuplicateRecordCloning.Ignore, False)
acTrans1.Commit()
End Using
End Using
objDoc is open but not active.
Thanks.
When I run the code without setting the active document the objects only display after I close and reopen the drawing. Is there an update method Im missing?
Using acLckDoc As DocumentLock = objDoc.LockDocument()
Using acTrans1 As Transaction = acDB.TransactionManager.StartTransaction()
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans1.GetObject(acDB.BlockTableId, OpenMode.ForRead)
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans1.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForRead)
Dim acIdMap As IdMapping = New IdMapping()
acCurDb.WblockCloneObjects(acObjIdColl, acBlkTblRec.ObjectId, acIdMap, DuplicateRecordCloning.Ignore, False)
acTrans1.Commit()
End Using
End Using
objDoc is open but not active.
Thanks.