1 Reply Latest reply on Nov 24, 2017 2:33 PM by Julien Losier

    .GetSpecificFeature2() return null when head component  not selected

    Julien Losier

      Hello there,

       

      I have an issue when going through my features. When using my head assembly no problem i can get all my component  create my tree in my addin.

       

      However when using a Sub-élément I get an error because my GetSpecificFeature2() return a null

       

       

       

      it saw this post : Get Child Component

      and It seems related to the same issue but im  not sure about it.

       

      I also made this in the beginning of the year traverse assembly and keep the order (c#)

       

      The order of the elements is very important for me. This is why i m using feature and not GetRootComponent3().

       

      Thank you.

        • Re: .GetSpecificFeature2() return null when head component  not selected
          Julien Losier

          hooooo I did something interesting that seems to fix my issue

           

                              if (rootFeature.GetTypeName2() == "Reference")

                              {

                                  rootFeature.Select2(false, 0);

                                  var selMgr = (ISelectionMgr)model.SelectionManager;

                                  root = selMgr.GetSelectedObject6(1, -1) as Component2;

                                  head = true;

                              }

          I'm forcing a new selction and set it as my root component seems to do the trick.

           

          Hope it will help someone.