You are on page 1of 126

DriveWorks Pro

Advanced Training
ADV.V18

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 1


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 2
Contents
Lesson 1 ............................................................................................................................... 5
Advanced Form Controls ................................................................................................... 7
Lesson 1 Exercise ........................................................................................................... 11
Lesson 2 ............................................................................................................................. 25
Specification Control........................................................................................................ 27
Lesson 2 Exercise ........................................................................................................... 35
Lesson 3 ............................................................................................................................. 53
Linking to Data ................................................................................................................ 55
Lesson 3 Exercise ........................................................................................................... 65
Lesson 4 ............................................................................................................................. 77
Rollup Data Tables .......................................................................................................... 79
Lesson 4 Exercise ........................................................................................................... 81
Lesson 5 ............................................................................................................................. 85
Hierarchical Properties .................................................................................................... 87
Lesson 5 Exercise ........................................................................................................... 89
Lesson 6 ............................................................................................................................. 95
Generation Tasks ............................................................................................................ 97
Lesson 6 Exercise ........................................................................................................... 99
Index ................................................................................................................................. 125

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 3


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 4
Lesson 1
Lesson 1 Outline
Upon successful completion of this lesson you will be able to:

• Enhance your forms using Static and Dynamic properties.

• Use advanced Form Controls.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 5


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 6
Advanced Form Controls
Child Specifications
Child Specifications work in much the same way as Item Lists, except that instead of
launching a single Form for each row in the list, a complete DriveWorks Project is
launched.

These Child Projects are complete Projects in their own right, with Form Navigation,
Documents, Model rules etc.

Data is passed down into the Constants of the Child Specification, and then passed
back up from the Variables of the Child Specification into the list.

Child Specification controls have a dynamic property that launches a configuration


Form, where the links between the top level and each Child Specification are
configured.

Each Child Specification control can have more than one Child Project linked to it.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 7


Data Tables
Data Tables are used to display data from an external database. They have properties
for setting up the database, username and password, table, fields and a where clause
for filtering the data.

All of these fields are static, with the exception of the where clause, this allows the
data to be filtered based on other selections on the forms.

A good knowledge of the external database is required to use this control. If the data
entered in the properties is not valid, a message will appear in place of the data.

In the example below, the table name has been misspelt.

Macro Buttons
The Macro Button control can be used to run tasks in DriveWorks. When created, a
clickable button is added to the Form. This button can have images applied to it -
Picture, Picture (Hover) and Picture (Pressed) - to give the impression of a clickable
image. Macro Buttons are introduced in the final lesson of the Essentials Manual

The button can be linked to Specification Macros in DriveWorks, or to external code to


perform custom actions.

Macro buttons are commonly used to allow for In-Form Navigation, i.e. have Next and
Previous buttons, which replace the standard Form navigation. Why not experiment
with using Macro buttons to run tasks within a Specification Macro.

For more ideas on how Macro Buttons can be used, search ‘Macro Button’ in the
online help file

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 8


Specification Host Control
The Specification Host allows you to host a Specification or Child Specification in your
form.

The properties on the control do not determine what specification is shown. The
Specification Host control is a placeholder for where the specification is going to be
shown.

The Specification Host control is told which specification to show by a Specification


Macro called Set Specification Host Control. With this Specification Macro, you can
create new specifications or edit existing ones.

Data can be passed to the hosted Specification from the host Specification.

Specification Macros can be run in the hosted specification by the host specification.
And likewise, the hosted specification can run Specification Macros in the host
specification.

The control allows you to view one specification within another. The hosted
specification does not necessarily need to be a Child Specification. It could be multiple
specifications running in parallel.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 9


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 10
Lesson 1 Exercise
Prepare Straight Conveyor Project
This exercise will take you through the creation of an additional Project that will allow
many straight conveyors to be specified in one order. You will create a Child
Specification List Control in this new Project. You will then set up this Control to run
your existing Straight Conveyor as a Child Project.

Firstly, you are going to create a Constant in the Straight Conveyor Project to pass
down an Order Number from the Parent Project (which you haven’t created yet).

You can pass data/values between Parent an Child Project by following these rules:

- To pass data down from a Parent to a Child Project, Constants in the Child can be
linked to values in the Parent using the Child Specification List Control. This will be
covered in this lesson.
- To pass data up from a Child to a Parent Project, you can use Variables or a
Rollup Table (covered in lesson 4)

1. With the Straight Conveyor Project open, add a new Constant called
OrderNumber

Do not enter a value for this Constant, leave it blank.

2. Switch to the Form Designer and select the OrderNumber text box from the Main
Left 1 Form.

3. Build a rule for the Text (Override Rule) property.

This allows you to build a rule that will override anything that is typed in.

4. Create the following rule:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 11


Notice that the rule has OrderNumber for the second argument and not
OrderNumberReturn.

Note:

This is because we want to use the value coming back from the Form, if
DWConstantOrderNumber is blank. Using OrderNumberReturn would create a
circular link within the control. Using OrderNumber prevents the circular reference from
occurring.

This can be entered by double clicking on the Name Control Property in the bottom
right hand corner of the Rule Builder (you may need to click Show Control Properties)

We will later create a Layout Project where an order number will be defined. This order
number will then by passed into the Straight Conveyor Project and into the Order
Number Constant.

The rule you just created tells the Order Number Control to use the value coming from
the Order Number Constant as its values, unless the Order Number Constant is Blank.
This is so that if the Straight Conveyor Project is run individually (not as a Child,
therefore no order number will be passed down), an order number can be defined at
this level.

The next step is to disable this OrderNumber control if a value has been passed down
from the top level Project into DWConstantOrderNumber

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 12


5. With the OrderNumber control still selected, build the following rule for the Enabled
Property:

Using this rule, if the DWConstantOrderNumber value is blank, the OrderNumber


text box will be enabled, allowing the user to enter a value. Whereas if a value has
been sent down from the Parent Project (not yet created), it will be disabled and will
not allow the user to enter a value.

In addition to setting the Order Number, it would be a good feature to standardize the
conveyor width and height based on the previously defined conveyors. With this set
up, you will be able to define the height and width in the first straight conveyor.
However, every subsequent conveyor will be set at the same height and width.

6. Create two new constants called ParentHeight and ParentWidth. Leave their
values empty.

7. Select the Conveyor Width control on the Main Left 1 form. Build the following rule
for the Value (Override Rule):

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 13


Concept – DWParentRowIndex:

DWParentRowIndex returns the row number from the Child Specification Control in the
Parent Project. If three previous Child Projects have been configured and you click
Add to configure a fourth, DWParentRowIndex will return the value 4.

This Rule checks to find out if it is the first child specification and if it is, it will allow you
to change the Width, if it is not, it will be fixed to the value of the Parent Width
Constant.

Concept – OR/AND:

The Rule above uses an OR statement within the IF Function. This allows you to have
two (or more) conditions within one IF Function. You can also use AND in the same
manner.

8. Build a rule for the enabled Property that will disable the control when the
ParentWidth constant has a value or when the Parent Row Index is 1:

9. Select the Conveyor Height control on the Main Left 1 form. Build the following rule
for the Value (Override Rule):

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 14


10. Build a rule for the enabled Property that will disable the control when the
ParentHeight constant has a value:

11. Create three new variables based on the table below:

Name Rule
SectionHeight = ConveyorHeightReturn
SectionWidth = ConveyorWidthReturn
SectionLength = ConveyorLengthReturn
These Variables will be passed up into the Parent Project later on in this lesson. They
will be used again in a Contract Quote as well as for creating the Conveyor Layout
assembly in the final lesson.

Create Parent Project


The next step is to create a new Parent Project that will be used to specify multiple
Straight Conveyor Child Projects.

12. Create a new DriveWorks Project called Conveyor Layout.

13. For the training, save this Project in a sub folder called ConveyorLayout in the
same location as the Group file. C:\DriveWorksPro\Conveyor

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 15


14. Click Finish.

This will create and open the ConveyorLayout Project.

15. Switch to the Form Design task in the Task Explorer and add a Text Box called
OrderNumber

16. Add a Child Specification List Control. Call this control LayoutItems.

17. Select the new Child Specification List Control on the Form Designer, select the
Projects property from the properties on the right and click on the dots to build.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 16


Instead of launching the Rule Builder, this will open a configuration dialog for setting
up the Child Specification List and its links to the Child Projects (in this case, the
Straight Conveyor Project).

The Child Specifications List Editor has four sections.

Project Details

On this tab, select the Project that you wish to run as a Child Specification.

18. Check the Straight Conveyor entry in the list.

DriveWorks Administrator now needs to get the list of Constants in the Straight
Conveyor Project.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 17


19. Select the Straight Conveyor entry in the list and click the blue information link to
refresh the Constants data.

This will now list all the Constants from the Straight Conveyor Project.

20. Select the OrderNumber Constant from the list and click the Build Rule button.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 18


This will launch the Rule Builder.

21. Build the following rule, directly linking the OrderNumber Control in the
ConveyorLayout Project, to the Constant called OrderNumber in the Straight
Conveyor Project.

Result Columns

This tab enables you to set up the column headers for the Child Specification List.

Three columns are added by default. The first will be automatically populated with the
Specification Name of the child Specification, the second for the Child Specification
Project name (which can be hidden by changing the controls Type Column Visible
property to False). The third will have a value for the State of the Child Specification
(Saved, Pending, Completed etc.).

22. Switch to the Result Columns tab on the Child Specification List Editor.

Any columns that you add will then collect data back from the Child Specification, from
its Variables or Specification Properties. These values can then be used in rules in the
Layout Project.

23. Create three Result Columns called Length, Width and Height by typing each one
in turn in the Add Column text box and clicking Add.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 19


Result Column Values

24. Switch to the Result Column Values tab.

25. Make sure the StraightConveyor is selected.

26. For each Result Column, double click in the Output Name column and select the
Variable that you want to populate the column with.

