public static void Check(IEnumerable idsBlRefs, HashSet<string> ignoreBlocks)
        {
            curDepth = 0;
            _ignoreBlocks = ignoreBlocks;
            Database db = HostApplicationServices.WorkingDatabase;
            _errors = new List<Error>();
            attemptedblocks = new HashSet<ObjectId>();
            AllDublicBlRefInfos = new List<BlockRefDublicateInfo>();
            dictBlRefInfos = new Dictionary<string, Dictionary<PointTree, List<BlockRefDublicateInfo>>>();
            try
            {
                using (var t = db.TransactionManager.StartTransaction())
                {

                    if (idsBlRefs == null)
                    {
                        var ms = SymbolUtilityServices.GetBlockModelSpaceId(db).GetObject(OpenMode.ForRead) as BlockTableRecord;
                        idsBlRefs = ms;
                    }
                    GetDublicateBlocks(idsBlRefs, Matrix3d.Identity, 0);
                    t.Commit();
                }

                // дублирующиеся блоки
                AllDublicBlRefInfos = dictBlRefInfos.SelectMany(s => s.Value.Values).Where(w => w.Count > 1)
                                        .SelectMany(s => s.GroupBy(g => g).Where(w => w.Skip(1).Any()))
                                        .Select(s =>
                                           {
                                               var bi = s.First();
                                               bi.CountDublic = s.Count();
                                               bi.Dublicates = s.Skip(1).ToList();
                                               return bi;
                                           }).ToList();

                // Добавление дубликатов в результирующий список
                //AddTransformedToModelDublic(dublicBlRefInfos);
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex, $"CheckDublicateBlocks - {db.Filename}. {ex.StackTrace}");
                return;
            }

            if (AllDublicBlRefInfos.Count == 0)
            {
                Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nДубликаты блоков не найдены.");
            }
            else
            {
                foreach (var dublBlRefInfo in AllDublicBlRefInfos)
                {
                    Error err = new Error($"Дублирование блоков '{dublBlRefInfo.Name}' - {dublBlRefInfo.CountDublic} шт. в точке {dublBlRefInfo.Position.ToString()}",
                       dublBlRefInfo.IdBlRef, dublBlRefInfo.TransformToModel, System.Drawing.SystemIcons.Error);
                    err.Tag = dublBlRefInfo;
                    _errors.Add(err);
                }
            }

            if (_errors.Count>0)
            {
                var formDublicates = new FormError(_errors, true);
                formDublicates.Text = "Дублирование блоков";
                formDublicates.EnableDublicateButtons();
                if (Application.ShowModalDialog(formDublicates) != System.Windows.Forms.DialogResult.OK)
                {
                    formDublicates.EnableDialog(false);
                    Application.ShowModelessDialog(formDublicates);
                    throw new Exception("Отменено пользователем.");
                }
            }
        }