Introduction
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:
- Capture the assembly in DriveWorks. (open the assembly in
SOLIDWORKS and select the "Click here to capture the active
model" helper link.)
- Capture the parts as instances in the assembly. (select the
instances button then select all the instances that are required)
- 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.)
- 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.
- Open or create a project to use for this example.
- Select Stage 4. Output Rules > Model Rules from the task
explorer.
- Click Add to add the components to drive.
- Select the
Assem1 assembly and the
Part1 part, click OK.
- Click Add again to add another occurrence of
Part1, click OK.
- 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.
- 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.
- Select the file name parameter for the first occurrence and
click Build to launch the Rule Builder.
- Add the text
& "-1" to the existing rule. This will create
a file name based on the DWSpecification number with -1 added.
- Select the file name parameter for the second occurrence and
click Build to launch the Rule Builder.
- Add the text
& "-2" to the existing rule. This will create
a file name based on the DWSpecification number with -2 added.
- Repeat steps 5 and 6 for all other occurrences, each time
incrementing the number to be added to the file name.
- If any other parameters (dimensions, features, etc) have been
captured for the components build the rules for them now.
- 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.
- Select the first instance of the component to be replaced and
click Build to launch the Rule Builder.
- 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.
- Select the second instance of the component to be replaced and
click Build to launch the Rule Builder.
- 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.
- 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:
- Select the Assem1 from the model list.
- 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.