Example #1
0
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;

            uidoc = uiapp.ActiveUIDocument;
            Application app = uiapp.Application;

            doc = uidoc.Document;
            Selection sel = uidoc.Selection;

            listinstance = FilterelementByMark(doc);
            list3d       = Get3Dview(doc);
            Setting      = SettingSelecelementbymark.Instance.GetSetting();
            //FrmSelectByMark form = new FrmSelectByMark(this, doc);
            //form.ShowDialog();
            using (FrmSelectByMark form = new FrmSelectByMark(this, doc))
            {
                if (form.ShowDialog() == false)
                {
                    if (form.ids.Count != 0)
                    {
                        sel.SetElementIds(form.ids);
                        ICollection <ElementId> elementIds = new List <ElementId>();
                        Showview(doc, form.ids, form._view3d);
                    }
                }
            }
            return(Result.Succeeded);
        }
Example #2
0
        public SettingSelecelementbymark GetSetting()
        {
            SettingSelecelementbymark setting = SettingExtension.GetSetting <SettingSelecelementbymark>(GetFullFileName());

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