Example #1
0
        public static void DeleteAll()
        {
            DeleteToolObject();
            App.LockAndExecute(() =>
            {
                ClearHighlighted();
                var layerTable = HostApplicationServices.WorkingDatabase.LayerTableId.QOpenForRead <SymbolTable>();
                HostApplicationServices.WorkingDatabase.Clayer = layerTable["0"];
                DeleteByLayer(layerTable, ProcessLayerName);
                DeleteByLayer(layerTable, HatchLayerName);
                DeleteByLayer(layerTable, GashLayerName);
                DeleteByLayer(layerTable, ExtraObjectsLayerName);
            });

            void DeleteByLayer(SymbolTable layerTable, string layerName)
            {
                if (layerTable.Has(layerName))
                {
                    var ids = QuickSelection.SelectAll(FilterList.Create().Layer(layerName));
                    if (ids.Any())
                    {
                        ids.QForEach(entity => entity.Erase());
                    }
                    layerTable[layerName].Erase();
                }
            }
        }
Example #2
0
        //public static void HideExtraObjects(IEnumerable<Curve> curves)
        //{
        //    curves.ForEach(p => p.Visible = !p.Visible);
        //    DeleteToolObject();
        //    Editor.UpdateScreen();
        //    //Interaction.SetActiveDocFocus();
        //}

        public static void DeleteByLayer(string layerName)
        {
            App.LockAndExecute(() =>
            {
                var ids = QuickSelection.SelectAll(FilterList.Create().Layer(layerName));
                if (ids.Any())
                {
                    ids.QForEach(entity => entity.Erase());
                }
            });
        }
Example #3
0
        // 点击确定按钮
        private void btnOk_Click(object sender, EventArgs e)
        {
            string[] list = new string[clb.CheckedItems.Count];
            // 将列表复选框的所有选中项 复制到 数组中
            clb.CheckedItems.CopyTo(list, 0);
            FilterList filterList = FilterList.Create().Layer(list);
            var        ids        = QuickSelection.SelectAll(filterList).ToArray();

            // 通过 ids 设置对象为选中状态
            InteractionUtil.SetPickSet(ids);
            // 关闭对话框
            DialogResult = DialogResult.OK;
            Close();
        }