Mechanical Modeler

Working With Extension Features

How to Extend Behaviors on Features
Technical Article

Abstract

Sometimes, it is useful to add data or behaviors to a feature in order to customize models. One way to enrich features is to extend them, using "Extension Features" managed by Feature Modeler's API (CATIOsmExtendable and CATIOsmExtension )[1]

This article deals with Extension Features in Mechanical Modeler, and more particularly about behaviors available on Extensions in Mechanical Modeler.

Notes:

  1. To take full advantage of this article, it may be interesting to have a look at the Feature Modeler's CAA articles: "How to Add Data to a Feature" [1], "Working with Feature Extensions" [2] and "Creating Feature Extensions" [3].
  2. This article, dealing with Extension Feature in Mechanical Modeler, is illustrated with a dedicated Use Case [4].

What is an Extension Feature?

An Extension Feature is a specific feature which allows you to add behaviors or data (like parameters) on a "Base Feature" without modifying its structure. You can create the Startup using the OSM technology [5], or using the CATIOsmExtensionFactory interface in the code creating the feature's catalog.

Conversely to a traditional Startup, creating a Extension's StartUp is not enough, you should provide a CATNls file too. This additional resource's file determines its "extendibility" and its applicative container in which it will be instantiated. It is fully explained in the referenced article [1].

[Top]

Extension Features in Mechanical Modeler context - Restrictions

Globally, Extension Features, defined by Feature Modeler, could extend a multitude of features.

However, in Mechanical Modeler, we recommend you to restrict your extension to the features defined below:

Of course, all their subtypes and derivatives support also Extension Features.

[Top]

Adding data and behaviors

As said before, Extensions are specific features which allow you to add behaviors and parameters on base features. It means that once the new feature is created, you can provide him behaviors by implementing interfaces.

The Extension feature that you will define, will derive from a specific Feature Modeler's feature. So it means that your feature will take benefit from interfaces natively implemented on the derived DS feature (The CATINavigateObject interface is an example). But take care, the derived DS feature is not the base feature which is extended, it is the StartUp whose derives your feature)
 

Here are listed the main behavior to take into account, but for a complete application, this list can be extended.

There is an implementation of this interface on the DS feature whose derives your extension feature. But this implementation is not specific to a feature extension, so you can re-implement it to use RemoveExtension method of CATIOsmExtendable interface.

[Top]

Extension Feature integration in Mechanical Modeler - Provider Mechanisms on MechanicalPart

As Extensions are instantiated into applicative container, it may be useful to implement providers to extend behaviors normally restricted to CATPrtCont (like Update Mechanism) on this applicative container.

Please refer to article “Working with Providers in Mechanical Part” [6] for more information about this specified mechanism.

[Top]


In Short

Extensions are specific features dedicated to add behaviors and customize existing features. They must be defined in a catalog, declared in a resource file and they must implement interfaces to customize the behaviors wanted.

In some cases, it is useful to set up Providers between CATPrtCont and applicative container in order to extend behaviors like Update mechanism...Which is commented in another article [6] .

[Top]


References

[1] How to Add Data to a Feature
[2] Working with Feature Extensions
[3] Creating Feature Extensions
[4] Extending a Mechanical Feature using Extension Feature and Providers
[5] Introduction to the OSM Language
[6] Working with Providers in Mechanical Part
[Top]

History

Version: 1 [Feb 2007] Document created
Version: 2 [Sep 2007] Document updated
[Top]

Copyright © 1999-2007, Dassault Systèmes. All rights reserved.