27. Link the Height column with the Variable SectionHeight

28. Link the Length column with the Variable SectionLength

29. Link the Width column with the Variable SectionWidth

Note:

(Auto) automatically links a result column with a Specification Property of the same
name.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 20


30. Go back to the Project Details tab. Select the Parent Width Constant and build the
following Rule.

Concept – Child Specification Control as a Table:

The Child Specification Control gathers data from Child Specifications and displays
them on the form. This data can then be accessed using Table functions as it is
essentially a table.

A Child Specification Control table is distinguished by the prefix of DWSubResults.

You can easily access this by clicking the Tables button on the Command Bar of the
Rule Builder.

This will read the value from the first row of the Width column and pass it to the
ParentWidth Variable in the Straight Conveyor Project. We will also need to do the
same for the ParentHeight Constant

31. Select the Parent Height Constant and build the following Rule.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 21


Settings

32. Switch to the Settings tab.

33. Make sure the option Continuously synchronize with embedded Specifications
is selected.

Concept: Embedded Specification

An Embedded Specification is where a Child Specification is stored within a Parent


(ConveyorLayout) Specification. Doing this means Child Specifications are also copied
when a Parent Specification is copied.

Embedded Specification is a Project level setting which is turned on by default.

When you select the option to Continuously synchronize with embedded


Specifications, this causes any Constants which are being set by the Parent to be
updated instantly without the need to open the children.

It also means that the values shown in the Child Specification List are updated
automatically when the values of the Variables in each Child change.

34. Select OK to complete the Child Specification List Editor.

Note:

The model File Name rules in the Straight Conveyor Project are linked to the
OrderNumber control, which is set by the OrderNumber control from the Layout
Project as well as the Specification ID.

If the Specification ID was not being used this would cause a problem. Each of the
Child Specifications would have the same Order Number, causing them to try to create
models with the same name.

To resolve this, you could use the DWParentRowIndex special variable to find out the
row index in the child specification. For example, the first conveyor added to the child
specification list would be 1, the second 2 and so on. This will ensure that the file
names are always unique.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 22


35. Save the Project and switch to the Specification Explorer and specify a new
Conveyor Layout.

36. On the ConveyorLayout Specification, use the Child Specification Control to


specify some Straight Conveyors. Input a value into the OrderNumber Control of
the Conveyor Layout Project to see it passed into each Child Project.

You may have noticed that it is still possible to add a straight conveyor without entering
an order number. This isn’t something that should be possible and could confuse the
process. Therefore, we will now add a rule to the Project that will prevent the Child
Specification Control being used until the Order Number Control has been filled out.

37. Go to the Form Designer and write the following rule for the Enabled Property of
the Layout Items control:

This has now linked the enabled property of the Layout Items control to the Error
Property of the Order Number control. Next, we need to write a rule for the error
property of the Order Number control (as you did in the DriveWorks Administrator
Essential Manual for the StraightConveyor Project).

38. Write the following rule for the Error Result Property of the Order Number
control.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 23


Tip:

You could open the Straight Conveyor Project and copy this same rule from the Order
Number control.

39. Save the Project and specify a new Conveyor Layout to test this new functionality

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 24


Lesson 2
Lesson 2 Outline
Upon successful completion of this lesson you will be able to:

• Change Specification Settings to control the name and location of your


Specifications.

• Set Specification Properties to control the columns you see in the


Specification Explorer.

• Change the Specification Flow to control who creates what and when.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 25


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 26
Specification Control
Concept: Specification Control

DriveWorks Pro offers the ability to set up Users and Teams to enable different people
to interact with your Projects in different ways, and to give specific people access to
Specifications at the appropriate time.

There is also the ability to change the way a Specification is displayed and processed,
ensuring that the correct data is created, at the correct time, by the correct people.

Users and Teams


Users and Teams can be set up to allow different users and teams of users to have
specific permissions in DriveWorks Projects and Groups.

For example, permissions can be set on who is allowed to edit and specify individual
Projects.

Teams can have team leaders, who can allow them to access the Specifications of all
members of their team.

Users who are not Team Leaders will only be able to see their own Specifications.

Specification Settings
There are four tasks in Specification Control in the Task Explorer to set up different
elements of a Specification.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 27


Specification Settings are where the rules for the Specification Name and Specification
Path are built.

Specification Name

The Specification Name is shown in the Specification explorer list and is a way of
identifying individual Specifications.

"<<Project Name>> "&TEXT(DWSpecificationID, "0000")

The default rule is made up of the project name, followed by a space, followed by an
automatically inbuilt incrementing number (using the special Variable
DWSpecificationID). The number is formatted to have leading zeros using the TEXT
function.

You can change this rule as required, however it is important to always ensure that the
result of the rule is unique.

Files are created using this value, so it is important that it doesn't include characters
that are not appropriate for a file name.

There is a Function in DriveWorks that will return True/False based on whether the
Specification name you have chosen is valid. This is particularly useful if a free type
text box value is used to calculate the Specification name.

The function IsValidFileName can be used to show an error message if it does not
return True.

Specification Path

The Specification Path is either an absolute path, or a relative path (relative to the
Default Specification Folder, which can be changed in the Specification Settings and
also has a default value).

This path dictates the location for the Specification files created each time the forms
are filled in.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 28


The Specification Path is also pre-set with a rule that gives it the same value as the
Specification Name.

This means that by default, Specification files are stored in the following location

<<Default Specification Folder>>\<<Specification Path>>\

The rule for the Specification Path can be changed. The resulting value does not need
to be unique, but it does need to be a valid file path, or part of a file path.

The rule can also include a directory separator (\ on most systems) to further sub
divide results into folders.

If the rule for Specification Path is changed to be:

Then the Specification Files themselves would be placed in a customer folder, with a
sub folder for the actual customer name (in this case from a Variable). There will then
be another sub folder using the Project name and an incrementing value using
DWSpecification (which is the special Variable used to store the Specification Name).

The result of the rule needs to be valid for part of a file path. To ensure this is the case,
there is a function (IsValidRelativePathResult) which can be used to flag an error
condition to the user.

If the path that results from the rule does not actually exist, then it will be created by
DriveWorks when the Specification is saved, finished or released.

Additional Folders

DriveWorks Pro creates folders where necessary for the Specification Path as well as
any Model Relative paths and Document paths.

Additional Folders are used to create folder structures not already accommodated in
these other paths. These folder structures will have no files in them, but can help to set
up a folder structure for a contact where others may then need to manually place files.

Additional Folders are created by a single rule, with a Pipe Bar (|) separating each path
to be created.

If the following folder structure is required within the default Specification folder as
follows:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 29


Then the rule for the additional folder would be something like this:

Specification Properties
Specification Properties allow the creation of additional columns, whose values are
based on rules, to be shown for each Project in the Specification Explorer.

Once a rule has been built, the next time a Specification is created the values will be
populated into the Specification Explorer list.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 30


Specification Macros
Specification Macros are simply a method of running tasks in DriveWorks. They can be
run by a Transition, an Operation or most commonly by a Macro Button on a
DriveWorks Form.

The tasks that can be run include:


• Drive Constant Value
• Drive Control Value
• Skip Form
• Release Models
• Release Documents
• Cancel Specification, plus many more

Explore the tasks in the Toolbox for the full list of available tasks. Information on what
each task can achieve is listed in the DriveWorks Pro help file.

Tasks are run in order from top to bottom and the order to which tasks are run can
alter results.

A common use of Specification Macros is to create buttons on a DriveWorks Form to


navigate between Forms, cancel a Specification and run a Transition to leave a
Specification. These buttons can then be used in place of the standard navigation
buttons.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 31


Specification Flow
By default, when a user gets to the last Form of a Specification, there are two main
options, Finish and Release. When Finish is clicked, documents are normally created,
and the Specification is marked as being "Pending". When release is clicked, models
are calculated and released to the generation queue. The Specification is then marked
as being "Completed".

What determines all of this is known as Specification Flow.

There are a number of different States by default, and 3 different State Types.

State Types

Running

Forms are displayed and information can be entered into the Controls

The only default Running State is called Specify.

Paused

The forms are not displayed, the default Paused States are

• Saved

• Pending

• Completed

Automatic

This State Type will be processed by DriveWorks Autopilot

The default Automatic State is Released To Server.

When in each State, there are a number of actions that can be taken, which will move
the Specification from one State to another.

For instance, when in the Pending State, the Specification can be Deleted, Edited,
Copied or Released.

This is best explained by showing the default Specification Flow in graphical Form.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 32


In DriveWorks Pro, you can change this Specification Flow to suit your needs.

This configuration could include renaming States and Transitions, so that rather than
clicking Finish to change the State to be Pending, a User could click Quote to
transition into a Quoted State.

Each State has Operations, Transitions and Events.

Operations

An example of an operation on a state is the ability to Copy or Delete it.

By default, each of the Paused and Automatic states has these operations.

Operations can have conditions and user permissions attached to them.

Transitions

The Transitions dictate which State can be transitioned into any other State.

An example of this is that the Specify (Running) State can be Transitioned into a
Saved (Paused) State by clicking a Save button.

Transitions can have conditions and user permissions attached to them.

Events

Events allow tasks to occur on the exit and entry into any state.

An example of an event task could be to increment the revision number of a


Specification, or delete a file or folder upon entry to the State.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 33


Specification Flow Templates

You can create your own completely custom Specification Flow, or you can begin by
using one of the templates that comes shipped with DriveWorks Pro.

You can also create templates from your own custom Specification Flows. This is great
for reusing a Specification Flow in another Project.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 34


Lesson 2 Exercise
Users and Teams
The first part of this exercise involves creating two teams of users with one or two
users per team.

One of the team members will be a team leader.

1. With DriveWorks Administrator open, log into the DriveWorksTraining Group and
select the Security Settings Task in the Task Explorer.

Note:

It does not matter if you have a Project open to administer the Security Settings as
they apply to the Group as a whole.

