Online Book Reader

Home Category

SolidWorks 2011 Assemblies Bible - Matt Lombard [156]

By Root 1160 0
helps you distill your design down to some specific well-defined decisions. These decisions are presented to the user in a form, which you need to fill out with numerical values or with options from a list in most cases. Each decision is driven by a field on the form. The field is where you put your answer.

Once you have captured the dimensions and features that need to be controlled, it is time to create the form for filling in the information. The screen capture in Figure 18.8 shows how you start setting up the form. Begin by typing a name in the first input field, such as Number of Blades. Next, select what kind of input the first item will be, such as a drop-down list to select the number of blades. Because not all combinations are stylistically acceptable, this design does not allow all numbers of blades between 1 and 6. It does allow 1, 3, 5, and 6 blades.

FIGURE 18.8

Setting up the first field on the form


When you have added the first field to the form, DWX adds it to the list, and you can then test it, add another field, edit, or delete the field.

Building rules

Rules in DWX are conditional statements used to calculate output values based on the input values from the form. These rules resemble programming to some extent. For example, a rule for a variable called BladePattern might look like this:

= IF (NumberOfBlades = 1, Suppress, Unsuppress)

In English, this reads: If the variable NumberOfBlades is equal to 1, then suppress the feature called BladePattern. If the NumberOfBlades is not equal to 1, then unsuppress the pattern.

Click the blue right arrow to advance to the Rules interface, which is shown in Figure 18.9. Notice that it tells you that rules are missing for filenames. DWX renames the files for each job you do, according to a set of rules. You will return to this later. For now, you will work on the feature and dimension.

FIGURE 18.9

The Rules interface and editing rules


To create a new rule for the feature (BladePattern), make sure the Features row has a check mark in the far-right column, and click the blue arrow. In Figure 18.10, two rules have already been created. If the Show Missing Rules Only option is checked, you do not see existing rules, only items that do not yet have a rule assigned.

FIGURE 18.10

Building logical statements


Building a rule to suppress a component pattern

To build the rule, use logic and math statements, along with the input values given. For example, in the case of the BladePattern, if the number of blades is equal to 1, then the pattern should be suppressed. For any other value, the BladePattern should be unsuppressed. Therefore, in logic, you want to build the following rule statement:

IF(NumberofBlades = 1, Suppress, Unsuppress)

The first condition (Suppress) tells DWX what to do if the equation (NumberofBlades = 1) is true, and the second condition (Unsuppress) tells it what to do if the equation is false.

The Inputs, Recent, Math, and Logic drop-down lists allow you to select the items that are available for whatever you are doing at the moment. The statements are easy to create, and can include more elaborate schemes such as nested IF loops (an IF statement executes as a true or false condition).

Note

If the rule box turns pink, it is telling you that there is a problem with the rule. If DWX sees a problem with a rule, the default value for text rules is [VALUE].

Building a rule to change filenames

For each job that you run, DWX saves out a set of files that are independent copies of the originals, with new names. A necessary part of automating a model is establishing rules for filenames. The output of the rule is a text string that will be added to the end of the existing filename. DWX cannot apply a prefix to a filename, only a suffix.

With this in mind, for this project, a field is established on the form that asks the user for a project name, and then DWX uses a rule to append the project name to the end of the filenames to ensure unique filenames for all files.

Figure 18.11 shows the rule list and the Rule Builder for building

Return Main Page Previous Page Next Page

®Online Book Reader