Here is a VB example
of traversing the BlockTable. As we have seen you can use the WorkingDatabase
of HostApplicationServices to get the database of the Active drawing. We then use the GetObject method of a
transaction. The argument for the ObjectId is the BlockTableId property of
the database. This will get us the BlockTable. We can then use a For each loop to get the
ObjectId of each BlockTableRecord in the BlockTable. We would then use the
BlockTableRecord to add entities or take some other action. |