There is already one User and one Team in the list.

The user is the one that you entered when you first created the Group (by default it is
called Admin). The default Team is Administrators.

2. Click the Add Team button on the Command Bar, call it Sales Team and click OK.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 35


A Team configuration dialog will appear where you can set the permissions and
settings for this team.

3. Uncheck the option for Members Can Capture to ensure that members of the
Sales Team cannot capture models in SOLIDWORKS (even if they have
DriveWorks Administrator installed).

Leave the other two checkboxes unchecked, as we would not want members of the
Sales Team to be able to change the security settings, or see every Specification
regardless of who created it.

4. Switch to the Project Permissions tab and select each Project in turn For each
one, check the option on the right to allow members of the Sales Team to run the
Project.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 36


5. Click OK to save the Team settings (Users will be added to the teams after they
have been created).

6. Click on the Add User button on the Command Bar, create a user called Sales
Manager and click OK.

A user configuration dialog will appear where you can set the permissions and settings
for this user.

7. Check the option that makes this user a Team Leader.

Concept – Team Leader

A Team Leader will be able to see all of the Specifications from all users in any team
they are a member of (Users can be in more than one Team).

8. Switch to the Teams tab, and check the entry for Sales Team.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 37


This will add the Sales Manager to the Sales Team.

9. Click OK to save the settings for this User.

10. Create another new user called Sam and add them to the Sales Team. Do not
make them a Team Leader.

11. Create another new Team called Engineers. Leave the option for Members Can
Capture checked.

12. On the Project Permissions Tab, ensure that the Engineers team can Run AND
Edit both Projects.

13. Add a new User called Eddie and add him to the Engineers Team.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 38


Tip: Email Address

If you enter an email address for each user, you will be able to build rules that refer to
the current users email address.

Specification Properties
In this part of the exercise, you will be adding a Specification Property that will
enhance the use of the Specification Explorer.

Specification Properties are specific to each Project, although we recommend using


common property names where possible, like Size and Description.

14. Open the Straight Conveyor Project.

15. Select the Specification Properties task on the Task Explorer.

16. Click Add on the Command Bar to create a new Specification Property called
Description.

17. Select the new Specification Property and click Build on the Command Bar to build
a rule for this property.

18. Build a rule for this Specification Property to link it into the Description Variable that
was created in the previous training manual.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 39


Now, every time you specify a Straight Conveyor, the description will appear in the
Specification Explorer.

Note:

Specification Properties are only applied to Specifications created after the Property.
Previously created Specifications will not have the property applied.

19. Create another Specification Property called Unit Price

Note:

Ensure that the Property is named exactly as Unit Price. This will be used later on in
the Layout Project and the spellings must be identical for the data to be sent to the
parent project.

20. Link the Unit Price Specification Property to the Total Price Variable.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 40


Straight Conveyor Specification Flow
We will now edit the Specification Flow for both Projects in this Group.

The flows will be designed to work with one another as well as make use of the Users
and Teams that have been set up.

21. With the Straight Conveyor Project open, select the Specification Flow task in the
Task Explorer.

The design of the Specification Flow for the Straight Conveyor Project will allow the
user to add Straight Conveyors to the Layout Project. The Layout Project will then be
in control of moving the Specification to the Complete State at which point the models
will be generated in SOLIDWORKS

22. Click Clear

We are going to start again with a blank Specification Flow to be sure of the
functionality we are applying. Editing the existing one may result in left over tasks and
permissions from the previous design.

23. Click Add State and enter the name Specify

24. Right click the newly created State and select Running and Initial State

25. Add three more states called In Layout, Editing, Complete.

26. Change the Editing State to be a Running State.

27. Select the Specify State, click Add Transition and provide the name Add to
Layout.

28. Drag this Transition to the In Layout paused state.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 41


29. Select the Specify State, click Add Transition and provide the name Generate.

30. Drag this Transition to the Complete paused state.

31. Create a Transition called Edit that starts at the InLayout State and goes to the
Editing State.

32. Create a Transition called Update Layout that starts at the Editing State and goes
to the InLayout State.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 42


33. Your Specification Flow should now look like this.

With the flow created, we can now assign tasks to Transitions, Operations and the
point of Entering and Leaving a State. Tasks can perform functionality such as driving
values into Controls and Constants; Releasing Models, Documents and Emails; plus
much more. All available Tasks can be seen in the Toolbox within the State Editor, as
seen below.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 43


In addition to this, Conditions and Team based Permissions can be applied to the
Transitions created.

34. Click Edit.. on the Specify State.

35. Right click the Generate Transition and select Edit Conditions.

The condition that we will apply on this Transition is that it will only be enabled when
the Order Number Constant is blank. If there is any value in the Order Number the
Transition will be disabled.

36. Double click the Check Value task in the toolbox to add it to the list of Conditions.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 44


37. Double click the grey dot alongside the Value Property of the Check Value Task

38. Build the following Rule:

If this Rule evaluates to be True, the Transition will be enabled. Therefore, if the
Specification is started individually, this Transition will be enabled. If the Specification
is started by the Layout, it will be disabled. This is because the Order Number constant
only contains a value if the Straight Conveyor Project is ran as a Child Project.

We will now do the opposite for the Add to Layout Transition.

39. Right click the AddToLayout Transition and select Edit Conditions.

40. Add a Check Value task to the Condition.

41. Make the Value Property dynamic and build the following Rule:

DWConstantOrderNumber <>""

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 45


This Rule states that the OrderNumber does not equal a blank value.

42. Next, add an operation to the InLayout State called Delete.

43. Edit the InLayout State.

44. Select the Delete Operation

45. Filter for and add the Delete Specification Task to the Task Sequence

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 46


Note:

States can have Operations as well as Transitions. Operations are the links (or buttons
when run as a Child Specification) that appear in the Specification Explorer (or Child
Specification List) when you select the Specification in the list. They can run the same
tasks as a Transition, however they will not necessarily Transition the State

46. Edit the Editing State

47. Select the Leave State Event

48. Add the Increment Revision Number task to the Task Sequence.

49. Edit the Complete State.

50. Add the Release Documents and Release Models tasks to the Enter State
Event.

51. Change the Models Property to be an asterisk. This will release all Models in your
Model Rules.

52. Change the Documents to be an asterisk. This will release all Documents.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 47


Concept – Deferred Drawings

Within the Release Models task, you can determine whether the generation of
Drawings are deferred to a later time.

You can make this property dynamic and write a Rule for it.

You can also determine specific Drawings to be deferred or all of them by using an
asterisk.

Conveyor Layout Specification Flow

53. Open the Conveyor Layout Project and go to Specification Flow in the Task
Explorer.

54. Click Customize Specification Flow

55. Click Clear on the Command Bar.

56. Create the States and Transitions shown in the Image below:

57. Click Edit on the Awaiting Approval State.

58. Right click Begin Approval and select Edit Teams.

We will now determine that only members of the Engineers and Administrators Team
can click the Begin Approval Transition.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 48


Concept: Specification Flow Permissions

Permissions can be set for each state, and also for the Transitions and Operations
from a State. If a User is in a Team that can Transition out of a State, then they will be
able to enter or view the State regardless of the permissions on the State itself.

59. Change the option from All to Custom.

60. Uncheck both options for Owner and Creator

Concept: Owner and Creator

Owner
User who last modified the Specification

Creator
User who clicked New to create the Specification

61. Select the Administrators team on the left and click Add.

62. Select the Engineers Team on the left and click Add.

63. Click OK to confirm these permissions.

64. Select the Order Complete State and add an Operation called Copy Order.

65. Edit the Order Complete State.

66. Select the Copy Order Operation and add the Copy Specification task to its Task
Sequence.

Concept: Change Child Specification State

One task which can run in a Task Sequence is the ability to change the state of a Child
Specification.

This can allow you to trigger tasks and actions to be completed by another
Specification which has been specified in the Child Specification List Control.

In this example, we will move the Child Specifications from the InLayout State to the
Complete State. Upon entering the Complete State, each Child Specification will
Release its Models and Documents. These will then be available in the Model
Generation queue.

67. Edit the Approving State and select the Approve Transition.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 49


68. Filter for and add the Change Child Specification State to the Approve Transition

There are three important properties for this task. They are explained in detail below.

DefinitionNames

This is the name of the Child Specification control that you added to the Form on the
Contract Project. This gives you full control of which Child Specification Form control
has its Child Specifications actioned.

In this training, you simply need to enter an asterisk (*) to indicate that all Child
Specification Form Controls will be affected. This is the easiest approach to take when
only one Child Specification List exists. If you change the name of the control, you will
not need to update this property

69. Set the DefinitionNames Property to be an asterisk (*)

ProjectNames

You can also set a value for the Projects that you wish to transition. If there is more
than one Project available as a Child Specification, you can decide which Projects get
transitioned. If you want to change the state of multiple Projects, but not all, you can
use a Pipe Bar | to separate each Project name

In this case, you will again use the asterisk to indicate that all Child Projects will be
transitioned.

70. Set the ProjectNames Property to be an asterisk (*)

StateName

The last action is to enter the state that the Child Specifications will be transitioned to.

71. Set the StateName Property to be Complete

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 50


72. Edit the Sales Entry State and select the Leave State Event.

73. Filter for and add the Release Documents task to the Task Sequence.

74. Set the Documents Property to be an asterisk (*).

75. Edit the Approved State and select the Enter State Event.

76. Filter for and add the Release Models task to the Task Sequence.

77. Set the Models Property to be an asterisk.

Tip:

To reposition the transition arrows that connect the states, left click and hold down the
mouse button on any of the little black blocks .The rectangle will turn into a black
square that can now be dragged around the perimeter of the state.

Concept: Hide Project from non-administrators

There is a setting that will Hide Project from non-administrators. This will need to be
unchecked for each Project to allow your non administrative users to see the Projects
when specifying.

Each Project will need to be opened in turn to make this change.

