//-------------------------------------------------------------------------------------------------------------------------------------------------------------- private void Custom_Select(object sender, RoutedEventArgs e) { try { Selection selection = uidoc.Selection; var element_list = selection.PickObjects(ObjectType.Element).Select(x => doc.GetElement(x)).ToList(); my_category = new ObservableCollection <data_category>(); my_family = new ObservableCollection <data_family>(); my_type = new ObservableCollection <data_type>(); my_parameters = new ObservableCollection <data_parameters>(); my_parameters_value = new ObservableCollection <data_parameters_value>(); F_GetCategory.distint_category(doc, my_category, thong_tin_category, element_list); F_GetFamily.distint_family(my_category, thong_tin_category, my_family, thong_tin_family); F_GetElementType.distint_type(my_family, thong_tin_family, my_type, thong_tin_type); F_GetParameters.distint_parameters(doc, my_type, thong_tin_type, my_parameters, thong_tin_parameter); F_GetParametersValue.distint_parameter_values(doc, my_parameters, thong_tin_parameter, my_parameters_value, gia_tri_parameter); All_Check(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//---------------------------------------------------------- private void Check_All_category(object sender, RoutedEventArgs e) { try { if (check_all_category.IsChecked == true) { my_category.ToList().ForEach(y => y.check = true); } else { my_category.ToList().ForEach(y => y.check = false); } } catch (Exception ex) { MessageBox.Show(ex.Message); } my_family = new ObservableCollection <data_family>(); F_GetFamily.distint_family(my_category, thong_tin_category, my_family, thong_tin_family); my_type = new ObservableCollection <data_type>(); F_GetElementType.distint_type(my_family, thong_tin_family, my_type, thong_tin_type); my_parameters = new ObservableCollection <data_parameters>(); F_GetParameters.distint_parameters(doc, my_type, thong_tin_type, my_parameters, thong_tin_parameter); my_parameters_value = new ObservableCollection <data_parameters_value>(); F_GetParametersValue.distint_parameter_values(doc, my_parameters, thong_tin_parameter, my_parameters_value, gia_tri_parameter); All_Check(); }
//--------------------------------------------------------- private void Filter_Parameter(object sender, RoutedEventArgs e) { my_parameters_value = new ObservableCollection <data_parameters_value>(); F_GetParametersValue.distint_parameter_values(doc, my_parameters, thong_tin_parameter, my_parameters_value, gia_tri_parameter); All_Check(); }
//--------------------------------------------------------- private void Filter_By_Family(object sender, RoutedEventArgs e) { my_type = new ObservableCollection <data_type>(); F_GetElementType.distint_type(my_family, thong_tin_family, my_type, thong_tin_type); my_parameters = new ObservableCollection <data_parameters>(); F_GetParameters.distint_parameters(doc, my_type, thong_tin_type, my_parameters, thong_tin_parameter); my_parameters_value = new ObservableCollection <data_parameters_value>(); F_GetParametersValue.distint_parameter_values(doc, my_parameters, thong_tin_parameter, my_parameters_value, gia_tri_parameter); All_Check(); }
//---------------------------------------------------------- private void Check_All_parameter(object sender, RoutedEventArgs e) { try { if (check_all_parameter.IsChecked == true) { my_parameters.ToList().ForEach(y => y.check = true); } else { my_parameters.ToList().ForEach(y => y.check = false); } } catch (Exception ex) { MessageBox.Show(ex.Message); } my_parameters_value = new ObservableCollection <data_parameters_value>(); F_GetParametersValue.distint_parameter_values(doc, my_parameters, thong_tin_parameter, my_parameters_value, gia_tri_parameter); All_Check(); }
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- private void Refesh(object sender, RoutedEventArgs e) { try { my_category = new ObservableCollection <data_category>(); my_family = new ObservableCollection <data_family>(); my_type = new ObservableCollection <data_type>(); my_parameters = new ObservableCollection <data_parameters>(); my_parameters_value = new ObservableCollection <data_parameters_value>(); F_GetCategory.distint_category(doc, my_category, thong_tin_category, new FilteredElementCollector(doc, doc.ActiveView.Id).WhereElementIsNotElementType().ToList()); F_GetFamily.distint_family(my_category, thong_tin_category, my_family, thong_tin_family); F_GetElementType.distint_type(my_family, thong_tin_family, my_type, thong_tin_type); F_GetParameters.distint_parameters(doc, my_type, thong_tin_type, my_parameters, thong_tin_parameter); F_GetParametersValue.distint_parameter_values(doc, my_parameters, thong_tin_parameter, my_parameters_value, gia_tri_parameter); All_Check(); e_refresh.Raise(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }