When using some objects, you need to indicate the destination of the
formulas and the rules that valuate the parameters of these objects. If you
valuate a time parameter in a kinematic simulation for example, the relation
will not be located below the Relations set but in the mechanisms and commands
tree of the simulation.
Hiding relations
You can hide a knowledge relation (formula, rule, check, ..) by
right-clicking this relation in the specification tree and by selecting the
Hide command.
- A visual indicator located at the Relations set level indicates that
the set contains hidden relations.
Note that this indicator is not recursive.
- If you try to delete a relations set containing hidden relations, a
message is displayed asking you if you want to delete the relations set
that contains hidden relations.
Note that if you try to delete a relations set containing another
relations set with hidden relations, the message will be displayed.
|

|
Relations Updates
The evaluation of relations containing measures can be integrated to the
Part update only. In a .CATProduct or in a .CATProcess file, to create a
parameter
- which value is the result of a relation containing measures
- updated when modifying the measure inputs:
-
Create the relation containing the measure at the Part level.
-
Integrate the relation evaluation to the Part update.
-
At the Product or the Process level, create a relation that
valuates the parameter by using the result parameter of the relation created
at the Part level. To get an example, see
KwrUpdate.CATProduct.
-
Perform a local update at the Relations level.
 |
When loading a document, the message
opposite can appear. It means that during the load, some relations
appeared as broken. These relations
use functions that are not recognized by the dictionary because the
library containing the definition of the function is not still loaded.
That's why you are asked if you want to load all the libraries containing
functions definition. But loading all libraries may have an impact on
performance. So, we recommend you to load only the libraries you are
interested by. To do so, select the required libraries in the
Knowledge Environment tab (Tools>Options>General>Knowledge>Knowledge
Environment.) |

Rules
Geometrical Features and Rules
In a rule using features that need the geometry to return the
type (such as extrudes), when the feature is deactivated, the type cannot be
returned. To solve the problem, use the Set command to indicate the type in the
rule. For more information, see
KwrSetType.CATPart.
Rules and Update Cycle
 |
This configuration is allowed because a modification of
the parameter activity does not impact the formula update. But:
-
In such a case, it is highly recommended to use the
reaction feature.
-
If you want to use a rule, do not deactivate and
reactivate the activity parameter.
-
When working with a UDF feature, make sure that you
have inserted the relation set when defining the UDF.
|

Loops
- Generic Naming: Generic naming is a CATIA technique which creates a
label whenever an element has been selected interactively. This label is
a coded description of the selected element. When you specify a fillet to
be applied to a face, you must select interactively the face definition
but prior to doing this you must of course have generated the face
to be filleted. This is why scripts requiring face, point or edge
definitions cannot be generated in one shot. You don't have to mind about
the generic naming itself as it is automatically captured from the
geometry area. The thing you have to mind about is the order your
instructions are to be written and executed in the script.
|
- Message "property does not exist...": Check in the browser
that the attribute name is correct. For attributes of list type (Fillets
and Chamfers), check the indexes. The indexes specified must be
consecutive from 1 to n without any gaps.
|
Syntax
There are 2 ways to specify the file path:
- import "File path"; : Indicate the path of the file to be
imported:
import "E:\users\kwecx\Models\PartImport.CATPart"
;. Note that you must enclose the path within quotation marks and
end the import statement with a semicolon (;).
- import "File Name"; : Indicate only the name of the file to be
imported if this file is located in the same directory as the document
containing the loop:
import "PartImport.CATPart"; . Note
that:
- You must enclose the document name within quotation marks and
end the import statement with a semicolon (;).
|
- The file to be imported must be located in the same directory
as the document containing the loop.
|
- The document containing the loop must be saved.
|
 |
To specify a file to
be imported, you can use Insert File Path from the
contextual menu. Selecting this command displays a file selection
window. Quotation marks are automatically included but not the
semicolon |
|
When designing a document to be generated by a script, it is better to
group all the required sketches in a single file. That way:
- you minimize the overall size of your sketch-related data
|
- no matter the method used to specify the input file, specify the
path once
|
- the design of the final document is made easier. You get a global
view of the sketches on which the other features rely.
|
|
|

Reactions
- There are 2 ways to react to parameter changes using the reaction
feature:
- Select the parameter and react to its Value Changed event
|
- Select the feature (that owns the attribute corresponding to your
parameter) and react to the Attribute Modification event. Note that
this method does not work in all cases.
|
- If you create a User Feature embedding a reaction that will be launched
when the User Feature is instantiated, select Owner in the Reaction dialog
box and make sure that the reaction is one of the internal components of the
User Feature. If not, the reaction will not be launched when instantiating
the User Feature.
