private void OnSelectedA(object sender, RoutedEventArgs e) { try { if (Results.SelectedItem != null) { var vRVTElement = (ClashItems)Results.SelectedItem; RevitTools.Focus(vRVTElement); } } catch { } }
private void IsolateElements_click(object sender, RoutedEventArgs e) { try { if (Results.SelectedItem != null) { var vRVTElement = (ClashItems)Results.SelectedItem; RevitTools.Focus(vRVTElement); RevitTools.IsolateSelectionTemporary(vRVTElement); } } catch { } }
public static void Execute(Document doc) { if (!MainUserControl._Reset) { var clashing = Clash.clashingElements(RevitTools.Doc, RevitTools.App); string format = new string('0', clashing.Count.ToString().Length); for (int i = 0; i < clashing.Count; i++) { var item = clashing[i]; item.Number = (i).ToString(format);; MainUserControl.elementsClashingA.Add(item); } RevitTools.OverrideInView(clashing, RevitTools.Doc); } else { RevitTools.OverrideInView(new List <Element>(), RevitTools.Doc); } }
private void Run_Click(object sender, RoutedEventArgs e) { this.Results.Items.Clear(); SaveConfiguration(); RevitTools.CropBox = RevitTools.GetCropBox(); StringCollection selectionACollection = Properties.Settings.Default.SelectionA; StringCollection selectionBCollection = Properties.Settings.Default.SelectionB; string validationMessage = string.Empty; bool validationFlag = false; // Validation of elements selected if (selectionACollection.Count == 0 || selectionBCollection.Count == 0) { validationFlag = true; validationMessage = "Both categories must have elements selected to check for clashes"; } if (ListOfLinks.SelectedItem == null) { validationFlag = true; validationMessage = "Select a document to do the clash detection"; } // If validationFlag is true. The validation dialog is showed. if (validationFlag) { TaskDialog.Show("Clash Detection", validationMessage, TaskDialogCommonButtons.Ok); return; } _Reset = false; //Save Selection SaveConfiguration(); _wasExecuted = false; var index = Properties.Settings.Default.ListOfLinks; var l = Clash.Documents(RevitTools.Doc, RevitTools.App); // Get document from select index FormTools.linkedDocument = l.Values[index]; FormTools.SelectedCategories = new List <ElementFilter>(); FormTools.SelectedHostCategories = new List <ElementFilter>(); //Categories var cat = FormTools.ListOfCategories(RevitTools.Doc); //Get categories from select index foreach (var i in Properties.Settings.Default.SelectionB) { int item = int.Parse(i); BuiltInCategory myCatEnum = (BuiltInCategory)Enum.Parse(typeof(BuiltInCategory), cat.Values[item].Id.ToString()); FormTools.SelectedCategories.Add(new ElementCategoryFilter(myCatEnum)); } //Get categories from select index foreach (var i in Properties.Settings.Default.SelectionA) { int item = int.Parse(i); BuiltInCategory myCatEnum = (BuiltInCategory)Enum.Parse(typeof(BuiltInCategory), cat.Values[item].Id.ToString()); FormTools.SelectedHostCategories.Add(new ElementCategoryFilter(myCatEnum)); //Saving the local categories for a new run } m_ExEvent.Raise(); }