Using RealDWG 2013, I was having a problem reading a DWG file with Raster Attachments.
RasterImageDef imgDef = Tx.GetObject((ObjectId)imageEntry.Value, OpenMode.ForRead) as RasterImageDef;
was returning null.
I used the workaround mentioned here
it worked for me.
I did not have this problem with RealDwg 2012, so I'm not sure what changed.