2 Replies Latest reply on Nov 18, 2014 11:55 AM by mattd

    Sketch by features tool isn't stored

    Ondrej Fialik

      I use item from Features Tab. When i draw target feature and finished sketch, graphics is gone.

      If i use standard tool - click on target feature in Feature tab in TOC, everything is OK.

      Code:

      IMMAttributeAgent m_pAttributeAgent = m_editor.FindExtension("{C0A2A2D5-C440-11D3-BD54-00500462EE0B}") as MMAttributeAgent;

       

      IExtension featureTab = m_application.FindExtensionByName("FeatureTopLevel");

      MMFeatureTopLevel m_featTopLvl = featureTab as MMFeatureTopLevel;

       

      ID8List list = m_featTopLvl as ID8List;

      list.Reset();

      ID8ListItem m_pSelectionItem = list.Next();

      while (m_pSelectionItem != null)

      {

           if (m_pSelectionItem.ItemType == mmd8ItemType.mmd8itLayer)

           {

                ID8List subList = m_pSelectionItem as ID8List;

                subList.Reset();

                ID8ListItem targetItem = subList.Next();

                if (targetItem is minerFramework.Miner.Interop.IMMProposedObject)

                {

                      m_pAttributeAgent.Prepare(targetItem as minerFramework.Miner.Interop.IMMProposedObject, true);

                }

           }

           m_pSelectionItem = list.Next();

      }

       

      ArcGIS and ArcFM 10.2.1

       

      Thanks for help

        • Re: Sketch by features tool isn't stored

          Hi Ondrej,

           

          I wanted to let you know that I am trying to find someone to take a look at this and offer suggestions.

            • Re: Sketch by features tool isn't stored

              Hi Ondrej,

               

              One of the other devs had a look at your code and had a couple of comments.

               

              First is that the D8ListItem you're getting is actually another layer.  You need to go one level deeper, or do a search using a recursive function.

               

              Secondly, is that the following line is throwing an error that we can't troubleshoot without spending a lot of time working on.

              m_pAttributeAgent.Prepare(targetItem as minerFramework.Miner.Interop.IMMProposedObject, true);

              He suggests that he suspects "the issue is that the MMAttributeAgent is expecting the arrtibute editor to be the root node in the d8tree, but it's finding the feature tab top level which doesn't support the interface to prepare CUs.  I think he needs to copy the proposed object to the targets tab and prepare it from there."

               

              If you can't get your code working based on that, let's get GIS Support involved so we can officially dedicate some time to figuring out what is going on.