Mechanical Modeler

Specification/Result Mechanism Applied to Mechanical Features

An internal view of the mechanical features. 
Technical Article

Abstract

The aim of this article is to explain the Specification/Result modeler applied to the mechanical features. In other words, to describe the attributes of these features and explain the result produced by the Build/Update mechanism. This article is one among others in a series of articles which present various aspects of the Mechanical Modeler and which are introduced in the "Mechanical Modeler Overview" [1] article. 


Introduction

The Feature Modeler [2] is a Specification/Result modeler in that it allows the creation of a network of inter-related data objects in order to be able to automatically update the "result" of an object whose "specification" has been modified. The Spec/Result Modeler provides an infrastructure for spec/result management, also called the Build/Update mechanism. 

Mechanical features are  features that derive from the MechanicalFeature StartUp. The UML schema below is an extract of the tree of StartUps deriving from the MechanicalFeature StartUp.

Fig.1: MechanicalFeature Architecture

"The Contents of the specification Container - Geometrical Features Sets" article [3] describes the geometrical feature sets (features deriving from the MechanicalRoot StartUp), and "The Contents of the specification Container - Geometrical Features" article  [4] describes the geometrical features (those deriving from the GeometricalElement StartUp).

This article first consists in presenting the useful data (the modelization) needed to build, and to retrieve the result of the geometrical features. For these features, the result is a topological result, in other words a CATBody object [5]. First it is for the surfacic features, and then for the solid features

This article next explains the internal modelization of the geometrical feature sets, in other words how each feature contained in a set takes part to the result of the set. First it is for the surfacic features set (feature deriving from the GSMTool StartUp), and then for the solid and surfacic features set (feature deriving from the HybridBody StartUp).

The last section of this article consists in to explain the usage of the CATIBodyRequest interface. It is the interface which returns the result of a geometrical feature sets. 

[Top]

The Surfacic Feature Modelization

The surfacic feature is a feature that generally derives from either GeometricalElement3D or from the GSMGeom [Fig.1] StartUps.  It is a feature for which the IsAsShape method of the CATIMf3DBehavior interface always returns S_OK.

It has sp_in attributes but no sp_out attributes. The result of the build process, the topological result, is held by the surfacic feature itself. The following figure describes this:

Fig.2: Surfacic Feature Modelisation

To retrieve the topological result, a CATBody (NewTopologicalObject), you should use the GetBodyResult method of the CATIGeometricalElement (MechanicalModeler) interface on the surfacic feature.

[Top]

The Solid Feature Modelization

The solid feature is a feature which generally derives from either the MechanicalFormFeature or from the MechanicalContextualFeature [Fig.1] StartUp. It is a feature for which the IsAsSolid method of the CATIMf3DBehavior interface always returns S_OK.

The solid feature has sp_in and sp_out attributes. Two of them are, therefore, particular; they are called ResultIN and ResultOUT though the real names of these two attributes are not significant. The CATIShapeFeatureBody (MechanicalModeler) interface enables you to retrieve these attributes. The ResultOUT attribute is valuated by a Solid feature which is aggregated by the solid feature. For Solid feature, with a uppercase, solid is the name of the StartUp, and for solid feature, with a lowercase, solid represents the nature of the feature. The following figure describes this:

Fig.3: Solid Feature Modelization

The Solid feature represents the result of the solid feature, meaning that it holds the topological result produced by the Build method of the CATIBuild interface [5]. In order to retrieve the resulting CATBody of the solid feature, you have two means (*):

  1. Use directly the GetBodyOUT method of the CATIShapeFeatureBody (MechanicalModeler) interface 
  2. First retrieve the aggregated Solid feature and next apply the GetBodyResult method of the CATIGeometricalElement interface on it. To obtain the Solid feature, you should use the CATIShapeFeatureBody  interface and its GetResultOUT method. 

(*) In both these two cases, the CATBody is those of the default 3D view. You cannot retrieve the unfolded view for example.

The GetBodyResult method of the CATIGeometricalElement interface enables you to retrieve a topological result, in other words a CATBody object. The next diagram [Fig.4] represents the three cases to take into account by applying this method on a solid feature:

Fig.4: The Topological Result

You can notice that:

  1. The Pad being the first object in the SSS, the GetBodyResult method applied to the solid feature or to its Solid feature returns the same CATBody, the one created by the Build method.
  2. The Hole feature is a form feature, and the GetBodyResult method applied to the solid feature returns the topological result representing the form of the feature (a cylinder). This CATBody object is an internal data, created by the BuildShape method of the CATIBuildShape interface, that you should not use. The topological result created by the Build method on the solid feature, the Hole is returned by the GetBodyResult method on its Solid feature. 
  3. The EdgeFillet feature is a contextual feature, and the GetBodyResult method applied to either the EdgeFillet or to its Solid feature returns the topological result of the contextual feature. (the Pad with a hole and an edge).

[Top]

The Surfacic Features Set Modelization

A surfacic features set is a set of features from zero to three dimension: points, wires, surfaces and volumes. The following picture Fig.5 shows some of them into Geometrical Set and Ordered Geometrical Set, the two kinds of surfacic features set. 

Fig.5: Surfacic features into Surfacic Bodies

Just above the picture illustrates, or introduces three things:

  1. The surfacic features set forms a "net" of features where each feature has its own result: there is a CATBody for Point.1, Point.2, Line.1.
  2. Each surfacic feature into surfacic features set has a result, even the no relevant features. You can see that Extrude.2, absorbed by Split.1 is not drawn in 3D, but it is possible to highlight it because its result exists. 
  3. The result of a surfacic features set is the list of its relevant features, the result of Ordered Geometrical Set.2 will be different of Geometrical Set.3 even they contain the same type of features. 

These three aspects are now detailed. 

The Net of Features

The features inside the surfacic features set form a net with their sp_in attributes. The next schema gives an example with two points and a line. 

Fig.6 A Net of Features

You can see that: 

This schema, Fig.6,  is independent of the type of the surfacic features set. The absorbed features are integrated into this net, and have also a result. You can use CATIGeometricalElement interface to retrieve their CATBody such as the other surfacic features.

An Ordered or not Net of Features

The ordered surfacic features set has been introduced in R13 to strength the end user to create a feature which only relies on features above it in the specification tree [6]. Let us consider the consequences in term of graph thanks to the following two samples. 

Fig.7a A Non Ordered Net of Features for a Geometrical Set

Above, Fig.7a, it is a Geometrical Set. After its creation, Line.1 is relied on Point.3 in place of Point.2, and Extrude.1 is relied on Plane.2 in place of Plane.1. On right, you can see that the arrows (sp_in references) are in all directions. 

Fig.7b An Ordered Net of Features for an Ordered Geometrical Set

Now on Fig.7b it is an Ordered Geometrical Set with the same features as the previous Geometrical Set. But the modifications done on the previous GS are not possible for this OGS: Point.3 is below Line.1, and Plane.2 is below Extrude.1. So, on the left picture, you can see that the arrows (sp_in references) are all in the same direction (top-down), since all the sp_in attributes of a feature come from features above it in the specification tree. 

The previous samples are not really relevant, but you can imagine that for an huge graph the rule of order can be useful.  

Attention, this order for an Ordered Geometrical Set is relative to the set itself. If inputs come from another sets, the design of the net can be no more ordered. 

Retrieving the Surfacic Features Set Result

In order to retrieve the result of a surfacic features set, you must use the CATIBodyRequest interface. Its usage is explained in the last section, the  CATIBodyRequest Usage section. The contents of the list returned by the unique GetResults method is depending on the type of the surfacic features set:

[Top]

The Solid and Surfacic Features Set Modelization

The solid and surfacic features set (SSS) can contain either solid and surfacic features excepted the volume [4]. The following picture is an illustration.

Fig.8: Surfacic and Solid features into solid and surfacic features sets

