Using Rules
|
This task introduces the Knowledge Advisor rules without getting bogged down in details.
Unlike the parameter and formula capabilities which are available to all CATIA
users, the rule and check capabilities require the Knowledge Advisor product.
For
more information on rule-related tasks, refer to Rule and Check
Tasks. |
|
·
For more information about Rules, see Working
with the
Rule Feature.
To know more about the Rule Editor, see Using
the Rule Editor. |
|
-
Select the KwrStartDocument item in the specification
tree
-
Access
the Knowledge Advisor workbench from the Start->Knowledgeware
menu.
-
Click the
rule icon. The following dialog box is displayed:
|
The dialog box fields display default values that can be modified:
a - The rule name:
Rule.i. The first
rule created in a document is Rule.1 by default.
This name is the one displayed in the specification tree unless you modify the default
name at creation.
b - The user and the date of
creation.
c - The destination, i.e. the
feature you are going to add the rule to. By default, in this scenario, the destination
is the Relations feature (the Relations node in the specification tree). But a rule
could be added to another feature, then only apply to this feature.
Replace the Rule.1 string with Cylinder_Rule, if need be modify the
comments but don't modify the destination. Click OK. The Rule Editor is
displayed (see below).
Type the code below into the edition box or copy/paste it from your
browser to the edition box.
PartBody\Hole.1\Activity
= true
if PadLength <= 50mm and PadLength > 20mm
{
PartBody\Hole.1\Diameter = 20mm
Message("PadLength is: # | Internal Diameter is: #",
PadLength,PartBody\Hole.1\Diameter)
}
else if PadLength > 50mm and PadLength < 100mm
{
PartBody\Hole.1\Diameter = 50mm
Message("PadLength is: # | Internal Diameter is: #",
PadLength,PartBody\Hole.1\Diameter)
}
else if PadLength >= 100mm
{
PartBody\Hole.1\Diameter = 80mm
Message("PadLength is: # | Internal Diameter is: #",
PadLength,PartBody\Hole.1\Diameter)
}
else
{
PartBody\Hole.1\Activity = false
Message("PadLength is: # | Internal Diameter is: #",
PadLength,PartBody\Hole.1\Diameter)
} |
Users working in a Japanese environment
should use the script below:
`PartBody\Hole.1\Activity`
= true
if `PadLength` <= 50mm and `PadLength` > 20mm
{
`PartBody\Hole.1\Diameter` = 20mm
Message("PadLength is: # | Internal Diameter is: #",
`PadLength`,`PartBody\Hole.1\Diameter`)
}
else if `PadLength` > 50mm and `PadLength` < 100mm
{
`PartBody\Hole.1\Diameter` = 50mm
Message("PadLength is: # | Internal Diameter is: #",
`PadLength`,`PartBody\Hole.1\Diameter`)
}
else if `PadLength` >= 100mm
{
`PartBody\Hole.1\Diameter` = 80mm
Message("PadLength is: # | Internal Diameter is: #",
`PadLength`,`PartBody\Hole.1\Diameter`)
}
else
{
`PartBody\Hole.1\Activity` = false
Message("PadLength is: # | Internal Diameter is: #",
`PadLength`,`PartBody\Hole.1\Diameter`)
} |
Click Apply. An information window displays the PadLength and Pad
internal diameter values. Click OK in the Information window. The Cylinder_Rule relation
is added to the specification tree.
Click OK to terminate this part of the dialog. Keep your document open
and proceed to the next task.
|
|