Esempio n. 1
0
        private void btnPreview_Click(object sender, RoutedEventArgs e)
        {
            Document              document              = AfaDocData.ActiveDocData.Document;
            Editor                editor                = document.Editor;
            ResultBuffer          resultBuffer          = this.BuildSelectionFilter();
            SelectionFilter       selectionFilter       = new SelectionFilter(resultBuffer.AsArray());
            PromptSelectionResult promptSelectionResult = editor.SelectAll(selectionFilter);

            if (promptSelectionResult.Status == (PromptStatus)5100 && promptSelectionResult.Value.Count > 0)
            {
                ObjectId[] objectIds = promptSelectionResult.Value.GetObjectIds();
                editor.WriteMessage(string.Format("\n{0} entities found", objectIds.Length));
                editor.SetImpliedSelection(DocUtil.ExpandGroupObjectIds(document, objectIds));
            }
        }
        private void UpdateFromClass(Identify.IdentifyFeatureClassItem newItem)
        {
            Document document = AfaDocData.ActiveDocData.Document;

            using (document.LockDocument())
            {
                FCTag           tag = newItem.Tag;
                MSCFeatureClass activeFeatureClass = AfaDocData.ActiveDocData.SetActiveFeatureClass(tag.GetFeatureClass(AfaDocData.ActiveDocData.DocDataset));
                ArcGISRibbon.SetActiveFeatureClass(activeFeatureClass);
                ObjectId[] iDs    = newItem.IDs;
                Editor     editor = AfaDocData.ActiveDocData.Document.Editor;
                document.Editor.SetImpliedSelection(DocUtil.ExpandGroupObjectIds(AfaDocData.ActiveDocData.Document, iDs));
                ObjectIdCollection objectIds = null;
                if (iDs != null)
                {
                    objectIds = new ObjectIdCollection(iDs);
                }
                this.SetObjectIds(objectIds);
                editor.Regen();
            }
        }
 private void zoomToEntities()
 {
     try
     {
         Document document = AfaDocData.ActiveDocData.Document;
         Application.UseWaitCursor = true;
         document.Editor.SetImpliedSelection(DocUtil.ExpandGroupObjectIds(document, SelectByAttributesForm.oidsList.ToArray()));
         Utils.ZoomObjects(false);
         Application.UseWaitCursor = false;
         document.TransactionManager.QueueForGraphicsFlush();
         document.TransactionManager.FlushGraphics();
         document.Editor.UpdateScreen();
         AfaDocData.ActiveDocData.DocDataset.UpdateMaps();
     }
     catch (Exception ex)
     {
         if (SingletonsList.ed != null)
         {
             SingletonsList.ed.WriteMessage("\n" + AfaStrings.Error + " " + ex.Message);
         }
     }
 }
Esempio n. 4
0
        private void btnPreview_Click(object sender, RoutedEventArgs e)
        {
            Document     document     = AfaDocData.ActiveDocData.Document;
            Editor       editor       = document.Editor;
            ResultBuffer resultBuffer = this.BuildQueryResultBuffer();

            try
            {
                if (resultBuffer.AsArray().Count <TypedValue>() == 0)
                {
                    resultBuffer = new ResultBuffer(new TypedValue[]
                    {
                        new TypedValue(8, "*")
                    });
                }
            }
            catch
            {
                resultBuffer = new ResultBuffer(new TypedValue[]
                {
                    new TypedValue(8, "*")
                });
            }
            ResultBuffer          resultBuffer2         = MSCFeatureClass.BuildTypeQuery(this._FC.GeometryType, resultBuffer.AsArray());
            SelectionFilter       selectionFilter       = new SelectionFilter(resultBuffer2.AsArray());
            PromptSelectionResult promptSelectionResult = editor.SelectAll(selectionFilter);

            if (promptSelectionResult.Status == (PromptStatus)5100 && promptSelectionResult.Value.Count > 0)
            {
                ObjectId[] objectIds = promptSelectionResult.Value.GetObjectIds();
                editor.WriteMessage(string.Format("\n{0} entities found", objectIds.Length));
                editor.SetImpliedSelection(DocUtil.ExpandGroupObjectIds(document, objectIds));
                editor.UpdateScreen();
                return;
            }
            editor.WriteMessage(string.Format("\n{0}", AfaStrings.noEntitiesQuery));
        }