예제 #1
0
        ProcessObject(AcDb.Transaction trHelp, AcDb.ObjectId lookForObjId, AcDb.ObjectId curObjId)
        {
            AcDb.DBObject tmpObj = trHelp.GetObject(curObjId, AcDb.OpenMode.ForRead);
            if (tmpObj != null)
            {
                m_count++;
                ReferenceFiler filer = new ReferenceFiler();
                tmpObj.DwgOut(filer);                          // find out who this object owns

                RecordReferences(lookForObjId, tmpObj, filer); // record references for this object

                // now recursively visit all the objects this one owns
                for (int i = 0; i < filer.m_hardOwnershipIds.Count; i++)
                {
                    ProcessObject(trHelp, lookForObjId, filer.m_hardOwnershipIds[i]);
                }

                for (int i = 0; i < filer.m_softOwnershipIds.Count; i++)
                {
                    ProcessObject(trHelp, lookForObjId, filer.m_softOwnershipIds[i]);
                }
            }
            else
            {
                m_skipped++;
            }
        }
예제 #2
0
        References(string label, AcDb.ObjectId val)
            :   base(label)
        {
            m_val = val;

            if (m_val.IsNull == false)
            {
                using (TransactionHelper trHlp = new TransactionHelper(m_val.Database)) {
                    trHlp.Start();

                    AcDb.DBObject dbObj = trHlp.Transaction.GetObject(m_val, AcDb.OpenMode.ForRead);

                    MgdDbg.Utils.ReferenceFiler filer = new MgdDbg.Utils.ReferenceFiler();
                    dbObj.DwgOut(filer);

                    trHlp.Commit();

                    m_hardPointerIds   = filer.m_hardPointerIds;
                    m_softPointerIds   = filer.m_softPointerIds;
                    m_hardOwnershipIds = filer.m_hardOwnershipIds;
                    m_softOwnershipIds = filer.m_softOwnershipIds;
                }

                if ((m_hardPointerIds.Count == 0) && (m_softPointerIds.Count == 0) && (m_hardOwnershipIds.Count == 0) && (m_softOwnershipIds.Count == 0))
                {
                    m_hasRefs = false;
                }
                else
                {
                    m_hasRefs = true;
                }
            }
        }