Mechanical Modeler |
Working With Extension FeaturesHow to Extend Behaviors on Features |
|
Technical Article |
AbstractSometimes, 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:
|
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]
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]
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.
![]() |
Implementation of CATIParmPublisher on CAADataExtension. |
In order to show
or not your feature extension in the spec tree, you must implement the
CATINavigateFilter
interface on the Feature
Extension. The extended feature will be visible
just beneath the
extended feature such as depicted by the above picture (blue node on
left).
![]() |
![]() |
User View with CATINavigateFilter::IsShown returning TRUE |
User View with CATINavigateFilter::IsShown returning FALSE |
Please, note that if
you do not implement the CATINavigateFilter
interface, the behavior is not guarantee: the extended feature can be
visible, like it can be hidden.
[Top]
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]
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]
Version: 1 [Feb 2007] | Document created |
Version: 2 [Sep 2007] | Document updated |
[Top] |
Copyright © 1999-2007, Dassault Systèmes. All rights reserved.