Home Search

DriveWorks Pro 22
How To: Specify Multiple Projects Into One Main Project using the Child Specification List control (KB12121034)

Send Feedback

How To: Specify Multiple Projects Into One Main Project using the Child Specification List control

DriveWorks Pro has the ability to specify individual projects as children of a main parent project. This is advantageous if you have a product or products that can be specified as an entire contract, or a product that is assembled from individual items.

Using the child specification list form control:

  • Static information can be passed down from the main project to the child projects to use directly or in other calculations.
  • Calculated information can be passed down from the main project to the child projects to use directly or in other calculations.
  • Static information can be passed from the child projects to the main project to use directly or in other calculations.
  • Calculated information can be passed from the child projects to the main project to use directly or in other calculations.

How it Works

The main parent project is set up just like any other project. A user form in the main parent project has a child specification list form control included. From this control each child project can be specified by clicking the Add button on the control during specification.

Information entered or calculated at the main parent project level can be sent to each child project through constants created at the child level..

Information entered or calculated at each child project level can be sent to the main parent project by linking columns created in the child specification list control to variables created in the child project.

To make use of the Edit, Copy and Delete buttons on the Child Specification list control, each child specification must be stored in its own unique location. This is done by setting the Specification Path rule for the child project in DriveWorks Administrator. See Specification Settings for more information.

Exercise

Step 1. Create a Constant in the Child Project to receive information from the Main Project.

Open a Group that contains at least one working project. Open that project and select Define Constants from the task list.

For this exercise create a constant named FromTopLevel, leave the value blank as the value will be coming from the Main Project.

Step 2. Create a Variable in the Child Project to send into the Main Project.

Select Define Variables from the task list.

For this exercise create a variable named ToTopLevel. Build a rule for the variable, this could be a fictitious price, a size, option etc. Choose something that you will recognize as being changed when it is displayed in the child specification list.

Save the project

Step 3. Create a New Project

Click the Projects button and select Create a New Project, click next. Select New DriveWorks Project, browse to a location to store the project and for this exercise name the project Top Level, click Finish.

Select Form Design from the task list and add a text box named Order Number. Select More... select Child Specification List from the controls dialog, click OK and enter the name Child Projects.

Step 4. Set up the Child Specification List control to send information to the child project.

From the form designer select the Child Specification list control and then from the control properties window select The Projects property from the Behavior category. Click the build button on the property to launch the Child Specification List Editor.

From the Project Details tab check the box next to the name of the project that is to be specified as a child project (The project that had the constant and variable created in steps 1 and 2 above).

Next click the helper link that states The information for the selected child project may be out of date if it has been changed, click here to refresh it. All constants in the child project will now be displayed in the constant list.

Select the constant created in step 1 above named FromTopLevel and click Build to build a rule for the information to be passed down to the child project. For this exercise choose the OrderNumber control from the Forms tab. Click OK and then select the Results Columns tab.

Step 5. Set up the Child Specification List control to receive information from the child project.

Results Columns are displayed in the Child Specification List control, they are also used to send information up to the Main Project.

Type a name to hold the result of the variable created in step 2 above in the Add Column field. For this exercise call it Price or Size, something relevant to the calculation given to the variable in step 2. Click Add to add the column and then select the Result Column Variables tab.

Results Column Variables are where the variables in the child project are linked to the columns created in the Child Specification List control.

Highlight the Result Column name from the list and then double click in the adjacent Variable Name field. The field will change to a drop down box that displays all variables in the child project. The variables are listed alphabetically, select the variable ToTopLevel created in step 2 above. Click OK and save the project.

Step 6. See the results

Go to the Specification Explorer and click New to specify a new project. In the New Specification dialog select the Top Level project created in step 3 above, click OK.

Enter an order number and then select Add from the Child Specification List control, specify the child project and then select Save, Finish or Release (these may be named differently if the child project has had specification flow modified).

The information calculated for the variable in the child project will be displayed in the child specification list.

As many child projects can be specified in the child specification list as is required.

The above exercise has demonstrated a simple use of the child specification list control to specify multiple child projects into a main project. From this exercise we have demonstrated:

  • Sending common information down from the main project to each child specification.

This can save time specifying each child specification and eliminate potential mistakes. If each child project is to conform to contract requirements these can be specified at the main project level and passed down to each child project.

  • Having the main project receive information from a child specification.

This could be calculated design information that the next child project requires to conform to. Or individual pricing information that is then rolled up into a contract quotation.

Using information from the Child Project in the Main Project

The above exercise sent information from the child project into the child specification list control in the main project. This information may be needed in a model or drawing (generated by the main project or another child project), document or displayed in a control on another user form. To extract the information out of the child specification list:

Step 7. Create a variable

Open the main project in DriveWorks Administrator and select Define Variables. Create a New Variable named FromChildSpecListLine1.

Build a Rule for this variable by launching the Rule Builder. In the Rule Builder click the functions button to launch the Functions list dialog and select the function GetTableValue this will launch the wizard for this function in the rule builder..

About GetTableValue

