Пример #1
0
        public SnS(Autodesk.Revit.UI.ExternalEvent exEvent,
                   ExternalEventHandler handler,
                   ModelessForms.Application thisApp)
        {
            InitializeComponent();

            m_ExEvent = exEvent;
            m_Handler = handler;
            ThisApp   = thisApp;

            //Initialize treeview path separator
            treeView1.PathSeparator = ".";

            //Log
            LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration("G:\\Github\\shtirlitsDva\\MyRevitAddins\\MyRevitAddins\\SetTagsModeless\\NLog.config");

            //Setup a rudimentary list with categories
            string[] cats = { "Pipes", "Pipe Fittings", "Pipe Accessories" };
            checkedListBox2.Items.Clear();
            checkedListBox2.Items.AddRange(cats);

            Grouping grouping = mySettings.Default.GroupingSettings;

            if (grouping != null)
            {
                Payload.Grouping = grouping;
            }

            //Initialize settings for categories
            if (mySettings.Default.SelectedCategories != null)
            {
                SelectedCategories = mySettings.Default.SelectedCategories;
                if (SelectedCategories.Count != 0)
                {
                    foreach (string cat in SelectedCategories)
                    {
                        SetItemChecked(cat, checkedListBox2);
                    }
                }
                Payload.CategoriesToSearch = SelectedCategories;

                //Request Revit for parameter information
                AsyncGatherParameterData asGPD = new AsyncGatherParameterData(Payload);
                ThisApp.asyncCommand = asGPD;
                m_ExEvent.Raise();
                Payload.GetParameterDataOperationComplete += GetParameterDataOperationComplete;
                button2.Text = "Loading parameter data...";
            }
        }
Пример #2
0
 /// <summary>
 /// "Edit Grouping" button pushed.
 /// </summary>
 private void button2_Click(object sender, EventArgs e)
 {
     if (Payload.AllParameterImpressions != null)
     {
         EditGroupingForm egf = new EditGroupingForm(
             Payload.AllParameterImpressions, Payload.Grouping);
         egf.ShowDialog();
         Payload.Grouping = egf.Grouping;
     }
     else
     {
         //Request Revit for parameter information
         AsyncGatherParameterData asGPD = new AsyncGatherParameterData(Payload);
         ThisApp.asyncCommand = asGPD;
         m_ExEvent.Raise();
         Payload.GetParameterDataOperationComplete += GetParameterDataOperationComplete;
         button2.Text = "Loading parameter data...";
     }
 }