Home Search

DriveWorks Pro 21
How To: Replace An Instance With A Driven Replacement Model (KB12121033)

Send Feedback

How To: Replace An Instance With A Driven Replacement Model

Instances of the same component within an assembly can be controlled individually to have the state changed, the configuration swapped or the instance replaced with a new component.

This article shows how to replace instances with a new driven replacement model.

How it works

When an assembly contains identical components, with identical names, they are given instance numbers in the SOLIDWORKS feature manager (<1>, <2>, etc.). When viewing the captured assembly structure for the assembly in DriveWorks only the seed component will be available for capture.

This is ideal for assemblies where the instances will always remain identical in every new assembly generated by DriveWorks.

When each instance is to be driven independently the seed component should not be captured as a child of the assembly. Instead each instance should be captured using the Instances feature.

When driving the configuration or state of each instance this is all that is required as far as capturing is concerned. But when the instance is to be swapped with a new component a component and it's parameters that are to be controlled must be captured outside of the assembly.

Example - Capture the Information

An assembly ( Assem1.sldasm) contains 3 instances of the same part ( Part1.sldprt). These parts are driven to different sizes each time a specification is made.

The structure of the assembly in the SOLIDWORKS feature manager looks like this:

To set up this assembly to control the instances individually:

  1. Capture the assembly in DriveWorks. (open the assembly in SOLIDWORKS and select the "Click here to capture the active model" helper link.) 
  2. Capture the parts as instances in the assembly. (select the instances button then select all the instances that are required)
  3. Capture the part as a component outside of the assembly. (Open the part in SOLIDWORKS and select the "Click here to capture the active model" helper link.)
  4. Capture the parameters of the part that require to be controlled.

Example - Add the components to the DriveWorks Project

With all the capturing done we are now ready to add the components to the project in DriveWorks Administrator.

  1. Open or create a project to use for this example.
  2. Select Stage 4. Output Rules > Model Rules from the task explorer.
  3. Click Add to add the components to drive.
  4. Select the Assem1 assembly and the Part1 part, click OK.
  5. Click Add again to add another occurrence of Part1, click OK.
  6. Repeat step 5 for as many occurrences that can replace instances in the assembly.
DriveWorks will automatically rename each other occurrence -2, -3, etc. in the Model Rules section. Only the reference to the occurrence is changed, this does not rename the actual SOLIDWORKS file.

Example - Build rules for the components

With all the components added, rules can be built that will enable each instance to be swapped with a new driven component.

  1. Select all occurrences of Part1 from the model list so their parameters are shown in the main window.
    Note DriveWorks has automatically built the rule for the File Name parameter of each occurrence ( DWSpecification). This is acceptable, but as the rule will result in the same file name for each occurrence this will not generate different files.
  2. Select the file name parameter for the first occurrence and click Build to launch the Rule Builder.
  3. Add the text & "-1" to the existing rule. This will create a file name based on the DWSpecification number with -1 added.
  4. Select the file name parameter for the second occurrence and click Build to launch the Rule Builder.
  5. Add the text & "-2" to the existing rule. This will create a file name based on the DWSpecification number with -2 added.
  6. Repeat steps 5 and 6 for all other occurrences, each time incrementing the number to be added to the file name.
  7. If any other parameters (dimensions, features, etc) have been captured for the components build the rules for them now.
  8. Next select Assem1 from the model list so the parameters are shown in the main window. Note the instances are listed with other parameters from the captured assembly.
  9. Select the first instance of the component to be replaced and click Build to launch the Rule Builder.
  10. Select the Components tab on the right hand side of the Rule Builder and double click the Part the first instance is to be replaced with, Click OK to apply the rule and close the Rule Builder.
  11. Select the second instance of the component to be replaced and click Build to launch the Rule Builder.
  12. Select the Components tab on the right hand side of the Rule Builder and double click the Part the second instance is to be replaced with, Click OK to apply the rule and close the Rule Builder.
  13. Repeat steps 10 and 11 for all other occurrences, each time selecting a different occurrence from the components tab.

Example - Component Ordering

The final step is to ensure the components are generated in the correct order.

Models are built in the order they appear in the model list. When an assembly is found DriveWorks will generate all base level children first and work up to the top level parent.

The use of driven replacement models to replace instances in an assembly dictates that the replacement models should always be generated (if required) before the assembly they are to be replaced into.

If the model list shows the Assem1 at the top:

  1. Select the Assem1 from the model list.
  2. Click Move Down to move the Assem1 component down in the order

You now have all the information required to successfully replace instances of the same component with new files that are different.

Information <Replace>

The <Replace> function in DriveWorks removes the need to know the File Name result of the replacement model.

When a rule is applied to the file name parameter of a component, selecting that component from the components tab of the rule builder will automatically use the file created.

DriveWorks Quick Tips

DriveWorks Quick Tips: Replace Feature

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

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

DriveWorks Tech Tips Portal

Replace Components

DriveWorks can replace models in a SOLIDWORKS assembly, which can be static or dynamic (i.e. the replacement part can be driven before being inserted into the assembly).

View all Tech Tips

DriveWorks Tech Tips Portal is available to DriveWorks Pro customers with an active subscription and support contract.

Tech Tips provide cut down projects that highlight specific functionality for faster and more effective learning.

To access the portal:

  1. Go to https://my.driveworks.co.uk/learn/tech-tips/
  2. Login with your DriveWorks Pro account credentials, if asked
  3. Click the Visit Tech Tips Portal button for access

The portal provides a search facility, start typing the name of the Tech Tip (as indicated above) to display the Tip you require.


Knowledge Base Article Ref:KB12121033