Home Search

DriveWorks Pro 22
How To: Create Multiple Component Sets From A Single Specification

Send Feedback

How To: Create Multiple Component Sets From A Single Specification

A typical implementation will create a single set of components per Specification.

However, it is possible to create multiple sets of components from a single Specification.

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

This is useful when:

  • A Specification requires more than one variation of the same Component to be created.
  • A library of standard components is to be created en masse.

This topic explains how to add the ability to create multiple Component variations from a single Specification.

How it works

This example uses a Specification Macro that executes the Run Macro In A Loop Task to read a Simple Table.

For each row in the Table another Macro will Release a set of Models and queue all the required iterations to be generated.

The User Form allows each iteration to be specified and the selections stored in a Data Table control.

The results of this control are then exported to a Simple Table (read by the Run Macro In A Loop Task described above).

The File Name property for each model in the component set includes the Loop Index to allow DriveWorks to Generate each iteration.

This could be a more intelligent naming convention or a combination of the concepts discussed in the topic File Naming.

Just keep in mind the name given to the parent Component, or any child of an assembly, needs to be unique (has not been used before) in order for it to be generated.


Once a Project has been created that includes all the correct Captured Information and the required Specification Inputs follow the steps below.

Create a Simple Table

  1. Create an ID column, this will be associated with the Part Number.
  2. Include all Specification input names required, this is where the Models will get their data.

Create an Export to a Simple Table Data Document.

  1. Link this to the table that you have just created.
  2. The ID column will be the Control Field.
  3. Ensure all required fields are captured.
  4. Ensure that the ID column always has a unique ID.
  5. Link all remaining columns to the Return Value of their corresponding form Controls or Variables.

A unique ID can be created by using the number of rows in the Table +1.

Example: TableMaxValue(TableName,1)+1

Create Data Table Control.

  1. Link this to your Simple Table
  2. This will display the Specification Data for each Component once added.

Create a Release Documents Macro

  1. Ensure that you are releasing the Export to Simple Table Data Document.
  2. Link this Macro to a Macro Button on your Form.

Create a Macro to Release the Models

  1. Link this to the Model or Component captured.

Create a Macro that loops through the Simple Table, Running the Macro to Release Models for each line in the table.

  1. Add a Run Macro in a Loop Task.
  2. Set the Macro Name to be the Release Models Macro that was just created.
  3. The Start Value will be 1.
  4. The Limit Value will be the number of rows in your Simple Table at point of Running.
  5. Create a Loop Counter Constant, this will be linked to the Counter Constant.

Link Model Rules to the Simple Table

  1. Using DriveWorks functions such as TableGetValue link Model Rules to the Table.
  2. Use the Loop Counter Constant to ensure that the Component's Model Rules are correct at the point of Generation.
Example: TableGetValue(DwLookupTableName,ColumnNumber,DWConstantLoopCounter)

Modify the File Name Property for each Model to include the Loop Index.

  1. This will ensure that your Models are unique.
Example: DWSpecificationId &" - "& DWConstantLoopCounter.

Further considerations

Delete incorrect Model Data from the Table

If you would like the ability to delete a row from the Simple Table you can use the Delete Simple Table Rows Macro Task.

You can link this to another Macro Button on your form.

Data Table

The Data Table is not a requirement, if you do not want the Specification Data to be displayed on the form this can be hidden from the user.

Model Folder Structure

If every iteration of the model needs to be in a separate folder, you can use the same logic applied to the File Name Property in the Relative Path Property.