Visiting Feature Geometry
Functions Introduced:
All geometry in is created as a result of features, so each geometry object in belongs to a feature. Therefore, the most general way to traverse geometry of all types is to traverse the features, then traverse the geometry each one contains.
The function
ProSolidFeatVisit() visits every feature in a solid. The function
ProFeatureTypeGet() reports the type of a feature in terms of the enumerated type
ProFeattype (described in the include file
ProFeattype.h).
Note that
ProSolidFeatVisit() is designed partly for internal use within . It visits not only the features seen by the users, but also the features created internally to help in the construction of geometry. These internal features are rarely of interest to users. To distinguish the visible features from the internal, or invisible, features, call the function
ProFeatureVisibilityGet(). Internal features are invisible features used internally for construction purposes.
The function
ProFeatureStatusGet() reports whether a feature is suppressed or inactive for some reason—only active features contain active geometry.
The function
ProFeatureGeomitemVisit() visits the geometry items within a feature. It can visit all the geometry items, or one of these specific types:
SURFACE,
PRO_EDGE, or
PRO_CURVE. Like
ProSolidFeatVisit(), this function visits not only the visible items, but also items used internally to aid in regeneration. Use the function
ProGeomitemIsInactive() to skip over the internal, or inactive, geometry items. For features with solid geometry,
ProFeatureGeomitemVisit() visits not only the surfaces, but also the edges. Contrast this with the visit functions specific to those items, described in the next section, that show the hierarchical relationships between surfaces, contours, and edges.
If you want the function
ProFeatureGeomitemVisit() to visit annotation elements only , use the feature type
PRO_ANNOTATION_ELEM.
Active geometry objects for datums will usually be found in features created for them, and therefore have the corresponding type. For example, a ProGeomitem object of type PRO_CSYS is usually contained in a feature of type PRO_FEAT_CSYS. However, this is not always true; a geomitem of type PRO_AXIS can exist in a feature of type PRO_FEAT_HOLE, for example. A feature of type PRO_FEAT_MERGE, which may arise from a Mirror operation in Part mode, or from a Merge in Assembly mode, contains geometry objects corresponding to all those in the referenced features, whatever their type. In general, it is it best to make no assumptions about what kinds of feature in which you should look for datums.
Remember to distinguish the feature object from the geometry object it contains, even when they have a one-to-one relationship. For example, a feature of type PRO_FEAT_DATUM_AXIS contains a single geometry item of type PRO_AXIS, and each of these can be represented as a ProModelitem object. However, they are still distinct items with their own identifiers and types.
To extract the type and shape of each geometry item, use the function
ProGeomitemdataGet(), described in detail in the section
Geometry Equations.
|
Note:
|
Some of the following sections about traversing specific geometry items introduce new functions specific to those types. PTC recommends that you use the more specific functions rather than the general method described in this section, because they are easier to use and usually have better performance.
|
All the functions in this section specific to features are described in detail in the section
Core: Features.
Parent topic