The above picture illustrates, or introduces, three things:

  1. The surfacic features, such as Surface.1 and Offset.1, have their own result such as into a surfacic features set. They are included in the list of features representing the result of the solid and surfacic features set.
  2. The solid and surfacic features set is ordered such as the Ordered Geometrical Set, so you have exactly the same behavior: only the relevant features are integrated into the result of a SSS feature: Extrude.1 is excluded of the Body.3's result.
  3. There is only one result for the solid features: for Body.2 there is no CATBody for Pad.2, EdgeFillet.2 and Hole.1, but rather only one CATBody, the filleted and holed Pad. This CATBody is the form obtained after successive operations named a chain. 

For the first two points you can refer you to the previous paragraph, the Surfacic Features Set Modelization paragraph. The next section explains the process used to create the result feature which is at the end of this "chain" of solid features.

The Chain of Solid Features

The solid features inside a solid and surfacic features set are linked together by a kind of chain since the ResultIN attribute is valuated by the value of the ResultOUT attribute of the previous solid feature in the set. The next schema explains this chain with a solid and surfacic features set containing two solid features.

Fig.9: A Chain of Solid Features

(*) Not the last feature of the set such as former with the solid features set (MechanicalTool StartUp)., but the last solid feature. To be exact it is the last solid feature without update error.

This chain must be always consistent with the order of aggregation into the set. It is for this reason that to insert a solid feature in a solid and surfacic features set you must use the CATIPrtProceduralView interface, and its InsertInProceduralView method instead the CATIDescendants interface. The InsertInProceduralView method:

Navigating through the Solid Features Chain

The following set of interfaces are available in order to retrieve different information:

Retrieving the Solid and Surfacic Features Set Result

The interface to retrieve the result of a solid and surfacic features set is the CATIBodyRequest interface too. Just below, it is a sample to have an overview of the list returned by the GetResults method.

GetResults applied on PartBody returns:
  • The Solid result of the chain of the following solid features:
    • Pad.1, EdgeFillet.1, Hole.1
  • + Sketch.1 
  • + Sketch.2
  • + The result of Ordered Geometrical Set.1
    • Point.1
    • + Sketch.3
    • + The result of Body.2
      • Point.2
      • + Sketch.8
      • + Solid.1
      • + Sketch.9
      • + Split.1 
      • + Point.3
      • + Line.1
  • + Sketch.5
  • + The result of Ordered Geometrical Set.2
    • Sketch.7
GetResults applied on Body.2 and Body.3 returns E_FAIL

In details, the behaviors of the GetResults method applied on an solid and surfacic features set (SSS) are:

[Top]

CATIBodyRequest Usage

The CATIBodyRequest is the interface which retrieves the result of a geometrical features set. Here it is a piece of code which explains its usage.

...
CATIBodyRequest *pIBodyRequest= NULL;
pBody->QueryInterface(IID_CATIBodyRequest,(void**) &pIBodyRequest);
CATLISTV(CATBaseUnknown_var) ListResult ;
pIBodyRequest->GetResults("",ListResult);

CATIGeometricalElement * pIGeometricalElement = NULL ;
for (int i=1 ; i<= ListResult.Size(); i++)
{
   CATBaseUnknown_var spResult = ListResult[i];
   spResult->QueryInterface(IID_CATIGeometricalElement ,(void**) &pIGeometricalElement );

   CATBody_var spBodyResult = pIGeometricalElement->GetBodyResult();
}
...

where:

You can use the "Navigating a Part Document" use case [7] to analyze the result of the geometrical feature sets of your own Part documents.

[Top]


In Short

In this article you learned that:

[Top]


References

[1] Mechanical Modeler Overview
[2] Feature Modeler Overview
[3] The Contents of the Specification Container - Geometrical Features Sets
[4] The Contents of the Specification Container - Geometrical Features
[5] Integrating a New Geometrical Feature in the Update Mechanism
[6] Order and Absorption Concepts
[7] Navigating a Part Document
[Top]

History

Version: 1 [Mar 2004] Document created
Version: 2 [Nov 2003] Document updated for Ordered Geometrical Set
Version: 3 [May 2004] Document updated for solid and surfacic features set 
[Top]

Copyright © 2002, Dassault Systèmes. All rights reserved.