Home Search

DriveWorks Pro 21
Model Rules

Send Feedback

File Name Rule

The file name rule is used to determine the name of the driven model, or, in the case of a subassembly or part, to delete it or control its suppression state, visibility in the parent assembly.

RuleMeaning
TRUEUnsuppresses the subassembly or part, you could also use "Unsuppress" (in quotes), or "U" (in quotes).
FALSESuppresses the assembly or part, you could also use "Suppress" (in quotes), or "S" (in quotes).
"DELETE"Deletes the subassembly or part from its parent assembly.
DWSpecificationIdCreates a new subassembly or part with its filename set to be its original file name, suffixed with the specification number - for example, "Block.sldprt" would become "Block 1.sldprt" if it was generated by the first specification.
"*" & DWSpecificationIdCreates a new subassembly or part with its filename set to be the specification number - for example, "Block.sldprt" would become "1.sldprt" if it was generated by the first specification.
"*" & DWSpecificationId & "*"Creates a new subassembly or part with its filename set to be its original file name, prefixed with the specification number - for example, "Block.sldprt" would become "1 Block.sldprt" if it was generated by the first specification.
"<Replace>MyComponentSetName"Replaces the subassembly or part with a Component Set called MyComponentSetName. For more information, see the How To: Replace a Component With a Static or Driven Replacement Model help topic.
"*" & DWSpecificationId & "<MASTER:NAME>" & OrderNumberReturn

Creates a new subassembly or part with its filename set to be the specification number, followed by the name of the master model the component is generated from, followed by the  data entered into the OrderNumber form control.

For example the master model "Block.sldprt" would become "1Block1234.sldprt" if it was generated by the first specification and 1234 was entered into the OrderNumber form control.

Deleting Components included in a Pattern

When a component, that is used as the seed for a pattern, is deleted from an assembly the pattern will also be deleted.

If the pattern includes any other components ensure the component deleted has not been used to define any parameters of the pattern.

The generated assembly will show rebuild errors if this is the case.

Relative Path Rule

The relative path rule controls the folder that the driven model is created in.

If the result of the Path rule results in a folder that does not currently exist DriveWorks will create it.
RuleMeaning
""If the project is located at "C:\DriveWorks Pro\My Cupboard\My Cupboard.driveproj" then the driven model will be created in "C:\DriveWorks Pro\My Cupboard\Results\".
DWSpecificationIdIf the project is located at "C:\DriveWorks Pro\My Cupboard\My Cupboard.driveproj" and the specification number is 56 then the driven model will be created in "C:\DriveWorks Pro\My Cupboard\Results\56\".
"\\dataserver\models\cupboards"The driven model will be created in "\\dataserver\models\cupboards"

Please see Info: Where To Store DriveWorks Data for information on where to store the data associated to a DriveWorks implementation.

Configuration Rule

The configuration rule provides the ability to switch the configuration of the model.

RuleMeaning
The configuration of the model is left in the current configuration.
"Red"The configuration of the model is switched to Red.
"*Red"The configuration of the model is switched to Red and all other configurations are deleted. If a design table is present, it is deleted too.
"Red <As Machined>"The configuration of the weldment model is switched to Red <As Machined>

In an ordinary SOLIDWORKS part, a configuration has a name and a description. Switching a configuration in DriveWorks means you need the name of the configuration.

In a weldment, a configuration has a name, a description, and a "real name". By default, the "real name" and the description are the same, i.e. the name of the configuration suffixed with "<As Machined>" or "<As Welded>".

The "real name" is the name DriveWorks needs to switch the configuration - without the suffix, the name of the configuration wouldn't be unique.

The description can be changed away from the "real name" at any time and will not affect the "real name"

The size of the SOLIDWORKS file will be reduced, and Model Generation efficiency improved, if all outdated or irrelevant configurations are deleted from the master file.

Tags Rule

The Tags parameter is only available for top level models.

