Access to entities inside block objects

How to access to entities inside block objects

Issue: How to access to entities inside block objects (CADNET-552).

Tips: To do this, you need to access the entities inside the block objects, you need to access the blocks in the drawing, then you need to use the CadBlockEntity class to access.

Example:

using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName)))
{
for (int i = 0; i < cadImage.Entities.Length; i++)
{
if (cadImage.Entities[i].TypeName == CadEntityTypeName.INSERT)
{
CadBlockEntity block = cadImage.BlockEntities[(cadImage.Entities[i] as CadInsertObject).Name];
foreach (CadBaseEntity baseEntity in block.Entities)
{
System.Console.WriteLine("Type = " + baseEntity.TypeName);
}
}