Message 1 of 7
Do anonymous blocks need to be handled specially?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have some old code that I did not write that I am trying to understand. The basic idea is
Select blocks in model space
Recursively go through each block reference and look for a block that matches a name
count it
there is a part after the selection has been made where they do this
BlockTableRecord Abtr = new BlockTableRecord();
try
{Abtr = (BlockTableRecord)Trans.GetObject(br.AnonymousBlockTableRecord, OpenMode.ForRead);}
catch
{Abtr = (BlockTableRecord)Trans.GetObject(br.BlockTableRecord, OpenMode.ForRead);}
I'm wondering how neccessary it is to handle anonymous blocks seperately, as when I place a block and select it to process I see that it's BlockTableRecord property is the same as the AnonymousBlockTableRecord property?
What exactly are anonymous blocks, and do I need to treat them special in the code?