Tags are relevant when two or more DriveWorks Autopilot machines are deployed.

Tags allow control over which DriveWorks Autopilot generates the models required for a specification.

The result of the Tags rule must match a tag set in DriveWorks Autopilot.

RuleMeaning
If(HighPriorityCheckBox=True,"High","Low")When the checkbox HighPriority is checked will result in the tag High being applied to the parameter. Otherwise the tag low will be applied.
DriveWorks Autopilot must be set to process the information being tagged.

Feature Rule

Feature rules control the state of a feature, i.e. suppressed, unsuppressed, or deleted.

RuleMeaning
TRUEUnsuppresses the feature, you could also use "Unsuppress" (in quotes), or "U" (in quotes).
FALSESuppresses the feature, you could also use "Suppress" (in quotes), or "S" (in quotes).
"DELETE"Deletes the feature.
"255|0|0"Will drive the feature to the RGB value 255,0,0 (red)
Driving a feature to a color requires the RGB value to be formatted with each value to be separated with a pipebar.

If a numeric value is driven to the feature that is not in this format (28 for example) DriveWorks will apply a color using default gray numbers for the missing G and B values.

Some Features can have Advanced Feature Parameters captured, which gives control over elements of the feature usually only accessible through the SOLIDWORKS feature manager. For information on how to capture Advanced Feature Parameters please see Advanced Feature Parameters. For information on writing rules for Advanced Feature Parameters please see Model Rules Advanced Feature Rules - Overview.

Deleting Features included in a Pattern

When a feature, that is used as the seed for a pattern, is deleted from a part the pattern will also be deleted.

If the pattern includes any other features, the pattern instances of these features will also be deleted.

Dimension Rule

Dimension rules control the length or angle of a dimension.

RuleMeaning
1098Results in the dimension being driven to a static value of 1098.
TAND(AngleReturn) /AdjacentReturnResults in the dimension being driven to the length of the opposite side of a triangle whose angle and adjacent side length were provided.
The result of any dimension rule needs to be in the same units as the model the dimension has been captured from.

Tolerances

The captured dimension can also have the tolerance controlled. When controlling the tolerance of a captured dimension the format of the output rule is:

DimensionNominalValue|DimensionLowerLimit|DimensionUpperLimit|Type

Where

DimensionNominalValue is the nominal dimension to be applied to the parameter (in the SOLIDWORKS document units)
DimensionLowerLimit is the lower limit for the tolerance (in meters - SOLIDWORKS system units)
DimensionUpperLimit is the upper limit for the tolerance (in meters - SOLIDWORKS system units)
Type is an index number for the type of tolerance to be applied - see chart below.

Tolerance TypeIndex
None0
Basic1
Bilateral2
Limit3
Symmetric4
MIN5
MAX6
Fit7
Fit with tolerance8
Fit tolerance only9

RuleMeaning
25 & "|"& -0.002 &"|"& 0.001 &"|"& 2Drives the dimension to a nominal value of 25, with a lower limit of -0.002, an upper limit of 0.001 with a tolerance type of Bilateral being applied
NominalDiameterReturn&"|"&DWVariableLowerLimit*(25.4/1000)&"|"&DWVariableUpperLimit*(25.4/1000)&"|"& 3

Drives the dimension to the value entered into the form control named NominalDiameter.
Drives the lower limit to the value calculated by the variable LowerLimit (inches), which is then converted to meters.
Drives the upper limit to the value calculated by the variable UpperLimit (inches), which is then converted to meters.
Applies a limit tolerance type (Index 3)

The tolerance precision must be set in the master model for the dimension that is to have a tolerance controlled.

Custom Property Rule

Custom property rules control the text of a custom property. For more information about special custom properties used for driving colors, materials, and textures, see Custom Properties.

RuleMeaning
CustomerReturnResults in the custom property being set to the value the user typed into a text box called Customer.

DriveWorks Quick Tips

DriveWorks Quick Tips: Custom Properties

