About the Knowledge Pattern Feature
A Knowledge Pattern is a feature that enables you to:
- Instantiate templates or datums into CATPart documents in batch mode (no
user interaction), and to manage the instantiated objects in an associative
way.
- Generate automatically repetitive structures, with differences between
each instance of the structure.
You can create a Knowledge Pattern feature by clicking the Create
Pattern Feature icon ().
|
The objects supported by this feature are:
- User Features
- Datums (Points, Lines, Curves, Circles, Surfaces, Planes, Volumes)
|
|
Note that this new feature is
available in Part Design only. |
|
|
|
- The Knowledge Pattern feature is aggregated to the Relations node
in a part. This Relations node can be located in a Technological
Package.
- The List features is aggregated under the Knowledge Pattern feature
(including the list containing Locked objects).
- All instances are generated and handled by the Knowledge Pattern
feature. Their locations vary depending on the template instantiated:
- For User-Defined Features, the result of the instantiation
is located in a part.
|
|
The Knowledge Pattern is designed to conditionally instantiate a template or
another depending on some specifications (if
then instantiate A else instantiate B). The index in Knowledge Pattern lists
enables you to identify the template. If a call is made to Instantiate with
index i in list L, the application looks for an instance in the list.
If no instance is found, an instance is instantiated and inserted into the list
L at the position i.
If an instance is found, the application compares the ARM identifier given as
first argument with the one that was used for the previous instance. If this
identifier is different, the system instantiates the new template and replaces
the previous instance with a new one. This replace operation reroutes links
from the old instance to the new one. Naming is copied from the previous
instance.
The Knowledge Pattern feature is very similar to the Action feature. Like
the Action feature, it contains an expressional part that allows you to specify
what actions you want to perform usually using loops and the for
keyword. The main differences between both features are the following:
- When creating a Knowledge Pattern feature, you create List features which
are aggregated to Knowledge Pattern features. These lists contain links to
the instantiated templates, and the Knowledge Pattern feature controls the
life cycle of the instantiated templates through the content of these lists.
|
It can be useful to create several lists to handle for
instance point User-Defined Features in a list and line User-Defined
Features in another one. It provides you with an easy access to the
results that have different semantics. |
- You can use new
methods available in the dictionary to handle the instantiation and the
modification of Knowledge Templates.
- You can specify the update behavior of the Knowledge Pattern feature:
- Automatic update before the document root feature (the part, the
product,
)
update.
|
|
- Object update: The pattern can be updated through a reaction. In
this case, make sure that you do not select the Automatic update
mode.
|
- You can specify what happens if the template instances are pointed by
other objects, when the pattern is executed again.
The Knowledge Pattern ensures the associativity of templates instances with
respect to:
- The parameters values of these instances. The templates publish
parameters and a value change can impact the geometry of the instances.
|
There is a difference between the
published parameters and the parameters. You can change the published
parameter values, but the selection of a new parameter input replaces
the old parameter with the new one. |
- The number of instances to generate.
- The templates themselves. Depending on some expressional conditions or
input changes, the templates to instantiate can change.
- The inputs of the expressional feature defining the Knowledge pattern.
- The Inputs of these instances. The inputs can be geometrical inputs or
parametric ones. The inputs of the expression are the objects that are not
used as l-values (that are not set by an affectation operation).
To manage associativity, the Knowledge Pattern uses:
- The Engineering Knowledge Language (EKL) which contains loop structures and conditional
expressions and which enables you to:
- Instantiate and modify templates. Note that you can instantiate
different types of templates depending on a given condition. The
associativity mechanism ensures that if the condition changes, the
previous instance is deleted and replaced with the instance of the
new type.
|
- Instantiate datums and templates and modify such instances using
the Generative Knowledge functions.
|
- Lists that contain
all instances and identify them in a unique way. These lists contain the
Knowledge Pattern instantiated templates. They are published enabling you to
access the template instances in other expressional features. The Knowledge
Pattern feature controls the life cycle of the instances grouped in these
lists.
The Knowledge Pattern feature provides you with a way to lock the generated
objects so that further executions cannot modify them. There are 2 ways to lock
these objects:
- Add or remove manually the generated object from the list
LockedInstances
of the pattern.
- Use the dedicated
function added to the Engineering Knowledge Language (EKL)to perform this action.
When executing the Knowledge Pattern feature, you cannot modify nor delete
the locked objects even if:
- You use the Generative Knowledge
functions and if the arguments change.
- You re-execute the pattern without calling the
CreateOrModify
function
for this object.
- You use affectation operators when creating datums.
- You try to write object attributes (except if you use the
SetAttribute
.xxx methods.)
The following functions enable you to work with the Knowledge Pattern
feature.
CreateOrModifyTemplate
EndModifyTemplate
CreateOrModifyDatum
LockPatternInstance
IsPatternInstanceLocked
InstantiateTemplate
SetAttributeObject
. Note that you can manipulate attributes using the
Type view (if the type was properly generated and referenced in the
Knowledge Environment tab) or using the SetAttributeObject
function.
To
find out more about these functions, see the
Generative Knowledge topic.
The graphic below shows an example of a Knowledge Pattern body.
Note that:
- If the parameter NbInstances is modified, the Knowledge Pattern feature
is impacted.
- If the planes FirstBoxPlane or SketchPlane are modified, the Knowledge
Pattern is impacted.
- If some objects are built on one of the User Features instances:
- if this instance is replaced during execution, the system tries
to re-route this object to another instance managed by the Knowledge
Pattern. This automatic operation can only be performed if the object
is linked to the instance though its external view (it relies on the
parameters or on the outputs declared in the User Feature type). If
this object is linked to sub-elements, the rerouting is not ensured.
There is no way to prevent you from creating such links.
|
- Depending on a Knowledge Pattern option, this re-routing
mechanism is applied also when the list of instances grows or
shrinks. The Relative Referencing option enables you to
determine that the links between such objects and instances rely on
an index based on the last instance. For example, execute this
pattern with 10 instances, and create an offset plane based on the
output NextBoxInputPlane of the 9th instance. If you execute the
pattern again with 12 instances, and if this option is set, the
offset plane will be based on the 11th instance after the execution
so that it is possible to say that the link is relative to the last
instance.
|
- The size of the Knowledge Pattern lists evolves during the execution of
the pattern as if it had never been executed. It is possible to add items to
the list in a different order than the normal one i.e. you can begin with the
second item, then create the first one. But if items are missing at the end
of the execution, the list is "compacted".
Some indexes are changed, and a warning message is displayed.
- There is an automatic naming strategy of instances, but this naming
strategy can be overloaded through attributes found on instances (Name attribute
for both user features and datums). Mandatory attributes are required to
ensure the complete instantiation of a Knowledge Template. If an error occurs
during the Knowledge Pattern execution, or if not all these attributes are
filled, the instance is removed, even if it was already and correctly
generated.
- The re-execution of the Knowledge Pattern will not load the documents of
the template if the ARM identifier is not modified. The application will not
check if you modified the User Feature reference before re-instantiate it.
Knowledge Pattern Contextual Menu
|
- Definition: Enables you to access the Knowledge Pattern
definition window.
- Execute: Enables you to execute the Knowledge Pattern.
- Execute and upgrade: loads the Parts referenced by the
Knowledge Pattern. The User Feature version is checked and if this User
Feature has changed, it is instantiated.
- Reorder: Enables you to reorder the Knowledge Patterns.
|