Using the Knowledge Advisor
Action
|
This task explains how to use an action.
The scenario described below is made up of 3 major steps:
| You first create a pad containing an action. |
| You store this action in a catalog |
| You then import the action stored in the catalog into another
CATPart product. |
|
|
It is highly recommended to be familiar with
the Part Design workbench to carry out this scenario. |
|
-
Access the Part Design workbench and create a
Pad or open the KwrAction.CATPart
file.
-
Create a parameter of volume type and assign it
a formula. To do so, proceed as follows:
|
Click the
icon, select Volume in the
scrolling list, click the New Parameter of type button and
rename the Parameter (V in this scenario). |
|
|
Click the Add formula button. The formula editor
opens. |
|
Under Dictionary, select Part
Measures, and select smartVolume.
Position the cursor between the parentheses and select PartBody. Click OK,
Yes (when prompted for an automatic update) and OK. |
-
Access the Knowledge Advisor workbench and click
the Action icon () to create an action. The Action editor opens. Enter the following script and
click OK:
Inputs
field |
B: Body |
Editor |
B.Query("Pad","").Compute("+","Solid","smartVolume(x)",V)
Message("Total volume of the pads under this body : #",V) |
|
| The action created above searches for the pads
contained in the selected body and computes the volume of these
pads.
|
| To know more about Query and Compute, click here.
|
| To see the created .CATPart file, click here. |
|
- Save your file and store the created action in a catalog. To do so, proceed as
follows:
|
From the Start menu, select Knowledge->Catalog Editor. The catalog editor opens. |
|
Click the Add Family icon (), or select the Insert
-> Add Family... commands from the main menu to
display the Component Family Definition dialog box. Indicate
the name of the family (ComponentFamily.2 in this scenario), and click
OK. |
|
Double-click the ComponentFamily.2 family in the catalog
structure and click the Add component icon (), or select the Insert
-> Add Component... command to display the
Description Definition dialog box. |
|
Click the Select external feature button.
Go back to the geometry, select the Action.1 feature in the specification tree and
click OK. Save your catalog. The action contained in
your .CATPart file is now stored in the catalog you have just
created. |
- Open the KwrReceiveAction.CATPart file.
6. Click the Catalog icon () to import the action stored in the catalog.
Click the Browse another catalog icon ), select your catalog, and
click Open. Double-click ComponentFamily.2, and double-click Action.1. The
Insert object dialog box opens.
(Click the graphic opposite to enlarge it.) |
|
7. Select PartBody: the imported action displays the volume
of the pads contained in this body.
(Click the graphic opposite to enlarge it.)
8. Select Body.2: the imported action displays the volume
of the pads contained in this body. |
|
|
|