Try this:
public string GetBlockName(ObjectId idRef)
{
using (Transaction t =
idRef.Database.TransactionManager.StartTransaction())
{
BlockReference bref = (BlockReference)t.GetObject(idRef,
OpenMode.ForRead);
BlockTableRecord btr =
(BlockTableRecord)t.GetObject(bref.BlockId,OpenMode.ForRead);
return btr.Name;
}
}
wrote in message news:4956854@discussion.autodesk.com...
Hi,
For some reason, "BlockTableRecord" is not listed as a method or member
variable of my block reference by Visual Studio. Is it possible that I
don't have the correct namespace added? For this reason, I thought I must
be doing something wrong.
In spite of this, I made it unitBREF.BlockTableRecord and it works great!
Thanks very much for your help.
-Carlos