6 Replies Latest reply on May 12, 2014 10:19 AM by Robert Owens

    SelectByID2 not selecting origin

    Robert Owens

      Structure:

      <assembly>

           <comp1>

                <origin>

                <plane1>

                <plane2>

           <comp2>

       

      I am trying to traverse the feature tree to measure the X,Y,Z distance between each component reference geometry feature and that component's origin.

       

      swFeature->Select2(false, 0, &result); // CComPtr<IFeature> object to select current feature in traversal

      swDocExtension->SelectByID2(L"Point1@Origin@<comp1>@>assembly>", L"EXTSKETCHPOINT", 0, 0, 0, false, 0, NULL, &result);

       

      Line 2 returns 0 every time and I am not sure why. If I manually launch the measure tool and select the origin I want it returns the path/name I specified above. If I run the macro recorder and select the origin it returns the same code as line 2 as well.

       

      Also, I am calling swModel->ClearSelection2() after every 2 selections, but it isn't erasing the selections. This works in a different function of mine so I'm not sure why...

       

      I am getting IModelDoc2 by calling swIComponent2->IGetModel2(&swModel) ... is this an issue?