now i can get the anonymous blockname like 'uxxx', but i want to know the original block name before the insert changed to an anonymous block.
ps,the block is not a dynamic block.
Solved! Go to Solution.
You can use BlockReference.DynamicBlockTableRecord to open the BlockTableRecord and get its name property but if it is not dynamic not sure how that will help.
This has been asked before, something like this should help:
Public Shared Function GetEffectiveName(ByVal blkref As BlockReference, ByVal acTrans As Transaction) As String Dim btr As BlockTableRecord btr = acTrans.GetObject(blkref.DynamicBlockTableRecord, OpenMode.ForRead) Return btr.Name End Function
I think you should take a look to the developer documentation, this link will help you to understand the object hierarchy in AutoCAD: Hierarchy
May be I'm wrong, but I think you can't create create a dynamic block definition with .NET API. Another thing is a block reference, and there is no problem creating one and driving its parameters with the .NET API.
i attached the dwg file
the block name contains "ISO A1"
and the block description contains "ISO A1" too
i just want to get the blockreforence which contains 'ISO A1" , by block name or by block descrption.
I don't know how it is possible to get this kind of non-dynamic anonymous block table record...
Anyway, you can get the block table record description using the BlockTableRecord.Comments property.