I have been using the following code to insert blocks from our library:
{code}
blkDWG = New DatabaseServices.Database
blkDWG.ReadDwgFile(myBlockPath, FileShare.Read, True, vbNullString)
AcadDoc.Database.Insert(BlockName, blkDWG, False)
blkDWG.Dispose()
{code}
For a small percentage of our standard blocks, this will fail at the Insert with the following errors: eOutOfRange, eDwgObjectImproperlyRead, or eFilerError
The remedy so far has been to copy/paste the entities from the bad file into our blank template and overwrite the bad file. I also tried inserting as an exploded block into a blank template and wblocking out and neither of those two methods worked.
However, I cannot copy/paste the entities from a dynamic block DWG into a blank drawing and maintain the dynamic block properties. I also have a couple of drawings that are blank and just contain layer definitions, etc. So I need another solution.
Any ideas would be appreciated... Thanks