Designing a Robust User Feature: Some Hints
You can design a robust user feature.
- First of all, it is recommended to make a prototype of your
User Feature in a Power Copy. The latter is much more flexible.
After defining the Power Copy, it can be modified, whereas the first
definition of the User Feature is the last one because it cannot
be modified. This way your design can be made in several steps and
you don't
have to start again from scratch. At instantiation, it is also easier
to handle possible troubles (update
.)
thanks to the visibility provided by the Power Copy features.
- If the User Feature embeds a sketch, this sketch has to be iso-constrained.
Thus, when instantiating the User Feature and making changes
in its new context, you will avoid uncontrolled modifications of
the sketch geometry that you wont
be able to manage because the User Feature is a "black box".
For the same reason, make sure that your sketch is
attached>,
and for that, always use the creation of sketch
With
absolute axis definition.
This way, you are sure that the sketch is at the right position.
- If the User Feature embeds contextual geometrical items like
a draft or a fillet, it has to be resolved. It means that the base
of their constructions has to be embedded too and must not be considered
as an input of the User Feature. For example a fillet on the edge
of a pad depends on the geometry of the sketch of the pad. If this
sketch is in input of the User Feature and changes from square
to round, the fillet inside the User Feature will be broken and
the User Feature will be in error.
- Don't
embed datum or geometrical elements with external links to other
documents (Copy\Paste as result with link).
Don't
try to embed a Body into a User Feature, it is impossible. Because
a Body is a package which can be empty or can contain Knowledge
features for example. Whereas a User Feature is a geometrical
feature. To make it compliant, you have to transform the Body into
a geometrical feature with a boolean operation like Assemble, Remove,
Intersect.
After this, you can select the boolean operation when defining the
User Feature and the associated Body is automatically embedded.
Using Conditional Geometry
To evaluate the environment of the User Feature (its inputs) and
to make decisions, Knowledge Advisor provides 3 main functionalities:
Some measures (distance, angle,
area, length, center of gravity,
)
that can be used to evaluate the inputs. For more information,
see the Reference section of the Knowledge Advisor User's Guide.
|
|
|
Some geometric parameters that
can be valuated by other geometries. For more information,
see the Reference section of the Knowledge Advisor User's Guide.
|
|
|
- If / then / else keywords allow you to choose how
to validate those geometric parameters depending on
the measure results.
|
Catching Errors
Usually, if an update error is raised inside a rule,
the rule execution is stopped and the rule sends an evaluation error
message.
The Do not catch evaluation errors option
which is available by right-clicking the relation in the specification
tree and selecting the Properties command enables you:
- To create features in error
- To know (through an error message) if a feature is in error
and
- To make changes (or not) in case of errors.
This capability can be used to perform a geometric computation
(like intersection) and to decide what to do if there is no result.
|