This Setting exists so that Projects can be added to a Group without them being
instantly available to other users.

78. Click Settings in the header.

79. Navigate to Project Settings and uncheck the Hide Project from non-
administrators option.

80. Open the Straight Conveyor Project

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 51


81. Click Settings in the header and select Project Settings.

82. Uncheck the Hide Project from non-administrators option.

83. Test out the new Specification Flows by logging into DriveWorks Administrator
using different user names to ensure that the correct Transitions are available and
the correct permissions are set. If you have a license of DriveWorks User, why not
try using this to test your Project?

Tip:

The easiest way to log in as a new user is to close the Group. This can be done by
clicking the close button option on the header bar.

An alternative method is to go to the DriveWorks Today Screen and double click on


the DriveWorks Training Group. This will reopen the Group and ask you to log in
again.

Tip:

If at any point you wish to restore the default Specification Flow, click the Restore
Default button on the Command Bar. This will remove any customizations you have
made to the Specification Flow and restore the default.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 52


Lesson 3
Lesson 3 Outline
Upon successful completion of this lesson you will be able to:

• Use external data in a Table.

• Query data directly in a rule or Form Control.

• Export data back to a database/Group Table based on rules.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 53


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 54
Linking to Data
Tables
DriveWorks Pro has the ability to either import external tabular data, or to link to a
table dynamically. This data could come from Microsoft Excel, text files or an external
database such as Microsoft Access, Microsoft SQL or other third party applications
such as ERP or CRM.

SQL Server databases can be accessed directly. Other database types are accessed
via an ODBC connection. Most databases have ODBC drivers that can normally be
downloaded for free from the internet.

Using data from external databases does require knowledge of the data structure, as
well as knowing any usernames and passwords required to access this data.

This section will take you through importing or linking to external data in a database.

DriveWorks Pro has a wizard for configuring your external data, which then gives five
options, as seen below:

Each table requires a name. This name is important when using each table in rules.
Each table should have a meaningful name.

This section will go through the configuration of a Table using an external database.

ODBC Data Table

This option gives the ability to import data from an external data source. Further
configuration screens also allow the data to be refreshed during Project load, making
it a dynamic link.

Selecting to link to an external data source presents a wizard that allows for the
selection of the ODBC source.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 55


Again, the table needs a meaningful name.

If the database requires authentication, this can be entered on this screen.

After selecting the Data source and clicking Next, the table and fields can be
selected.

Only select the fields that you will need for your rules.

The table drop down will list all of the tables in the database. This drop down can
also be typed in if you are pulling data from a database view or Query.

Checking the option to refresh the data means that the data will be re-imported when
you start each Specification, in case the data has been changed.

Clicking Finish imports the data.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 56


Clicking OK in the Command Bar accepts the data.

SQL Server Data Table

This option links directly to a table in a SQL Server database without requiring an
ODBC connection to be configured on each machine accessing the data.

Excel Data Table

Imports data from an Excel spreadsheet. Once imported the data can be edited
directly in DriveWorks.

Simple Table

A data table into which data can either be directly typed, or copied and pasted from
tabular data in text files or spreadsheets.

Group Tables

Group Tables allow data to be stored at Group level. The data is accessible to all
Projects within the Group. The ability to export to these tables allows new records to
be inserted or existing records to be updated.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 57


Data Functions
DriveWorks Pro has a number of functions for specifically accessing data. Each of
these functions has its own wizard to assist the building of a rule.

There are two types of these:

• Functions that interact with DriveWorks Tables to retrieve data based on


rules.

• A function called QUERYDATA that is used to access data directly and


dynamically from an external database.

Table Functions

These are used to find specific data in a table, for instance retrieving a value from
column 3, for a given value in column 1.

They can also be used to get conditional data, or to create a list.

DWVLOOKUP

The DWVLOOKUP function will get the value from a specific column where it finds a
match in a specified column.

Function Wizard

Syntax

DWVLOOKUP( [Lookup],[In],[ SearchColumn],


[ReturnColumn],[MatchType] )
Searches a specific column in the selected table for a match (either exact or nearest;
defined by MatchType) to the Lookup value. If a match is found, the data from the
specified column in the matching row is returned.

Lookup is the value to be found.

In is the table within which the Lookup value is to be found.

SearchColumn is the number of the column containing the data to be found.

ReturnColumn is the number of the column containing the data to be returned.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 58


MatchType defines whether the match has to be exact or the nearest found.

Examples

Vehicles Table
Make Model Color

Volkswagen Golf Blue


Ford Escort Red
Renault Kangoo White
Mazda 2 Black

Rule
DWVLookup(ModelComboBoxReturn, Vehicles, 2, 1, FALSE)

Meaning
The function looks in the Vehicles table for a match, in the Model column of the table,
for the value returned from the ModelComboBoxReturn. If a match is found, the
function then looks across to the Make column and returns the value in the same row
as the match found.

Example Outcomes
Lookup In SearchColumn ReturnColumn MatchType Outcome

"White" Vehicles 3 1 Exact "Renault"

"Kangoo" Vehicles 2 3 Exact "White"

GETTABLEVALUE
Used to retrieve a value from a specific cell in a table based on its row and column.

LISTALLCONDITIONAL
Used to get a list from a column where matches in more than one search column is
required.

SUMTABLECOLUMN
Used to add up the values in a specific column in a table.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 59


QUERYDATA
QUERYDATA gives the ability to retrieve data dynamically from an external data
source based on conditions that can be set in the function.

The data retrieved could be either a list (if more than one value in the table meets the
criteria) or a single value (if only one match is found).

QUERYDATA has a multi-step function wizard.

The first step is for selecting the DSN that points to the database. A Username and
Password can be entered as required.

The next step selects the Table that contains the data in the database.

After clicking Next, the field name whose values are to be returned is selected, along
with another option if a Maximum, Minimum, Count or Distinct value is required.

The next step is for applying criteria to your search, for example, only Customers
starting with the letter P may be required, or values that meet criteria based on other
Form inputs.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 60


The penultimate step is for setting the sorting order. This sorting could be ascending or
descending on any column.

The final step is for testing the results. Depending on the amount of data returned, this
could be a list or a single value.

The result of using the Function Wizard is a rule with 4 arguments.

QUERYDATA( [DSN], [SQL String], [Username], [Password] )

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 61


Data Export
ODBC Data Export

DriveWorks Pro can write data to a database based on rules.

A good knowledge of the database you are exporting to is required, and specific
attention must be given to the data type of fields in the database, as well as the
existence of auto numbering fields, and fields that do not allow empty values.

The database data is driven through an ODBC connection.

Using the wizard, the Data Source is selected, along with any security credentials that
your data source requires for access.

Next, the table to be exported to is selected from the tables in the chosen database.

DriveWorks gives the ability to drive data into one or more rows in a table.

There is also the ability to either insert a new row, or update an existing one.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 62


This is handled by the use of Control Fields.

Control Fields are selected from the existing fields in your table.

If the combination of values from the control fields do not exist in the database, then a
new record will be written.

If the combination does exist, then the other fields will be updated with the data from
the rules.

If any of the control fields have a rule that results in an empty string, then no action will
be taken.

In this example, the CustomerName and ContactName fields have been selected to
control the data export.

If the CustomerName is already in the database, and the ContactName is not for that
customer, then a new row will be entered.

In other words, if the combination of the values for the control fields does not exist,
then a new row will be inserted in the table.

If the combination of CustomerName and ContactName is already in the database,


then the other fields will be updated based on the rules.

If either value is blank, then no action will be taken.

The next action is to select the Common Fields.

Common Fields will have their rules built once for every row to be exported.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 63


This is particularly useful when exporting a Bill of Materials, where many of the rows
will have the same values.

If you are only exporting one row, then there is no need to select any Common Fields.

Fields selected to be Control Fields cannot also be Common Fields.

Once the wizard is complete, the next step is to add rows to your export and build
rules for each record in each row.

Rules are built by selecting a cell and clicking Build.

If you do not wish to export data to a particular field, then leave this row blank.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 64


Lesson 3 Exercise
Group Tables
In this part of the exercise we are going to create a Group Table. Group Tables allow
you to have tabular data that can be accessed from any Project within that Group. This
is different to any other kind of table where the data is stored in the Project.

The data held in a Group Table can be accessed through all the relevant table
functions in a rule. (CountIf, DCount, DWVLookup, HLookup, ListAll, etc.).

1. Open the DriveWorksTraining Group if it is not already open.

2. Select the Group Tables task from the Task Explorer.

3. Click the Add button on the Command Bar to add a new table to your Group.

4. Create a Simple Group Table called Customers.

5. Open up the spreadsheet called customers.xlsx (found in the Content folder with
the training files) and copy all of the data from the Customers sheet onto the
clipboard.

6. Click in Cell A1 on the table editor in DriveWorks.

7. Click on the Paste button on the Command Bar.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 65


8. Click OK to complete the process.

The Customers table can now be used to populate controls in all Projects within a
Group. We will make use of this data in the ConveyorLayout Project.

9. Open the ConveyorLayout Project

10. Add two new Combo Box Controls to the Details Form called CompanyName and
ContactName.

11. Create three new Text Box Controls called City, State and Country.

12. Build a rule for the Items property of the CompanyName Combo Box using ListAll.

This Rule will list all of the Company Names from the second column of the Group
Table.

Concept: Group Table Naming

DWGroupTable is a name specific to DriveWorks Group Tables which is a preset and


unique value.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 66


13. Build a rule for the Items property for the Contact Name Combo Box.

14. Use the ListAllConditionalDistinct mini wizard. Click the Functions button and
use the filter box to search for ListAll.

This Rule will list all of the contacts that work for the company selected in the
Company Name Combo Box.

15. Use Lookup Table Customers with Return Column ContactName, enter
CompanyName in Condition Column 1. Click on the Condition 1 text box and click
on the CompanyName control.

16. Click Finish. DriveWorks Pro will build the rule for you as shown below.

