Beispiel #1
0
        ProcessEntities()
        {
            // get all blocks that aren't from Xrefs
            ObjectIdCollection blkRecIds = m_trHlp.CollectBlockIds(false, false, false, true);

            DwgStats.BlockCount tmpBlkCount = null;
            DwgStats.ObjCount   tmpObjCount = null;

            // walk through all the block defs and count entities within them
            foreach (ObjectId blkRecId in blkRecIds)
            {
                tmpBlkCount = GetEntityNode(blkRecId, true);
                if (tmpBlkCount != null)
                {
                    BlockTableRecord blkRec = (BlockTableRecord)m_trHlp.Transaction.GetObject(blkRecId, OpenMode.ForRead);
                    foreach (ObjectId tmpEntId in blkRec)
                    {
                        Entity ent = (Entity)m_trHlp.Transaction.GetObject(tmpEntId, OpenMode.ForRead);
                        tmpObjCount = tmpBlkCount.GetCount(GetObjClassName(ent), ent.GetType().Name, true);

                        // if it has an extension dictionary, record its id so we can process it later
                        ObjectId extDictId = ent.ExtensionDictionary;
                        if ((extDictId.IsNull == false) && (extDictId.IsErased == false))
                        {
                            m_extDictIds.Add(extDictId);
                        }

                        if (tmpObjCount != null)
                        {
                            tmpObjCount.m_count++;
                        }
                    }
                }
            }
        }