Private Sub productionSheetsInSideDb(_templateFileName As String, _destinationFileName As String)
Dim acSideDb As New Database(False, True)
' Read the DWG (DWT?) into a side database
acSideDb.ReadDwgFile(_templateFileName, System.IO.FileShare.Read, True, "")
Using acTrans As Transaction = acSideDb.TransactionManager.StartTransaction()
' Get the Block table for the side database
Dim acBlockTbl As BlockTable = acTrans.GetObject(acSideDb.BlockTableId, OpenMode.ForRead)
' ModelSpace
Dim acmodelBlockTbl As BlockTableRecord = DirectCast(acTrans.GetObject(acBlockTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
'... more code here
End Using
acSideDb.SaveAs(_destinationFileName, DwgVersion.Current)
End Sub