Next, write 3 Rules for the Text (Override Rule) for the three textboxes. These rules
will list the City, State and Country of the selected Contact.

17. Build a rule for the Text (Override Rule) of the City Text Box. Use the
DWVLookup function to find the City for the selected contact.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 67


18. Build a rule for the Text (Override Rule) of the State Text Box. Use the
DWVLookup function to find the State for the selected contact.

19. Build a rule for the Text (Override Rule) of the Country Text Box. Use the
DWVLookup function to find the Country for the selected contact.

20. Set the Read Only property of the three customer text boxes to be True by either
typing in the Read Only property or building a rule.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 68


Adding a Second Group Table
In this part of the exercise, we will add a Check Box to allow the user to add a new
customer. It will have four text boxes for new company, new contact, new city and new
state. We will then create a Combo Box to select the country based on a list in a table.

Finally, a Label will show the currency for the selected country.

21. Add a Check Box to your Form called EnterNewCustomer

22. Create four new text boxes called NewCompany, NewContact, NewCity and
NewState.

23. Set the visibility property of these four Text Boxes to only be visible when the
Check Box is checked by building a rule for the Visible property of each one.

24. The Rule could look like this:

However, since we are working on the result of a Check Box, which itself returns True
or False, this could be simplified to:

Also, since the IF function is itself returning True if the Check Box is True, and False if
it is False, it could be further simplified to be:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 69


25. Multi-select the Company Name, Contact Name, City, State and Country
Controls and build the following rule for their Visibility Property:

26. Select the Group Tables Task from the Task Explorer.

27. Create a new Group Table called Countries.

28. Once again, open the spreadsheet called customers.xlsx (found in the Content
folder with the training files). This time switch to the Countries sheet and copy all
the data onto the clipboard.

29. Paste the data into the first cell of the Group Table.

30. Click OK to complete the Table.

The Countries table can now be used to populate controls in all Projects within a
Group.

31. Switch to the Form Design task and add a new Combo Box called NewCountry
on the Details Form.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 70


32. Build a rule for the Combo Box Items property.

33. Use the ListAll Function to list all the Countries from the second Column of the
Countries Group Table.

34. Link the visibility of the NewCountry Combo Box to the EnterNewCustomer
Check Box.

There are now two sets of Controls that could have the customer data that is required
for future documents. We must therefore create Variables that take data from the
Country Text Box or the New Country Combo Box.

35. Create a new Variable called ActualCountry.

36. Build a rule for the new Variable to reflect the correct country depending on
whether a new customer is being entered.

In other words, if a New Customer is being entered, use the value from the Combo
Box, but if we are selecting an existing customer, use the value from the country Text
Box.

37. Add a label called Currency to the Details Form.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 71


38. Build a rule for the Text property of the label using the DWVLOOKUP function
wizard.

39. Click Finish in the wizard to apply the rule to the Rule Builder

40. Use the DWVLookup Function wizard again to select the CurrencyCode from the
Countries Table..

41. Combine these to give the currency code in brackets.

42. Click OK on the Rule Builder to apply the rule.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 72


43. Test your Form and change the country in the Combo Box to ensure that the
Currency label Value updates correctly for each selection.

44. Arrange the controls so that the controls for entering new information are laid over
the top of the ones for selecting existing information.

Tip:

Use the toggle design mode visibility button of the new text boxes to help position
the controls.

Export to Group Table


In the final part of this exercise we will export the new customer details, if a new
customer is entered.

Concept: Export to Group Table

Group Tables can have new records inserted or existing records updated by creating
an Export to Group Table document.

45. With DriveWorks Administrator open and the ConveyorLayout Project loaded,
select the Documents-Data task from the Task Explorer.

46. Create an Export to Group Table Document, call it New Customer.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 73


47. Click Next to move to the next section of the wizard and select the Customers
table

48. From the Fields list, in the Field Type column, select CompanyName and
ContactName to be the Control Fields.

Control Fields will control whether a new row is created, an existing row is updated, or
if no action is taken at all.

Note:

The export must include at least one control field. From the Fields list, in the Field
Type column, select the Field that is to be the Control Field.

49. Leave all the other field types set to Normal.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 74


Concept: Common Fields

Common Fields can make it easier to export to multiple rows where certain columns
always have the same value in each row.

For these columns, you may only want to build one rule, instead of a separate rule for
each row. To do this, mark the column as a Common Field, and DriveWorks will
automatically use the same rule for the column in all rows.

50. Click Finish to go to the Data Export Rows window.

The wizard will close and the Data Export Rows will open in the Documents window.

51. Click the Add Row button on the Command Bar.

Note:

Row 1 will be inserted if no other rows have been added before.

52. Click on the CompanyName field and build a rule using the NewCompany control.

Note:

The light blue colored columns indicate the control fields.

53. Repeat this process and build rules for the ContactName, City, State and
Country fields.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 75


54. Finally, click in the ID field and build a rule using the TableMaxValue function:

Tip:

To specify the correct table, click the Tables button on the Command Bar and select
the Customers Group Table.

Adding 1 to the result will ensure the next number in the ID field is unique.

55. Click OK to exit the Rule Builder, and then OK again to complete the process.

Every time the forms are filled out and completed a new row will be added to the table
if the combination of CompanyName and ContactName does not already exist.

56. Test the new customer data is being added to the Customers table by selecting the
Specification Explorer on the Task Explorer and creating a new Specification.

Now check if the new customer details have been added to the Customers Group
Table.

57. Select the Group Tables task on the Task Explorer.

58. Click the Customers table and click the View/Edit button on the Command Bar.

59. Scroll down to the end of the table and check to see if your new customer details
have been added.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 76


Lesson 4
Lesson 4 Outline
Upon successful completion of this lesson you will be able to:

• Create a Rollup Table

• Rollup data from Child Specifications into the parent

• Use this data to create a quotation of the items specified

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 77


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 78
Rollup Data Tables
Rollup Data Tables are a way to gather data from multiple levels of Child
Specifications and ‘roll them up’ into a table in a Parent Specification.

Data is retrieved from Specification Properties in Child Projects. It will not stop at just
one Child Project either. It will continue searching through every Project where there is
a Child Specification Control and a Child Project.

A standard Child Specification Control will pull data from one level of Child
Specifications. If you have multiple levels of Child Projects you will have to set up a
Child Specification Control in each. A Rollup Table can simply be set up at the highest
level and it will search through every Child Specification Control in every project for
Specification Properties to rollup.

Automatic linking to Specification Properties is achieved by creating columns in the


Rollup Data Table that match the names of Specification Properties in the Child
Project.

Tip:

If a column in your Child Specification Control has the same name as a Specification
Property in the Child Project, you can take advantage of the ‘(Auto)’ option to
automatically link the column with a Specification Property of the same name.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 79


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 80
Lesson 4 Exercise
Rollup Data Table Example
At the end of Lesson 1, you will have a Group with two Projects. From the Layout
Project you can specify as many Straight Conveyors of differing specification as you
like.

However there is one small issue, for every Straight Conveyor you create, you will also
have one quotation.

Using a Rollup Data Table, the data from each child can be passed up to the Layout
Project and used in a quotation there. With this method, one quotation is created that
lists every Straight Conveyor that has been specified.

The same technique which is used to pass the height, width and length values to the
layout can be used to get data from each Child Specification for use in a top level
quotation. For example, a price is already being calculated in the Pressure Vessel
Project. By passing this data up to the Layout Project and into the Child Specification
Control, you could use it as a line item price in your top level quotation.

With all the Rules set up, you will write a table array into a table within a Microsoft
Word Document. By writing an array to a Word Document, there is no limit on the
number of rows that the quotation can have.

Let’s begin creating this Layout quotation.

1. Open the ConveyorLayout Project and head to Form Design

In the Specification Flow lesson, two Specification Variables were created, Unit Price
and Description. We will now edit the Child Specification Control in the Layout Project
to pull that data each time a Specification is run.

2. Select the Layout Items Control and edit the Projects Property

3. Create two new columns in the Result Columns tab. These columns must have
identical names to the Specification Properties in the Straight Conveyor.

4. Create a Description and Unit Price Column

Concept: Result Column Auto Link

In the Result Column Values tab, you will see that the two new columns that you have
created have (Auto) as their Output Name. There is no need to change the value as it
will automatically link to the Specification Properties in the Straight Conveyor Project.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 81


5. Click OK

6. Run a new Specification using the Layout Project to test that these new columns
are receiving the expected data

With the data now coming back to the Layout Project, we can simply extract that data
from the Child Specification Control and pass it to a document. However, by utilizing
the Rollup Data Table, there will be a structure in place that will continue to work even
if more Child Specification Controls are added to further Projects.

7. In Define Tables, create a new Rollup Data Table called QuoteRollup

8. In the wizard that appears, add two columns called Description and Unit Price.

Note:

Ensure that the column names in the Rollup Table are identical to the columns in the
Child Specification control. If they are not, the data will not be found.

These columns will be automatically linked to the columns in the Child Specification
Control with the same name.

9. Click Finish to create the table

The first thing that you will notice is that a Rollup Data Table creates seven columns in
addition to the ones that you have defined. These columns are filled with information
coming from all levels of Child Projects and all Child Specification Controls. Some of
the information created in a Rollup Data Table is not easily accessible in any other way
in your Project. For example, the Level the data has come from or the current State of
a Child Specification.

Concept: Holding Data

Within a Rollup Data Table, you can type values into each cell as holding data. This
holding data is great when you are building Rules that query the Rollup Table for a
value.

With other tables in DriveWorks that are populated during a specification, a new
specification must be run to test your Rules. With a Rollup Data Table, that is no
longer required. Your Rules can be tested straight away thanks to the holding data.

DriveWorks will not use this data during a specification, it is simply there for you to test
your Rules against during the setup of your Project.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 82


10. Type some generic values into each cell of the Rollup Data Table as holding data.
This will be useful when writing your document Rules

