AutoCAD Architecture - Select Attribute nested within Multi View Block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to select an attribute that is nested within a block and this (the block) is in turn nested within the multi view block.
I tried with PromptNestedEntityOptions and GetNestedEntity. I expected the block to return but, the entity returned is the multi view block itself and GetContainers always returns empty.
The code I have is minimal because I haven't been able to proceed yet.
var opt = new PromptNestedEntityOptions("\nSelect an attribute:");
var res = ed.GetNestedEntity(opt);
if (res.Status != PromptStatus.OK)
return;
using (var tran = res.ObjectId.Database.TransactionManager.StartTransaction())
{
var ent = (Entity)tran.GetObject(res.ObjectId, OpenMode.ForRead); // always return the multi view block reference
if (entId.ObjectClass.DxfName.ToUpper() != "ATTRIB")
{
var ids = res.GetContainers();
if (ids.Length > 0) // always is empty
{
// .......
}
}
tran.Commit();
}
If anyone can hel I am grateful. 😀
Link copied