When the Child Specification list was added to the main project, DriveWorks automatically created a Table in the main project. This table cannot be seen in the Define Tables section because it is strictly for use by the Child Specification list control. It is structured as follows:

  • The first row is reserved for the Return Column Headings of the child specification list control.
  • Each column represents a Return Column Value.
  • Each subsequent row, after the headings row, is where the information coming from each child project is stored.
  • The order of each subsequent row is the order each child specification appears in the child specification list control. This is true even when the child specifications have been re-ordered using the Move Up or Move Down buttons after specification of the child projects.

The GetTableValue function requires the following information:

Table Name - The table all child specification information is written to is named the same as the Child Specification List control created on the user form.

Row Index - The Row number of the child specification.

Column Index - The Return Column name of where the child specification information is being sent.

Step 8. Build the GetTableValue rule.

In the Table Name field select the table Child Projects (if the exercise above is still being followed, otherwise select the name of the child specification list control required)

In the Row Index field enter 2, this will take data from the second row in the table (remember row 1 is reserved for Return Column headings)

In the Column Index field select the Return Column name created in Step 5 above.

Click Finish in the wizard and then OK in the Rule Builder to apply the rule. The rule should look something like this:

GetTableValue ( DWSubResultsChildSpec , 2 , 3 )

This variable now extracts the child specification information from the child specification list control. It has just been placed in a variable for now, but this variable can be linked to a driven item in a document, a form control or a parameter captured from a model or drawing. To see this variable in action create a Label on the user form in the main project. Change the caption property of the label to be the variable created in step 7. Now specify the Main Project, add a child specification and once that has been Finished or Released you will see the label update with the information from the child specification.

One rule is required for each piece of information required to be used from each child specification.

Using Models Generated by the Child Project in an Assembly Generated by the Main Project

When DriveWorks (SOLIDWORKS Add-in or Auto-pilot) generates models in the queue all models required by any child specifications take priority over models required by their parent main project. This is important when swapping the child project models into the main project assembly.

The first place to start is with the child project models. Make a note of the naming convention applied to the top level component. This is required for replacing into the main project assembly.

The main project requires an assembly associating to the project. The assembly should contain place holders that will allow the child project models to be swapped into the assembly. One place holder for each possible child project that could be specified. The place holders need to only contain the geometry required to mate the child project models into the assembly.

A trusted method for creating the placeholder is to take the master model for the child project and:

  • Save a copy of the model (suffix the name of the copy with dummy1, for example).
  • Open the copied dummy1 model and delete all geometry or components if it is an assembly.
  • Mate the dummy1 model into the main project assembly.
  • The dummy1 model can now be copied and mated into the main project assembly as many times as is required.

Once the main project assembly has been modeled, with the place holders mated, capture the assembly and all of the dummy components, using the DriveWorks task pane in SOLIDWORKS. No parameters require capturing unless the dummy components contain reference geometry for mating.

Next open the main project in DriveWorks Administrator and select Model Rules from the task list.

Click Add to launch the Add Component dialog, select the Assembly for the main project.

Select the first dummy component so the parameters appear in the Model Rules window. Highlight the File Name rule and click build.

The rule needs to equate to the name of the child project model that will be generated. Use the wild card symbol at the beginning of the rule so the rule result will not be appended to the dummy file name.

For example:

Child Project master model is named Block, the rule for naming new files from this is

=Length & " Long x " & Height & " High x " & Width & " Wide"

So any resulting model will be named Block 100 Long x 175 High x 225 Wide

Note the inclusion of the master model name Block. If the child project uses the wildcard symbol to remove the master model name do not include it in the rule.

We need to report this into the File Name rule for the first dummy model. If the naming of the child project model uses information calculated at the child project level, ColumnReturn values in the child specification list should be added to pass this information up into the main project. The GetTableValue function can then be used in the rule for the dummy part to extract the information from the child specification list.

The rule for the file name of the dummy part also needs to include the wild card symbol at the beginning. This ensures the rule result is not appended to the master name of the dummy model.

="*" & "Block" & GetTableValue(DWSubResultsChildSpec,2,4) & " Long x " & GetTableValue(DWSubResultsChildSpec,2,5) & " High x " & GetTableValue(DWSubResultsChildSpec,2,6) & " Wide"

Repeat for each additional dummy part in the assembly. Remember to increase the row number in the GetTableValue function to extract the information from the next line down in the child specification list.

When requiring models created by a child specification to be used in an assembly created by a parent project ensure the setting Overwrite Released Model Data is unchecked. See General Settings for more information.

Now when the main project is specified, and child projects added to the child specification list, all child models will be generated first and then assembled into the main project assembly.

Hide Child Project from New Specification List

The New Specification list will have been displaying both the Main Project and Child Project as being available for specification. This is a common requirement, but equally is the need to display the Main Project only in the new specification list.

To do this open the Child Project in DriveWorks Administrator. Click the Settings button from the DriveWorks toolbar

From the settings dialog, select Project Settings

Check the box next to Hide project from new specification lists, click OK.

The child project will no longer appear in the new specification list.


Knowledge Base Article Ref:KB12121034