With the holding data present in a Rollup Data Table, let’s create a new document.

11. In the ConveyorLayout Project, create a new Word Document called Quote

12. Browse for Quotation.docx in the Content folder provided with the DriveWorks Pro
Training and click Finish

13. Click Preview to view what the Document will look like.

The master Word Document has a number of bookmarks which are automatically
detected by DriveWorks. You can step through each bookmark in the list and write a
Rule or link it to a Variable.

14. Build a Rule for each bookmark within the Document (excluding QuotationArray
and TotalPrice)

Tip:

Create an If statement to determine whether to use the data coming from the
CompanyName Control or the NewCompany Control. Extract this Rule to a Variable as
it is likely a Rule like this could be used again.

If(EnterNewCustomerReturn, NewCompanyReturn,
CompanyNameReturn)

For the QuotationArray bookmark we must create a Rule that takes only certain
columns from our Rollup Data Table.

15. Select QuotationArray and click Build

Tip:

You can also double click items or use the Ctrl + B shortcut to quickly open the Rule
Builder.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 83


We will use the TableSelectColumns() function. This will create an array of data with
only the columns that we require. We require the 7th, 8th and 9th columns. Therefore,
the Rule will be:

TableSelectColumns(DwLookupQuoteRollup,7,8,9)

16. Create the above Rule

Tip:

It is always good practice to extract Rules like these to Variables.

17. Highlight the entire Rule, right click and Extract it to a Variable called
QuotationArray

Finally, we must sum all the values in the 9th column of the QuoteRollup Table. To do
this the function SumTableColumn() will be used.

18. Build a Rule for the TotalPrice Bookmark that sums the 9th column of the
QuoteRollup Table.

Text(SumTableColumn(DwLookupQuoteRollup,9),"0.00")

19. Click OK in the Document Editor.

By clicking Preview in your Document, you will see what your quotation document will
look like using the holding data from your Rollup Data Table.

20. With the Quote Document selected, click Preview on the Command Bar.

To Preview your quotation with actual data, you must run a Specification. By
completing the Specification, the Word document will be created in the folder based on
your Relative Path Rule. Another option would be to use Test Mode whilst within the
Specification to click Preview.

21. Run a Specification and add multiple Conveyors to test your quotation document.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 84


Lesson 5
Lesson 5 Outline
Upon successful completion of this lesson you will be able to:

• Use Hierarchical Properties to position your controls

• Understand the concept of Hierarchical Properties for use around your


Project

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 85


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 86
Hierarchical Properties
Hierarchical Properties provide the ability to reference all Control Properties from
within a Rule. Without this functionality, you would have to extract that value as a
Variable and then reference the Variable.

A great use for this is in Form Design, when you would like to position one Control
alongside another. In earlier versions of DriveWorks you would have to extract the
width and left potion of each control in variables. Your Rules would then look
something like this:

In DriveWorks 14, you can skip the process of creating a Variable for each Property
within a Control and simply reference it directly in a Rule by typing the Control name,
followed by a period and then the name of the property. Giving you the following result:

TextBox1.Left
The same form as in the screen shot above, would therefore look more like this:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 87


This concept applies to all properties of a Control.

In the Rule Builder, when you type the name of a Control, all the properties available
from that control are displayed.

Note:
Because different Controls have different Properties, the list above will differ
depending on the type of Control you have used.

Concept: Dynamic Form Design

DriveWorks allows you to create a User interface that looks great at any size by using
the DWFormContainerWidth Special Variable.

This Special Variable will tell you the width of the window where the DriveWorks Form
is being shown. For example, the width of the SOLIDWORKS Task Pane or the web
browser width. With this value you could have Form Controls that change size and
location based on the size of device being used!

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 88


Lesson 5 Exercise

1. Open the Straight Conveyor Project and go to the Main Left 3 Form.

This form will be changed so that the controls use hierarchical Properties to reference
each other’s location.

The form template that was used in the previous training manual already incorporated
responsive form design into the Main form, but the controls that were created on the
Main Left 3 form did not continue this. With this lesson complete, the controls will
resize to always fit within the Left Frame Control.

2. Multi-select the Size Label, Bed Label and Rail Label controls.

3. Change the Height Property to be 40.

Note:

The values used in the Layout Properties refer to the pixel size and position of the
controls.

4. Make the Left, Top and Width Properties dynamic.

5. Edit the left property and make it’s value 10.

Note:

By making the Left Property dynamic and then using a static value, the control will be
locked in that position which prevents it accidentally being moved. The same can be
achieved by using the lock button alongside that control on the top right of the Form
Designer.

The advantage of making the dynamic Rule a static value is that we can extract the
value to a variable. This value can then be updated everywhere that it is updated if this
padding value needs to change.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 89


6. Select the value 10 in the Rule Editor and Extract it to a Variable called Form Gap.

Note:

Be careful with what you choose to replace with the Variable. Ensure that the value
being replaced is relevant to a Variable called Form Gap.

7. With all three controls still selected, edit the Width Property.

8. Build the following Rule:

9. Select just the Size Label change the Top Property to be 10.

10. Select just the Bed Label and build a Rule for the Top Property

11. Clear the existing rule, then type SizeLabel.

12. Select SizeLabel.Top from the Rules Insight list.

13. Continue using this method to build the following Rule:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 90


14. Select the Rail Label and build the following Rule for the Top Property:

15. Multi-select the Size Price, Bed Price, Rail Price and Total Price Labels.

16. Change the Height Property to be a value of 40.

17. Make the Left, Top and Width Properties to be dynamic.

18. Build the following Rule for the Width of the four controls selected.

19. Build a Rule for the Left Property which positions the selected controls alongside
the Size Label.

Note:

This rule will take into account the Left and the Width of the Size Label.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 91


20. Build a Rule for the Size Price, Bed Price and Rail Price Labels so that their Top
value is always the same as the Top value of the corresponding Label.

Note:

This can be done in a number of ways. An example of one method would be to write a
Rule for the Bed Price Top Property that references the Top Property of the Bed Label
Control.

The Side Rails have the option to not be included in the model at all. In this scenario,
they would not be included on the quotation or the pricing summary. In the case of the
description, this is handled by the fact that there will be no description shown when no
Side Rails are required.

However, in the case of the price, the price of the Side rails is 0 when they are not
required rather than blank (this is to prevent errors in the sum calculations).

Because of this, we will write a rule to hide this label when it is not required. Once this
is done, the Total Price Label can be moved up.

21. Select the Rail Price Label and build the following Rule for the Visibility Property.

22. Select the Total Price label and build a Rule for its Top Property.

This Rule will be an If statement to attach the Total Price label either to the Rail Price
Control, or to the Bed Price label based on whether the Rail label is visible.

23. Write an If statement with the following values:

• Condition that is based on the Rail Price label being visible.

• If the Rail Price is visible, the Total Price label Top Position will be
calculated by combining the Rail Price Top position and the Rail Price
Height.

• If the Rail Price is not visible, the label will be calculated based on the Bed
Price Top and the Bed Price Height.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 92


• In addition to the If statement, whichever value is used should also apply
the form gap.

24. Run a new Specification of the Straight Conveyor and resize the DriveWorks
Administrator window to see the tabs resize and change location. Ensure the labels
resize and relocate as expected by testing the Form.

Tip:

Resize the width of the task explorer to easily change the width of your Forms. This is
often easier than resizing the entire DriveWorks Administrator window.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 93


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 94
Lesson 6
Lesson 6 Outline
Upon successful completion of this lesson you will be able to:

• Use Generation Tasks to insert models into a blank assembly

• Use Calculation Tables and export new data to them

• Loop a Macro to repeat tasks multiple times

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 95


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 96
Generation Tasks
Generation Tasks allow additional automation tasks to be run on Models and
Drawings. They allow you to have much more control over the specific tasks carried
out by DriveWorks during the generation of a SOLIDWORKS Model and Drawing.

Generation Tasks can also be looped. Enabling a loop allows the sequence of tasks to
iterate through the Component or Drawing with each iteration producing unique
results. This allows DriveWorks to loop through configurations, driving different
dimension or feature values for each. You can also create assemblies by looping
through a table of Models and then insert and mate the new models into an assembly.

Generation tasks can be run before (Pre Drive) or after (Post Drive) the standard
generation sequence.

The standard generation sequence comprises of:

• Copying Master Files


• Driving Dimensions and Features
• Applying values to Custom Properties
• Saving the Models

The generation sequence differs between Parts, Assemblies and Drawings.

The Generation Tasks include (but are not limited to):

• Force rebuild
• Run SOLIDWORKS Macro
• Create coincident mate
• Insert component
• Create configuration
• Auto Arrange Dimensions
• Auto Balloon View

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 97


• Rescale and Position view

With a Loop enabled you can loop the procedure from the start of the Pre Drive Tasks
to the end of the Post Drive Tasks. The Loop Count also allows you to reference the
current Loop number. This is great for building Rules that vary based on the current
number of Loops.

For example, if you wanted to change configuration of a Part, drive its parameters and
then save the component, you could loop these tasks as many times as you like. Each
time the procedure loops, you could change the values that you are sending to the
next configuration.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 98


Lesson 6 Exercise
In this lesson, we will insert the straight conveyors that have been specified in the
Layout Project into a blank assembly. Generation tasks will not only insert each model
into the assembly, but it will also mate them one after another.

Inserting Generated Components into an Assembly

1. Within SOLIDWORKS, log into the DriveWorksTraining Group and capture the
BlankAssembly.SLDASM which can be found in the training files zip folder
(Models\Layout).

2. Also capture the BlankAssembly.SLDDRW in the Drawings tab.

3. Save the Group inside of SOLIDWORKS and open DriveWorks Administrator.

4. Open the ConveyorLayout Project.

5. Go to Model Rules and add the newly captured Assembly to your Component Set.

6. Build the following Rule for the File Name of the Blank Assembly.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 99


7. Build the following Relative Path Rule:

8. Go to Generation Tasks in the Task Explorer.

9. Change the Loop Enabled Property to be True.

Tip:

You can also click on the loop icon next to the component that you would like to loop.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 100


10. Build the following Rule for the Loop Count Property

TableGetRowCount(DWSubResultsLayoutItems) – 1

Note:

TableGetRowCount counts the header as a row. To calculate the quantity of loops for
the generation, we do not need to include the header as one of the loops. Therefore, 1
has been subtracted from the function.

11. From the toolbox, drag and drop the Insert Component task into the Pre-Drive
sequence.

12. In addition to this, add three Create Coincident Mate tasks into the Pre-Drive
sequence.

13. Rename these three tasks to be Mate Top, Mate Right and Mate Front.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 101


14. Finally, add a Zoom To Fit task to the Post Drive Tasks section

Note:

This task does not have any properties, so there is nothing to configure. It will simply
‘zoom to fit’ the model at the end of each model insertion.

The Insert Component task requires the full file path, file name and file extension to
insert the correct model. To find out this value for each Child Specification, create a
Specification Property in the Child Project that passes the required information up to
the Child Specification Control.

15. Open the Straight Conveyor Project.

16. Create a Specification Property called Full File Path.

17. Build the following Rule:

18. Create another Specification Property called File Name.

19. Build the following Rule:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 102


20. Open the Conveyor Layout Project.

21. Edit the Projects Property of the Layout Items Control.

22. Add a new Result Column called Full File Path and another called File Name.

23. Click OK and Run a Conveyor Layout Specification to ensure the correct value is
coming up from the Child Project.

24. Go to Generation Tasks.

25. Write the following Rule for the File Path Property of the Insert Component Task.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 103


DriveWorks Autopilot Tags
One vitally important requirement for this set up to work is for DriveWorks to generate
the Child Specification Models before it attempts to generate the Conveyor Layout.

If it creates the Conveyor Layout before creating all of the conveyors, there will be an
error in the Model Generation as the Generation tasks cannot find all of the required
models (because they haven’t all been generated).

Using Tags in DriveWorks Autopilot, we can prioritize the generation of the Straight
Conveyors above the generation of the Conveyor Layout. With this set up, DriveWorks
will generate the Conveyor Layout Assembly last and the Straight Conveyors first.

Concept: Tags

DriveWorks provides the ability to tag Specifications, Models, Drawings and Emails
with a particular priority.

Tags are defined in a Rule within DriveWorks Administrator. You will find a tag rule for
every captured Model within Model Rules. Likewise, you will find a tag for every
created Document in the Document Editor.

Once the tags are defined in the Project, you must define the Tag priority in each
DriveWorks Autopilot installation that is being used with that Group. This is what
determines the priority order of your Tags.

As well as prioritizing tags you can also block certain tags if you do not want certain
items processed on a particular DriveWorks Autopilot machine.

26. Open the Straight Conveyor Project.

27. Go to Model Rules, check the check box alongside the Straight Conveyor
Assembly and the Belt Frame Assembly.

28. Build a Rule for the Tags Property of these two components so their value is
“Conveyor”.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 104


Note:

Tags are only available (and only required) for top level components. Once a
component is marked for generation, the parts and sub assemblies within it are also
generated at the same time.

29. Open the Conveyor Layout Project

30. Build a Rule for the Tags Property of the Blank Assembly to be “Layout”.

31. Open DriveWorks Autopilot

32. Select the Autopilot tab in the Task Explorer

33. Click Edit Tags on the Command Bar

34. Type Conveyor and click Add.

35. Type Layout and click Add.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 105


Note:

Because Priority has been selected at the top of this dialog. The tags added are
priority tags. The higher up this list, the more of a priority they are. Items tagged with
Conveyor will always be generated before items tagged with Layout if there is a
Conveyor available to be generated.

You can also block certain tags from ever being process on this particular seat of
Autopilot.

Note:

Shortly, you will be told to start DriveWorks Autopilot. This will trigger the generation of
any Models in the Model Generation Queue. Therefore, if you have run many test
Specifications and not generated the models, DriveWorks Autopilot will begin
generating all the models from old Specifications that are awaiting generation.

To prevent this, first clear out your Released Files in DriveWorks Data Management.

36. Open DriveWorks Data Management.

37. When logging into the Group ensure that Data Backed Up has been checked.

38. Go to Released Files.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 106


In this view, you can see a number of columns with useful information. The column
that is most important to you right now is the column that says ‘Generated’, the second
column.

39. Filter this list by the Generated and the value ‘No’. Do this by typing
Generated:No.

40. Select all of these files and click Delete on the Command Bar. Or if you would like
to generate these models, do not delete them and continue to the next step.

41. Go back to DriveWorks Autopilot

42. Click Start on the Command Bar from within the Autopilot Task in the Task
Explorer.

43. Go to DriveWorks Administrator and Run a new Conveyor Layout Specification.


Specify multiple straight conveyors of varying design.

44. Transition the Specification to the Approved State to trigger the model generation.

Note:

Upon entering the Approved State, the Conveyor Layout Specification will change the
Straight Conveyor Specification into the Complete State, which will Release the
Models to the Generation Queue.

The Straight Conveyors will be generated first, and then the Blank Assembly will open
and insert those generated conveyors into the Assembly.

However, remember that the mate tasks have not been created yet. Therefore, all
inserted models will be floating in your Conveyor Layout Assembly.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 107


Calculation Tables

Concept: Calculation Tables

Calculation Tables allow real time calculations, in tabular form, to be carried out during
a Specification. Data from Form Controls can be used in the table and results can be
returned to other Form Controls.

Rules can be built for each cell in the table and these Rules can reference other cells
in the table either using an absolute reference of a relative reference.

Rules can also be built for an entire column and by using relative references, the result
can be different in each cell in that column

Concept: Export to Calculation Table

Additional data can be written to a Calculation Table too. New data that is exported to
the Calculation Table follows the Column Rules set up in the master Calculation Table.

Concept: Calculation Tables Relative Cell Referencing

When building Rules in Calculation Tables, you can reference values in other cells
using relative referencing.

Relative Referencing is when you begin in the current cell and move directionally to
another cell to find its value, rather than providing an absolute cell name.

Numeric references are made according to how many cells away the cell is. This is
combined with directional references, which tell the Rule which direction to go in. For
example:

U = Up D = Down L = Left R – Right

Each co-ordinate is placed within square brackets [], and separated with a comma (,)

So, for example, to get the value of a cell that is 3 cells down and 2 to the left, the
reference would look like:

[3D,2L]

To get the value of a cell immediately to the right of the current cell, the reference
would be:

[1R]

And to multiply the above two cells together the Rule would be:

[3D,2L] * [1R]

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 108


45. Go to Calculation Tables in the Task Explorer.

46. Add a table called Layout.

47. Create the following columns:

48. Click in the first row of the ID Column.

49. Click Build Cell Rules on the Command Bar.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 109


50. Type 1 into the Rule Editor and click OK to confirm the Rule.

51. Click in the File Name Column and click Build Column Rules

Note:

This Rule is going to look at the 9th column of the Layout Items Child Specification
Control and return a value from it.

However, because this a Column Rule it will be identical for every row in the column.
The Rule must be written so that the result is not the same for every row of the
column. To do this, instead of saying look into the 1st row of the 9th column, the Rule
will say take the value from the cell to the left and use that to determine which Row to
look into.

52. Type [1L]

Take a look at the Value tab at the bottom of the Rule Builder. Note that the result is 1.
This is because [1L] indicates to the Rule to take the value from the cell that is 1 cell to
the left.

53. Write the rest of the Rule:

TableGetValue( DWSubResultsLayoutItems , 9 , [1L] )

Note:

This Rule will always look into the 9th column of the Layout Items Child Specification
Control, however it will look into a different row based on the value in the ID column to
its left. Therefore, as Rows are added to the table and the ID values increment, the
above Rule will look at the next row in the table.

Note:

The result of this Rule will be blank. This is because there are currently no values in
the Child Specification Control. This will also effect the other rules in the calculation
table. The result will not be correct until Child Specifications are added.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 110


54. Click in the Primary Plane Top column and click Build Column Rules.

55. Type “Top Plane” and click OK to confirm the Rule.

56. Click in the Secondary Plane Top column and click Build Column Rules.

57. Build the following Rule.

Concept: Understanding Plane Addresses

The Rule in the image above is the address of the Plane that will be mated to the Top
Plane within the Top Level Assembly. The result of this Rule must take the following
form

Plane Name@FileName-InstanceNumber

This can be discovered by mating to components together in SOLIDWORKS and


looking at the address that is provided. The only difference is that DriveWorks does not
require the additional @Filename section that references the Top Level Assembly.
This is added automatically.

In this case, the plane name will always be the same so this can be in static text. Next
the FileName will change based on which part is being worked on in this particular
Loop of the generation. Therefore, we can get the information from the cell which is
located 2 to the left of the current cell. Finally, because the File Names always going to
be unique, there will never be any more than one instance of that conveyor in one
assembly. If there is a chance of multiple instances, you must write a Rule to find out
whether that file exists previously.

58. Click OK in the Rule Builder.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 111


59. Build a Column Rule for the Primary Plane Right column.

Note:

The Rule for this Column will be different for the first row as it is for every other row
that is inserted. Therefore, an If statement is required. This Rule will say if the ID =1,
then to mate to the Right Plane, otherwise mate to the front plane of the previous row’s
file name.

60. Write the following Rule:

Remember that relative cell references can look in two directions. You can provide a
reference that states to look at the value in the cell 3 to the Left and 1 Up. To do this
you can use [3L,1U].

61. Click in the Secondary Plane Right column and build the following Column Rule:

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 112


Tip:

It is very easy to accidentally build a Cell Rule instead of a Column Rule, and vice
versa. You can quickly see whether a Rule is a Cell Rule of a Column Rule by looking
at the weight of the font in the cell.