Custom properties allow you to control the custom properties within a part, assembly, or drawing. We can control anything from text to be displayed, to the colour of the part. Here, we control the colour of a chair, as well as the description and title on the drawing.

DriveWorks Quick Tips are a series of 1 minute videos, available on YouTube, that explain specific functionality. View all Quick Tips

Special Custom Properties

There are some custom property names that, when captured, will allow further model properties to be driven. These are:

  • DWColor or DWColour - Will drive the color of the model to the value specified. Additional parameters allow the illumination properties to be controlled.
  • DWMaterial - Will drive the material of the model to the value specified.
  • DWTexture - Will drive the texture of the model to the value specified.

To drive these properties create a custom property (with the name of the property to be driven as listed above) in the model and capture it in DriveWorks, so it can be seen in the model rules stage of DriveWorks Administrator.

The result of the rule for each of these properties are given in the examples below:

Custom Property Name - DWColor (or DWColour)

Result Format (to drive color only):

Red|Green|Blue

Result Format (for additional illumination parameters):

Red|Green|Blue|Ambience|Diffusion|Specular Amount|Specular Spread|Transparency|Emissivity

RuleMeaning
0|0|255Results in the custom property being set to the value 0|0|255. This will drive the color of the part to be blue.
0|0|255|0.6|0.4|0.5|0.75|0.25|0.1Results in the custom property being set to the value 0|0|255. Additionally the illumination properties will be set as follows:

Ambience - 0.6

Diffusion - 0.4

Specular Amount - 0.5

Specular Spread - 0.75

Transparency - 0.25

Emissivity - 0.1

Custom Property Name - DWMaterial

RuleMeaning
CustomerReturnResults in the custom property being set to the value the user typed into a text box called Customer.

Custom Property Name - DWTexture

RuleMeaning
CustomerReturnResults in the custom property being set to the value the user typed into a text box called Customer.

Instance Rule

The instance rule is used to determine the suppression state, delete, replace the instance or change the configuration of the instance. An instance can have its state changed and configuration switched by using the following syntax

" [State Operation] | [Configuration Name] "

Where

State Operation is the operation to carry out on the state of the instance (Delete, Suppress, Replace and ReplaceFile.)

Configuration Name is the name of the configuration to switch to.

Order Of Instance

The instance order in the SOLIDWORKS feature manager does not necessarily follow the order DriveWorks recognizes.

DriveWorks requires the Instance number to be taken from the order it is listed in the SOLIDWORKS Feature Manager. For example:

SOLIDWORKS Feature Manager displayDriveWorks Order Of Instance
Part<5>

Part<1>

Part<4>

Part<3>

Part-1

Part-2

Part-3

Part-4

If you are unsure of the instance ordering, the DriveWorks capture assistant will indicate the order through Captured Parameter Highlighting.

In the image below Flange <5> in the SOLIDWORKS feature manager is Instance 1 to DriveWorks.

Captured Parameter Highlighting indicates the instance parameter in the DriveWorks capture assistant, on the model AND in the SOLIDWORKS feature manager.

Deleting an instance in an Assembly that is also looped.

When an instance rule results in Delete and the Assembly is also being looped through a Generation Task, the deletion must occur on the last loop.

This is because deleting an instance changes the order of instances in the feature tree.

To achieve this the special variable Current Release Loop Index can be used in the rule, as follows:

If(DWCurrentReleaseLoopIndex= LoopCount, "Delete","")

Where:

LoopCount is the value used in the Loop Count property in the Model Specific Generation Task.

Replacing the instance with a file.

