Configuration Examples
Configuration rules switch the new model to another configuration already
set up in the SolidWorks file.
Before you create configuration rules, verify that the option Yes, allow me to create a rule to switch configurations
on the Configurations tab is checked.
To switch to a configuration when a checkbox is selected:
Create a form
with a field called InputCheckBox.
Open the
Rules tab.
For Action,
select Edit Configuration Rules
and click Next.
Double-click the configuration
.
Select If
from the Logic tab and construct the condition that determines which configuration
to use when the input checkbox is selected .
In the IF
field: If
(InputCheckBox = TRUE ,
In the Then
field, the name of the configuration, in quotes, to use when the condition
is true: ConfigA
The case of the name and the
configuration must match exactly.
In the Otherwise
field, type the name of the configuration, in quotes, to use when the
condition is False:
"Default"
Click Next.
The formula shown in the rules list:
IF ( InputCheckBox
= TRUE , "ConfigA"
, "Default" )
To switch to a configuration selected from a menu:
Create a form
with a drop-down control called MenuSelect
with selections for existing configurations.
Open the
Rules tab.
For Action,
select Edit Configuration Rules
and click Next.
Double-click the configuration
.
Select MenuSelect
from the Inputs tab.
Click Next.
The formula shown in the rules list:
MenuSelect
To change configurations
based on a value selected from a menu:
Create a form
with a drop-down control called MenuSelect
with a list of existing configurations.
Open the
Rules tab.
For Action,
select Edit Configuration Rules
and click Next.
Double-click the configuration
.
Select If
from the Logic tab and create an expression:
In the If
field, construct the condition that determines what the first menu selection
could be (with the menu value in quotes).
In the Then
field, type the name, in quotes, of the configuration to which the above
selection refers.
The case of the name and the
configuration must match exactly.
Click Next.
The formula shown in the rules list:
IF ( MenuSelect = "MenuValue"
, "ConfigAValue"
, "ConfigBValue"
)
If there are more than two
menu selections, see Nesting IF statements.
To change configurations based on an input value:
Create a form
with a drop-down control called MaterialSelect
with a list of materials, such as Cast Alloy Steel, that exist in the
part.
Open the
Rules tab.
For Action,
select Edit Configuration Rules
and click Next.
Double-click the configuration
.
Select MaterialSelect
from the Inputs tab.
Click Next.
The formula shown in the rules list:
MaterialSelect
The configuration is swapped to Cast Alloy
Steel (which must exist in the part or assembly).