Esempio n. 1
0
        public static List <ObjectId> Select([NotNull] this Editor ed, string msg)
        {
            var selOpt = new PromptSelectionOptions();

            selOpt.Keywords.Add(AcadHelper.IsRussianAcad() ? "Все" : "ALL");
            selOpt.MessageForAdding = msg + selOpt.Keywords.GetDisplayString(true);
            var selRes = ed.GetSelection(selOpt);

            if (selRes.Status == PromptStatus.OK)
            {
                return(selRes.Value.GetObjectIds().ToList());
            }
            throw new OperationCanceledException();
        }
Esempio n. 2
0
        public static List <ObjectId> Select([NotNull] this Editor ed, string msg,
                                             Action <object, SelectionTextInputEventArgs> keywordInput, params string[] keywords)
        {
            var selOpt = new PromptSelectionOptions();

            selOpt.Keywords.Add(AcadHelper.IsRussianAcad() ? "Все" : "ALL");
            foreach (var keyword in keywords)
            {
                selOpt.Keywords.Add(keyword);
            }
            selOpt.MessageForAdding  = msg + selOpt.Keywords.GetDisplayString(true);
            selOpt.MessageForRemoval = "Исключить";
            selOpt.KeywordInput     += (o, e) => keywordInput(o, e);
            var selRes = ed.GetSelection(selOpt);

            if (selRes.Status == PromptStatus.OK)
            {
                return(selRes.Value.GetObjectIds().ToList());
            }
            throw new OperationCanceledException();
        }