Activating and Deactivating a Component

This task explains how to activate and deactivate a component. 

In the scenario described below, the CATProduct file contains two CATPart files that you will activate and deactivate alternatively after creating user parameters and a rule based on these parameters.

Note that:
  • Relations located at the product level are not integrated to the product update. If your relation drives the parameters of a Part, create the relation at the Part level.
  • Parameters driven by rules are designed to enable you to  control components activities at assembly level.
When working in a Japanese environment, remember to check the Surrounded by the Symbol' option (Tools>Options>General>Parameters and Measure>Knowledge tab). 

  1. Open the KwrSyringe.CATProduct file and save the following files in the same directory (SyringePiston.CATPart, HollowSyringePiston.CATPart, and SyringeContainer.CATPart): This file contains a syringe made up of three different parts: A barrel, and two different plungers.

  2. Create a multiple value parameter of string type.  

  • Click the icon. The Formulas Editor opens.
  • Select String from the scrolling list with Multiple Values. Click New Parameter of type. The Value List dialog box opens.
  • Enter two different values, Hollow and Full, and click OK
  • Edit the name of the new parameter (SyringeType in this scenario) in the Edit Name or value of the current parameter and click OK. The new parameter is displayed under the Parameters node of the Specification tree.
  1. Access the Knowledge Advisor workbench and click the Rule icon to create a rule. The script of this rule will allow you to enable or disable one of the plungers.

  2. Enter the code below in the Rule Editor, and click OK.

if (SyringeType == "Hollow")
{
`S3\Component Activation State` = false
`S2\Component Activation State` = true
}
else
{
`S2\Component Activation State` = false
`S3\Component Activation State` = true
}
Note that Japanese users must enter the following rule.
  1. Double-click the SyringeType parameter under the Parameters node and select Hollow in the Edit Parameter window. The SyringeBarrel CATPart and the HollowSyringePlunger CATPart  are displayed.

  1. Double-click the SyringeType parameter and select "Full" in the Edit Parameter window. The SyringeBarrel CATPart and the SyringePlunger CATPart are displayed.