Exemple #1
0
        public static AcObjectIds GetAllBlocks(this Editor ed, string blockName)
        {
            var res    = new AcObjectIds();
            var filter = GetBlockSelectionFilter(ed, blockName);
            var selRes = Ac.Editor.SelectAll(filter);

            if (selRes.Status == PromptStatus.OK)
            {
                res.AddItems(selRes.Value.GetObjectIds());
            }
            return(res);
        }
Exemple #2
0
        public static AcObjectIds GetBlocks(this Editor ed, params string[] blockNames)
        {
            //PromptEntityOptions peo = new PromptEntityOptions("Select blocks: ");
            //var res = Editor.GetEntity(peo);

            var res = new AcObjectIds();

            var filter = GetBlockSelectionFilter(ed, blockNames);
            PromptSelectionOptions promptOpt = new PromptSelectionOptions();

            promptOpt.MessageForAdding = "Select blocks:";

            PromptSelectionResult selRes = Ac.Editor.GetSelection(promptOpt, filter);

            if (selRes.Status == PromptStatus.OK)
            {
                res.AddItems(selRes.Value.GetObjectIds());
            }
            return(res);
        }
Exemple #3
0
 public void AddSelectedIds(AcObjectIds ids)
 {
     _selectedIds.AddItems(ids);
     OnPropertyChanged(nameof(HasSelectedBlocks));
     OnPropertyChanged(nameof(SelectedBlockCount));
 }