Finding references of Features and Sketches

Hi,

I've been trying to find references of features,

Traversing the feature tree gives me the features and child features, but I would like to know the parents (those parent features the feature uses) for example:

  • on which plane a sketch is made
  • which sketches are used in a feature (extrude, loft, revolve)
  • which plane is used for a reference geometry, for example a plane 20 mm above the top plane
  • which face is used for the sketch of a boss extrude

My code:

// show parents of current feature

parents = currentFeature.GetParents();

if (parents != null)

{

  parentscount = parents.Length;

  for (int nr = 0; nr < parentscount; nr++)

    {

       swParentFeature = (Feature)parents[nr];

       Debug.Print("ParentFeature ----> " + swParentFeature.Name);

    }

}

In my example I have a boss extrude "Boss-Extrude2" on top of another feature (a face of "Boss-Extrude1")

How can I find the exact references (the face who is the base for the sketch plane) of "Boss-Extrude1" on which "Sketch2" has been used?

Thanks,

Bas

SolidworksApi macros