Example #1
0
        CountHardReferences()
        {
            Snoop.ObjIdSet objSet = Snoop.Utils.GetSnoopSet();
            if (objSet == null)
            {
                return;
            }

            int[] countArray = new int[objSet.Set.Count];

            if (countArray.Length > 0)
            {
                objSet.Db.CountHardReferences(objSet.Set, countArray);
            }

            for (int i = 0; i < objSet.Set.Count; i++)
            {
                AcadUi.PrintToCmdLine(string.Format("\n{0,-30}: {1:d}", AcadUi.ObjToTypeAndHandleStr(objSet.Set[i]), countArray[i]));
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        private void DisplayMapItems()
        {
            System.Collections.IEnumerator iter = m_idMap.GetEnumerator();
            while (iter.MoveNext())
            {
                AcDb.IdPair pair = (AcDb.IdPair)iter.Current;

                try {
                    ListViewItem item = new ListViewItem(AcadUi.ObjToTypeAndHandleStr(pair.Key));
                    item.SubItems.Add(pair.Key.ToString());
                    item.SubItems.Add(pair.Value.ToString());
                    item.SubItems.Add(pair.IsCloned.ToString());
                    item.SubItems.Add(pair.IsPrimary.ToString());
                    item.SubItems.Add(pair.IsOwnerTranslated.ToString());
                    item.Tag = pair;
                    m_listViewMapItem.Items.Add(item);
                }
                catch (Autodesk.AutoCAD.Runtime.Exception e) {
                    MessageBox.Show("Couldn't add a pair from the map: " + e.Message);
                }
            }
        }