protected override Result RunCommand(RhinoDoc doc, RunMode mode) { if (Panel_TagManager.CurrentFilter == null) { #if RhinoV5 Rhino.UI.Dialogs.ShowMessageBox("Current filter is not set.", "Cannot Save Filter"); #elif RhinoV6 Rhino.UI.Dialogs.ShowMessage("Current filter is not set.", "Cannot Save Filter"); #endif return(Result.Nothing); } string filterName; using (GetString getter = new GetString()) { getter.AcceptString(true); getter.SetCommandPrompt("Enter a name for the current filter"); if (getter.Get() != GetResult.String) { RhinoApp.WriteLine("Invalid Input"); return(getter.CommandResult()); } filterName = getter.StringResult(); } string filterText = Panel_TagManager.CurrentFilter.ToString(); if (Panel_TagManager.SavedFilters.ContainsKey(filterName)) { Panel_TagManager.SavedFilters[filterName] = filterText; } else { Panel_TagManager.SavedFilters.Add(filterName, filterText); } TagUtil.AddSavedFiltersToDocument(doc); doc.Modified = true; return(Result.Success); }