V0.21 Parametric Part Reuse in Assembly4 V0.12.4

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

V0.21 Parametric Part Reuse in Assembly4 V0.12.4

Post by ppemawm »

There are occasions when you would like to reuse a part in a new assembly design but do not want to change that part in any other assembly it has been used. One solution is to make a copy of that part and adjust the dimensions or constraints, but that adds another part number to your design files. There is a another way to accomplish this with an Assembly4 Variant Part.

The following images shows a typical variant part and how you can go about modeling and using it in an assembly:

This is the part that I wanted to reuse in this assembly especially because each of the five braces shown highlighted in this image has two dimensional differences:  hole spacing and the height (the rails are tapered along their length).  The width and thickness are fixed.<br />.
This is the part that I wanted to reuse in this assembly especially because each of the five braces shown highlighted in this image has two dimensional differences: hole spacing and the height (the rails are tapered along their length). The width and thickness are fixed.
.
Capture13.JPG (214.94 KiB) Viewed 752 times
The first step in this process is to create the original variant part in its own file.  Start with an Assembly4 Part container and a Body from the Assembly4 toolbar.  Define the variables you expect to change in the future using the Assembly4 Variables object.  Save, close, and re-open the file.<br /><br />Assembly4 part and body include default LCS's that can be conveniently used for assembly.<br /><br />In this example, where the part was originally used, it had four variables:  height, width, hole spacing, and the sheet metal thickness.  The large hole was constrained to be always in the center using the variables and an Expression, one of the mounting holes was a fixed dimension from the bottom, and the bend radius of the sheet was 1.5x thickness which defined the inner and outer fillet radii.<br /><br />In retrospect, I probably should have added more variables so that the part could be more widely re-used but, of course, did not think of it at the time.<br /><br />Take note of where the the global origin is placed.  Normally you would locate the part symmetrically about the origin to simplify the modelling but in this case it is placed to facilitate assembly without having to add additional LCS's.<br />.
The first step in this process is to create the original variant part in its own file. Start with an Assembly4 Part container and a Body from the Assembly4 toolbar. Define the variables you expect to change in the future using the Assembly4 Variables object. Save, close, and re-open the file.

Assembly4 part and body include default LCS's that can be conveniently used for assembly.

In this example, where the part was originally used, it had four variables: height, width, hole spacing, and the sheet metal thickness. The large hole was constrained to be always in the center using the variables and an Expression, one of the mounting holes was a fixed dimension from the bottom, and the bend radius of the sheet was 1.5x thickness which defined the inner and outer fillet radii.

In retrospect, I probably should have added more variables so that the part could be more widely re-used but, of course, did not think of it at the time.

Take note of where the the global origin is placed. Normally you would locate the part symmetrically about the origin to simplify the modelling but in this case it is placed to facilitate assembly without having to add additional LCS's.
.
Capture13b.JPG (158.44 KiB) Viewed 752 times
Creating the PartDesign features for the body is fairly straight forward in this simple example.  The image shows how one of the variable dimensions is added to the sketch using the Expression Formula Editor.<br /><br />The first sketch is located at the Body and Part LCS and the model arranged so that the primary assembly interface (screw hole) is located at the sketch origin as shown in the image.<br /><br />The pad length, thickness, pocket, and fillet features all use the variables in their parametric properties.<br />.
Creating the PartDesign features for the body is fairly straight forward in this simple example. The image shows how one of the variable dimensions is added to the sketch using the Expression Formula Editor.

The first sketch is located at the Body and Part LCS and the model arranged so that the primary assembly interface (screw hole) is located at the sketch origin as shown in the image.

The pad length, thickness, pocket, and fillet features all use the variables in their parametric properties.
.
Capture14.JPG (201.66 KiB) Viewed 752 times
The next step is to add any LCS or hole axes to be used as &quot;connectors&quot; constraints during assembly.<br /><br />I always attach the LCS or hole axis to the sketch that forms the feature as shown in this image of the pocket sketch used for the mounting holes.  This avoids the TPM problem for the most part if the sketches do not change significantly and, besides, it makes sense to me.<br /><br />In order to reuse the part as a variant, import the necessary LCS or hole axis from the Body to the Part level using the Assembly4 Import Datum Object tool.<br /><br />I use the hole axis datum primarily for fasteners rather than an LCS since it always places the Z-axis in the direction of the fastener length (normal to the sketch) and you do not need to know the direction of the X and Y axes during assembly.<br />.
The next step is to add any LCS or hole axes to be used as "connectors" constraints during assembly.

I always attach the LCS or hole axis to the sketch that forms the feature as shown in this image of the pocket sketch used for the mounting holes. This avoids the TPM problem for the most part if the sketches do not change significantly and, besides, it makes sense to me.

In order to reuse the part as a variant, import the necessary LCS or hole axis from the Body to the Part level using the Assembly4 Import Datum Object tool.

I use the hole axis datum primarily for fasteners rather than an LCS since it always places the Z-axis in the direction of the fastener length (normal to the sketch) and you do not need to know the direction of the X and Y axes during assembly.
.
Capture15.JPG (158.71 KiB) Viewed 752 times
This image shows the assembly process for a variant part.  Use the Assembly4 Create (Insert) a Variant Part tool rather than the usual Import a Part.  The variant part file must be open to be visible to the assembly.<br /><br />Insert the part and choose the proper datum to connect it to the assembly.  You may have to rotate or offset the part depending on how carefully you defined the LCS axes directions when modelling the body.<br /><br />Once inserted into the assembly as a variant part the variables are visible to the assembly and can be changed as required for the specific variant application.<br />.
This image shows the assembly process for a variant part. Use the Assembly4 Create (Insert) a Variant Part tool rather than the usual Import a Part. The variant part file must be open to be visible to the assembly.

Insert the part and choose the proper datum to connect it to the assembly. You may have to rotate or offset the part depending on how carefully you defined the LCS axes directions when modelling the body.

Once inserted into the assembly as a variant part the variables are visible to the assembly and can be changed as required for the specific variant application.
.
Capture16.JPG (231.74 KiB) Viewed 752 times
Additional information can be found at Zolko's post where he introduced the new feature to Assembly4:
https://forum.freecadweb.org/viewtopic. ... 66#p538666

EDIT: Please note that it is not possible to assemble a part, body, or another variant part to a variant part. For more info see:
https://forum.freecadweb.org/viewtopic. ... 88#p626988

Comments or questions are always welcome. A file is available for anyone interested in the details.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.30398 (Git)
Build type: Release
Branch: master
Hash: b3dfdc568a92810449bf47bc73b6784d65dfa206
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.4
  * fasteners 0.4.6
  * fcgear 1.0.0
"It is a poor workman who blames his tools..." ;)
Post Reply