When the instance is to be replaced with a file there are two options that can be used:

  • <Replace> - Will replace the instance with a file that has been captured (either Static or Dynamic) in DriveWorks. (The file name follows the <Replace> string). See How To: Replace a Component With a Static or Driven Replacement Model for more information.

    DriveWorks Quick Tips

    DriveWorks Quick Tips: Replace Feature

    Let’s say you have an assembly for a dresser that can have two different doors. You don’t really want to make two different DriveWorks projects for the same assembly, you would rather just have DriveWorks replace the door for you. Now if only there was a video explaining how it could be done…

    DriveWorks Quick Tips are a series of 1 minute videos, available on YouTube, that explain specific functionality. View all Quick Tips

  • <ReplaceFile> - Will replace the instance with a file that is not captured in DriveWorks. (i.e. any model that DriveWorks is totally unaware of)
RuleMeaning
TRUEUnsuppresses the instance, you could also use "Unsuppress" (in quotes), or "U" (in quotes).
FALSESuppresses the instance, you could also use "Suppress" (in quotes), or "S" (in quotes).
"DELETE"Deletes the instance from its parent assembly.
"HIDE"Hides the component instance.
"SHOW"Will show the component instance.
"Red"The configuration of the model is switched to red.
"<Replace>MyComponentSetName"Replaces the instance with a Component Set called MyComponentSetName. For more information, see the How To: Replace a Component With a Static or Driven Replacement Model help topic.
"U|Red"Will unsuppress the instance and switch the configuration to Red.
"<Replace>MyComponentSetName|Red"Replaces the instance with a Component Set called MyComponentSetName and switches the configuration of the replacement file to Red.
"<ReplaceFile>D:\Models\Part1.sldprt"Will replace the instance with Part1.sldprt located in D:\Models\.
"<ReplaceFile>Models\Part1.sldprt"Will replace the instance with Part1.sldprt located in the Models folder, which is relative to the specification path.
"<ReplaceFile><Project>\Models\Part1.sldprt"Will replace the instance with Part1.sldprt located in the Models folder inside the <Project> location.
The following directives can be used to reference the various folder DriveWorks uses
  • <Project> - Is the project folder location.
  • <Specification> - Is the specification folder location.
  • <SpecificationMetaData> - Is the specification meta data folder.
  • <GroupContent> - Is the group content folder.
"U|<ReplaceFile>Models\Part1.SLDPRT"This will unsuppress the instance and replace with the given file.

Model Tolerances Rule

The captured dimension can also have the tolerance controlled. When controlling the tolerance of a captured dimension the format of the output rule is:

DimensionNominalValue|DimensionLowerLimit|DimensionUpperLimit|Type

Where

DimensionNominalValue is the nominal dimension to be applied to the parameter (in the SOLIDWORKS document units)
DimensionLowerLimit is the lower limit for the tolerance (in meters - SOLIDWORKS system units)
DimensionUpperLimit is the upper limit for the tolerance (in meters - SOLIDWORKS system units)
Type is an index number for the type of tolerance to be applied - see chart below.

Tolerance TypeIndex
Basic1
Bilateral2
Limit3
Symmetric4
MIN5
MAX6
Fit7
Fit with tolerance8
Fit tolerance only9

RuleMeaning
25 & "|"& -0.002 &"|"& 0.001 &"|"& 2Drives the dimension to a nominal value of 25, with a lower limit of -0.002, an upper limit of 0.001 with a tolerance type of Bilateral being applied
NominalDiameterReturn&"|"&DWVariableLowerLimit*(25.4/1000)&"|"&DWVariableUpperLimit*(25.4/1000)&"|"& 3

Drives the dimension to the value entered into the form control named NominalDiameter.
Drives the lower limit to the value calculated by the variable LowerLimit (inches), which is then converted to meters.
Drives the upper limit to the value calculated by the variable UpperLimit (inches), which is then converted to meters.
Applies a limit tolerance type (Index 3)

The tolerance precision must be set in the master model for the dimension that is to have a tolerance controlled.

A part or assembly which has been added to the Model Rules screen and is not contained in a parent assembly.

A part or assembly which has been added to the Model Rules screen and is not contained in a parent assembly.

A part or assembly which has been added to the Model Rules screen and is not contained in a parent assembly.