Using the Knowledge Advisor
Action
![](../icons_C2/common/atarget.gif) |
This task explains how to use an action.
The scenario described below is made up of 3 major steps:
![](_themes/v5r5/ul1.gif) | You first create a pad containing an action. |
![](_themes/v5r5/ul1.gif) | You store this action in a catalog |
![](_themes/v5r5/ul1.gif) | You then import the action stored in the catalog into another
CATPart product. |
|
![](../icons_C2/common/aprereq.gif) |
It is highly recommended to be familiar with
the Part Design workbench to carry out this scenario. |
![](../icons_C2/common/ascenari.gif) |
-
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). |
![](images/kwrAction1NLS.gif) |
|
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) |
![](../icons_C2/common/ainfo.gif) |
![](_themes/v5r5/ul1.gif) | The action created above searches for the pads
contained in the selected body and computes the volume of these
pads.
|
![](_themes/v5r5/ul1.gif) | To know more about Query and Compute, click here.
|
![](_themes/v5r5/ul1.gif) | 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.) |
![](images/kwrAction2Small.gif)
|
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. |
![](images/kwrAction3Small.gif)
|
|
|