public IdentifyFeatureClassItem(MSCFeatureClass fc, ObjectIdCollection ids) { this.Name = fc.Name; this.Tag = new FCTag(fc); this.IDs = fc.GetFeatureIds(ids); this.SubtypeItems = Identify.BuildSubtypeItems(fc, this.IDs); }
private void OnSelect(object sender, RoutedEventArgs e) { DocumentCollection documentManager = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager; if (documentManager.MdiActiveDocument == null) { return; } Editor editor = documentManager.MdiActiveDocument.Editor; this.currentObjectIds = null; editor.SetImpliedSelection(new ObjectId[0]); base.Close(); PromptSelectionOptions promptSelectionOptions = new PromptSelectionOptions(); promptSelectionOptions.AllowDuplicates = (false); promptSelectionOptions.MessageForAdding = (AfaStrings.MSG_SELECT_OBJECTADDED); promptSelectionOptions.MessageForRemoval = (AfaStrings.MSG_SELECT_OBJECTSKIPPED); PromptSelectionResult selection = editor.GetSelection(promptSelectionOptions); if (selection.Status == (PromptStatus)(-5002)) { editor.WriteMessage(AfaStrings.CommandCancelled); return; } if (selection.Status == (PromptStatus)5100) { SelectionSet selectionSet = selection.Value; if (selectionSet.Count <= 0) { editor.WriteMessage(AfaStrings.NoFeaturesFound); return; } ObjectId[] objectIds = selectionSet.GetObjectIds(); if (objectIds != null) { Identify identify = new Identify(new ObjectIdCollection(selectionSet.GetObjectIds())); Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowModalWindow(null, identify, false); return; } } else { editor.WriteMessage(AfaStrings.NoFeaturesFound); } }
private static Dictionary <string, Identify.IdentifyFeatureClassItem> GetFeatureClasses(ObjectIdCollection ids) { if (ids == null) { return(Identify.GetFeatureClasses()); } if (ids.Count == 0) { return(Identify.GetFeatureClasses()); } Dictionary <string, Identify.IdentifyFeatureClassItem> result; if (ids.Count > AfaDocData.ActiveDocData.DocDataset.FeatureClasses.Count + AfaDocData.ActiveDocData.DocDataset.FeatureServices.Count) { result = Identify.SearchByFC(ids); } else { result = Identify.SearchByID(ids); } return(result); }
private void PopulateFeatureClassPicker(MSCFeatureClass currentTopFC, MSCFeatureClass currentSubtype, ObjectIdCollection ids) { try { System.Windows.Forms.Application.UseWaitCursor = true; Dictionary <string, Identify.IdentifyFeatureClassItem> featureClasses = Identify.GetFeatureClasses(ids); this.FeatureClassComboBox.ItemsSource = featureClasses; bool flag = false; if (currentTopFC != null) { int num = 0; foreach (KeyValuePair <string, Identify.IdentifyFeatureClassItem> current in featureClasses) { if (current.Value.Name == currentTopFC.Name) { this.FeatureClassComboBox.SelectedIndex = num; flag = true; break; } num++; } } if (!flag) { this.FeatureClassComboBox.SelectedIndex = 0; } this.PopulateSubtypeClassPicker(((KeyValuePair <string, Identify.IdentifyFeatureClassItem>) this.FeatureClassComboBox.SelectedItem).Value, currentSubtype); System.Windows.Forms.Application.UseWaitCursor = false; } catch (SystemException ex) { System.Windows.Forms.Application.UseWaitCursor = false; string arg_BE_0 = ex.Message; } }