9.0 Feature Tree (Beta Version)

The Feature Tree represents all the steps that have been taken in a CAD design system to create the final Part. Examples are: 1) Selecting a sketch and defining an extrusion; 2) Selecting an edge and creating a fillet; and 3) Creating a hole.

HOOPS Exchange can re-use some of this data for Catia V5, NX, and Creo. Exchange can also retrieve hole and pattern information. This is particularly useful to optimize downstream processes, including analysis, manufacturing, and metrology.

9.1 Reading the Feature Tree

To read the features in your model, simply set m_bReadFeature to true prior to importing your model:

A3DSDKHOOPSExchangeLoader sHoopsExchangeLoader(myFilename);
A3DImport sImport(filename);
sImport.m_sLoadData.m_sGeneral.m_bReadFeature = true;
sHoopsExchangeLoader.Import(sImport);

9.2 Traversing Feature Trees

Feature trees are stored in the Part Definition using a generic data structure and Representation Item:

The easiest way to retrieve the feature trees is to use the A3DAsmPartDefinitionFeatureTreesGet function. From there you can access the final representation of the geometry.

In a typical part, you would have four Feature Trees, representing the X, Y, and Z planes as well as the B-rep. The final geometry (planes and B-rep) will be stored in A3DFRMFeatureTreeData::m_ppFinalGeometry.

A3DFRMParameter and A3DFRMFeature are used to store all feature information and their respective parameters; A3DFRMFeatureLinkedItem can be used to retrieve the link between features and geometric entities – for instance, the cylinder attached to a particular hole.

For a demonstration of how to traverse the Feature Tree, see the PRC2XML sample in the package.

9.3 Retrieving Hole Information

HOOPS Exchange reads all the specific parameters that have been used to define a hole in V5, NX, and Creo. This includes:

  • The type of hole:
    Simple CounterBored CounterSink Tapered
    (For more information on hole types, see the EA3DFRMEnumValue_Hole enum.)
  • Depth definition:
  • Threading information:

Hole Features can be retrieved by traversing the elements in A3DFRMParameter and by looking at A3DFRMFeatureData::m_sType (this is also demonstrated in the PRC2XML sample).

Another useful method for retrieving feature information is the A3DFRMGetSpecificNodes function, which creates a list of features that match the specified EA3DFRMEnumValue_CadType:

A3DUns32 iSize;
A3DFRMFeature** ppFeatureNodes = NULL;
A3DFRMGetSpecificNodes(pTree, kA3DFRMEnumValue_CadType_Hole, &iSize, pppFeatureNodes);

9.4 Retrieving Pattern Information

HOOPS Exchange can read all the specific parameters used to define a pattern in V5, NX, and Creo.

This includes:

  • The type of pattern:
    • Linear
    • Matrix
    • Cyclic
    • Polygonal
    (For more information on pattern types, see the EA3DFRMDefinitionPatternType enum.)
  • The Master entity
  • Information to retrieve the position of slave entities

Patterns can be retrieved by traversing the elements in A3DFRMParameter and by looking at A3DFRMFeatureData::m_sType.

And just like with hole feature nodes, pattern feature nodes can be retrieved via the A3DFRMGetSpecificNodes function:

A3DUns32 iSize;
A3DFRMFeature** ppFeatureNodes = NULL;