BlockTableRecord tBlock = (BlockTableRecord) bTable["RoomID"].GetObject(OpenMode.ForWrite);
BlockReference newRef = new BlockReference(refPoint, tBlock.ObjectId);
tBlock.AppendEntity(newRef);
trans1.AddNewlyCreatedDBObject(newRef, true);
The above lines of code (ignoring the other property stuff in between) insert the RoomID block into the RoomID block.
Open a Write reference to the block ModelSpace, and do ModelSpace.AppendEntity(newref) instead of tblock.append.
Well, I'm assuming you have a trans1.commit below there somewhere, right? Otherwise it looks like it should work. Have you stepped through it to see that there are attributes in the collection?
I am attaching an example I clipped out of my code (and ran through a c# converter, since I use vb). It is a Sub which sets the Textstring of a single attribute when passed the ObjectID of the BlockReference, the Tag of the AttributeReference to set, and the string to set to the TextString property. You should be able to use it to see where you went wrong, or modify it to suit your purpose, otherwise you'll need to post the whole method in question so I (or anyone else here) can try and track down the problem.
Edited by: chiefbraincloud on Apr 29, 2009 1:36 PM
I just noticed the conversion to c# added a comment that says it changed my 'Exit For' to 'Break', so I think you need to fix that.