|
-
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:
-
The rule name: Rule.1. 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.
-
The user and the date of creation.
-
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 must 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.
|