A Cell Rule will override a Column Rule. Therefore, if it is there by accident, you can
simply click the Command Bar button for Clear Cell Rules.

62. Click in the Primary Plane Front column and build a Column Rule.

This will again be a different plane for the first row compared to the rest of the rows.
Therefore, another If statement is required for this Rule.

63. Write the following Rule:

Finally, for the last column an If statement is required again. This time the plane
required will either be the Left Plane or the Mid Plane of the part that has just been
inserted.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 113


64. Click in the Secondary Plane Front column and build a Column Rule.

65. Build the following Rule.

The Calculation table is now complete. You can test how these Rules will react to
additional Rows by clicking Add Row on the Command Bar.

66. Click Add Row on the Command Bar.

To view the values created by the Rules in a Calculation Table, you can click the Show
Values button on the Command Bar.

67. Click Show Values.

You can see now that the second row values are using different planes compared to
the first. This is because of the If statements that were written for certain columns.

68. Delete the newly added row by selecting it in the table and clicking Delete Row on
the Command Bar.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 114


Export to Calculation Table Document
With the Calculation Table complete, we now need to create the document that will
add the required rows to the table for every new Specification.

69. Go to Documents- Data in the Task Explorer.

70. Create a new Export to Calculation Table Document called AddToCalcTable.

71. Select Layout as the table to export to.

72. Change the ID column to be the Control field type.

73. Uncapture all other columns.

74. Click Finish to finish creating the Document.

The next step is to write a Rule which determines the value which is exported to the
Calculation Table.

75. Add a row and then select the first cell in the ID column.

76. Click Build and write the following Rule.

TableMaxValue(DWCalcLayout,1)+1

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 115


Release Document and Loop
Just as with any document, we must tell it when to be created (released). We will do
this in a Specification Macro that specifically releases the AddToCalcTable document.

However, we will run this Specification Macro in a slightly different way. Instead of
running it once, we will run it in a loop for as many times as is required to populate the
calculation table with all the data from the Child Specification List.

77. First, create a new Specification Macro called ReleaseCalcTable

78. Add a Release Documents(s) Task to the task window and connect the Start node
to the task.

79. Change the Documents Property of the Release Documents task to only release
the AddToCalcTable document.

This Specification Macro will now release the Document when it is run. However, we
need to not only specify when this macro is run, but also ensure that it is run in a loop.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 116


80. Firstly, create a Constant called DocReleaseLoop. Set its value to be 0.

81. Next, go to the Specification Flow and edit the Sales Entry State.

82. Change the Release Documents task so that it no longer releases all Documents.
Do this by removing the asterisk from the Documents property.

83. Select the New Customer document in the Documents Property.

84. Next, whilst holding the Ctrl key, select the Quote document.

If this is not changed, the export document will run again outside of the loop. This will
create one too many rows in the Calculation Table.

85. Add a new task to the Leave State Event called Run Macro in a Loop.

86. Make the Limit Value property for this task dynamic

87. Set the following values for the properties of this task:

Defer = False

Macro Argument =

Macro Name = ReleaseCalcTable

Counter Constant = DWConstantDocReleaseLoop

Increment Value = 1

Limit Value =TableGetRowCount(DWSubResultsLayoutItems)-2

Start Value = 1

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 117


Note:

The TableGetRowCount function counts the header row of the Child Specification List
as a row. It is normal practice when using this function to count the number of rows
excluding the header to subtract 1 from the result.

In addition to this the first row in the Calculation Table already exists. Therefore, the
number of loops required for the macro to insert every row is 2 less than the value
calculated by the TableGetRowCount function.

Insert Coincident Mate Task


The Project is now set up to calculate the Planes that are required to mate every
Conveyor to one another. The final step is to link these calculations to the Generation
Tasks created earlier.

88. Go to Generation Tasks and write the following rule for the First Plane Property
of the Mate Top task.

Note:

Instead of looking at a particular row in the table, this rule will change the row it looks
at based on the current number of times it has looped through the Model Generation.

Note:

The result of these Rules will be blank. This is because the CurrentReleaseLoopIndex
equals 0. If you want to test that you have written the Rule correctly you can
temporarily replace the CurrentReleaseLoopIndex with 1 and check the value of the
Rule.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 118


89. Write the following rule for the Second Plane Property of the Mate Top task.

Tip:

All of the Rules we are writing for the Plane names are almost the same Rule. The
only difference is the Column index that is being used. To save time you could copy
and paste the Rule from one Property to the next and change the column index
accordingly.

90. Write the following rule for the First Plane Property of the Mate Right task.

91. Write the following rule for the Second Plane Property of the Mate Right task.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 119


92. Write the following rule for the First Plane Property of the Mate Front task.

93. Write the following rule for the Second Plane Property of the Mate Front task.

Now that the Generation Task Rules have been written to determine the rules to mate
the conveyors together, the final step is to test the rules.

94. Create a new Specification of the Conveyor Layout.

95. Type in the Order Number, Add multiple varying Straight Conveyors and then send
the Specification for Approval.

96. Ensure that DriveWorks Autopilot is running.

97. Transition the Specification from Awaiting Approval to Approving and then Approve
the Specification to begin the Model Generation.

Note:

If there are any errors with the model generation, take a look at the Model Generation
reports and the Specification Reports to troubleshoot the Project.

Make any changes that you believe will resolve the issues and Run the Specification
again. This time use Model Insight to step through the model generation so that you
can spot the error as soon as it happens.

Continue to use the troubleshooting tips provided throughout this manual to diagnose
the Project.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 120


Drawing Generation Tasks
Now that the Conveyors are being assembled in a Layout, we can look at automating
the creation of an assembly level drawing. This was done in the DriveWorks Pro
Essentials Manual and will be repeated here to finish your Project.

1. Open the ConveyorLayout Project.

2. Go to Generation Tasks and select the Blank Assembly Drawing.

3. Add a Rescale and Position View task to the Pre Drive Tasks area.

4. Add an Auto Balloon View task to the Pre Drive Tasks area.

There are many properties for the Auto Balloon View task which provides you with
complete control over the creation of the balloons. The majority of these Properties are
filled in with default values. Therefore, there are only two that need changing.

5. Select the Auto Balloon View task in the Generation Sequence.

6. Type Drawing View1 into the View Name property.

7. Type Format into the Layer Name property.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 121


Tip:

Take a look at the DriveWorks documentation for more information about the values
required to change the other properties. You can access the helpfile by going to
docs.driveworkspro.com or by clicking the question mark at the top right of DriveWorks
Administrator.

Investigate the additional properties and make any changes that you like.

Next, we will write the properties for the Rescale and Position View task. First, we
must make a note of where the drawing view can scale to on the sheet.

8. Open the Blank Assembly drawing in SOLIDWORKS.

The Drawing has a couple of things to bear in mind. See the image below:

The hatched area indicates the realistic area that the drawing view can appear. This is
because to the right is the Bill of Materials which will grow upwards as items are added
to the Assembly. In addition to this, the balloons around the Drawing View will take up
more space, so it is important to leave a small gap for these balloons to fit.

Tip:

To find out the values for the properties of the task, you can move your mouse into the
rough location of the drawing area shown above. At the bottom of SOLIDWORKS, the
coordinates of your mouse location will be shown in the same units required for the
Rescale and Position View task.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 122


9. Position your mouse at the Top Left corner of the area where the Drawing View
should be limited to.

We can note that 42mm is the furthest left value and 257mm is the furthest top value
that the drawing view should go.

10. Position your mouse at the bottom right corner of the area where the Drawing View
should be limited to.

We can note that 221mm is the furthest right value and 63mm is the furthest bottom
value that the drawing view should go.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 123


11. Go back to DriveWorks Administrator and use these four values to define the
Rescale and Position Drawing View task.

12. In addition to these Position Properties, build a Rule for the View Name Property.

13. Type “Drawing View1”.

14. Your Project for the Advanced Training Manual is now complete. To finish. Run
your Project and test all of the functionality that has been created.

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 124


Index
Calculation Tables ............................................................................................................ 108
Change Child Specification State ........................................................................................ 49
Child Specifications ............................................................................................................... 7
Child Specifications List Editor ............................................................................................ 17
Common Fields ................................................................................................................... 75
Data Export ......................................................................................................................... 62
Data Functions .................................................................................................................... 58
Data Tables .......................................................................................................................... 8
Deferred Drawings .............................................................................................................. 48
Drawing Generation Tasks ................................................................................................ 121
DriveWorks Autopilot Tags ................................................................................................ 104
DWFormContainerWidth ..................................................................................................... 88
DWParentRowIndex............................................................................................................ 22
Dynamic Form Design......................................................................................................... 88
Embedded Specification ..................................................................................................... 22
Export to Calculation Table Document .............................................................................. 115
Export to Group Table ......................................................................................................... 73
Generation Tasks................................................................................................................ 97
Group Table Naming ........................................................................................................... 66
Hide Project from non-administrators .................................................................................. 51
Hierarchical Properties ........................................................................................................ 87
Holding data ........................................................................................................................ 82
Macro Buttons ....................................................................................................................... 8
Owner and Creator ............................................................................................................. 49
Plane Addresses ............................................................................................................... 111
QUERYDATA...................................................................................................................... 60
Result Column Auto Link..................................................................................................... 81
Rollup Data Tables ............................................................................................................. 79
Run Macro in Loop............................................................................................................ 116
Specification Control ........................................................................................................... 27
Specification Flow ............................................................................................................... 32
Specification Flow Permissions ........................................................................................... 49
Specification Host Control ..................................................................................................... 9
Specification Macros ........................................................................................................... 31
Specification Properties ................................................................................................ 30, 39
Specification Settings .......................................................................................................... 27
Tables ................................................................................................................................. 55
Team Leader ...................................................................................................................... 37
Users and Teams................................................................................................................ 27

©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 125


©DriveWorks Ltd DriveWorks Pro Training www.driveworkspro.com 126

You might also like