Esempio n. 1
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication application      = commandData.Application;
            UIDocument    activeUIDocument = application.ActiveUIDocument;
            Application   application2     = application.Application;
            Document      document         = activeUIDocument.Document;
            Selection     sel = activeUIDocument.Selection;

            Setting = SettingSelectCustom.Instance.GetSetting();
            using (var form = new FrmFilterCustom(this))
            {
                if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    if (form.check)
                    {
                        string name = form.Name;
                        var    col  = sel.PickElementsByRectangle(new SelectCustomfilter(name));
                        var    col2 = (from x in col select x.Id).ToList();
                        sel.SetElementIds(col2);
                        return(Result.Succeeded);
                    }
                    else
                    {
                        return(Result.Cancelled);
                    }
                }
                else
                {
                    return(Result.Cancelled);
                }
            }
        }
Esempio n. 2
0
        public SettingSelectCustom GetSetting()
        {
            SettingSelectCustom setting = SettingExtension.GetSetting <SettingSelectCustom>(GetFullFileName());

            if (setting == null)
            {
                setting = new SettingSelectCustom();
            }
            return(setting);
        }