Assembly 4 Using Fasteners

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
zardozer
Posts: 49
Joined: Sat Nov 07, 2020 2:35 am

Assembly 4 Using Fasteners

Post by zardozer »

Can someone explain to me the proper workflow for adding fasteners in assembly 4? I tend to do them at the end like most people, but putting fasteners on the assembly doesn't seem to work intuitively for me.

What I'd like to happen: from the top level assembly, you can click on any hole and add a fastener of your choosing and it just works. Maybe if it's a sub-assembly, it would take me to the sub-assembly structure and it would add the fastener there.

But when I'm in the top level, I can't even select the fastener button, and the fastener wb doesn't work really either. It will add a fastener but not respect the hole I'm trying to add it to. If I go into a sub-assembly and try to add it there, it usually results in the same problem: the fastener doesn't seem to respect the LCS placement. It gets added to the top level, but it's attached to where it thinks it should be, before the part is attached with the LCS. What exactly am I doing wrong, or how is this supposed to work? Am I missing something really simple?

OS: macOS Mojave (10.14)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git)
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 Using Fasteners

Post by Zolko »

zardozer wrote: Mon Jan 18, 2021 9:02 pm Can someone explain to me the proper workflow for adding fasteners in assembly 4? I tend to do them at the end like most people, but putting fasteners on the assembly doesn't seem to work intuitively for me.
the Fasteners workbench is independent from Assembly4, therefore it's already a small miracle that it works at all with it, and not too badly.

The workflow that is thought is the following:

  • in each hole you wish to add a fastener, create a "Hole Axis" object on the entrance circle, which is a datum axis attached to the centre of the circle. This will only work for parts that are inserted (linked) directly in the assembly. If you do it on a part in a sub-assembly, it will still create the "Hole Axis" but that will not be visible to the fastener: in this case insert the fastener into the sub-assembly (which is actually the mechanical assembly you would indeed do)
  • of course, if you modify your part after that, you might run into the topological naming problem and the "Hole Axis" might not recognise its original attachment edge, so yes, do the fasteners at the very end
  • If needed, create such a "Hole Axis" on each side of the hole
  • for an individual fastener, create that fastener, and choose it's parameters.
  • select that fastener, and click on "Place Fastener" command, and select the "Hole Axis" you created. You can select it either in the drop-down or directly in the 3D window (I hope I commited that feature, not sure).
  • if there are several fasteners on the same hole (washer, nut ...) repeat the process. Offset the fasteners along Z as needed
  • adjust the fasteners parameters
  • for a family of fasteners, meaning by that fasteners of the same type placed on holes in the same part, create a "Hole Axis" for each such hole
  • select the master fastener for this family of fasteners, select all the "Hole Axis" that you wish, click on "Duplicate Fastener" and the master fastener will be duplicated and attached to each pre-selected "Hole Axis" object
  • there were attempts to use the Draft_Array function on fasteners, but that didn't quite work very well. If you know someone interested to have a look at that function, please say so.
If this doesn't work as advertised, it's a bug and should be fixed: please report. If you can propose improvements to this workflow, please don't hesitate to tell.

Also, if someone feels like writing a tutorial and/or documentation on this, that would be great.
try the Assembly4 workbench for FreCAD — tutorials here and here
zardozer
Posts: 49
Joined: Sat Nov 07, 2020 2:35 am

Re: Assembly 4 Using Fasteners

Post by zardozer »

Great, thanks for the explanation! Interesting, so it seems we need a datum coordinate for each hole. What I think would really help speed up this method is if the command would automatically create a concentric datum on the hole and attach the fastener, all in one button. So in essence, applying fasteners would work similarly to the fastener workbench. There would have to be some logic that states not to make a new datum if there's already one there. Anyway, hopefully this suggestion would be something that's possible to implement.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 Using Fasteners

Post by Zolko »

yes, you're right, we sould aim for that. It might take some time though
try the Assembly4 workbench for FreCAD — tutorials here and here
Juzer99
Posts: 15
Joined: Fri Apr 01, 2022 5:03 pm

Re: Assembly 4 Using Fasteners

Post by Juzer99 »

Zolko wrote: Tue Jan 19, 2021 8:25 pm
[*]select that fastener, and click on "Place Fastener" command, and select the "Hole Axis" you created. You can select it either in the drop-down or directly in the 3D window (I hope I commited that feature, not sure).
Hello,
Where would I find that "Place Fastener" command?
I found "Clone Fastener to Axes" in Assembly 4 WB under Assembly/Fasteners but it is grayed out.
I looked for that command Fasteners WB but not there either.

Thanks
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 Using Fasteners

Post by Zolko »

Juzer99 wrote: Fri Apr 01, 2022 5:42 pm Where would I find that "Place Fastener" command?
it has been merged into the generic "Place Part" command : Fasteners are autodetected and are dealt with accordingly

Image
try the Assembly4 workbench for FreCAD — tutorials here and here
Juzer99
Posts: 15
Joined: Fri Apr 01, 2022 5:03 pm

Re: Assembly 4 Using Fasteners

Post by Juzer99 »

It looks like things changed a bit since you have posted the original workflow. This is what seems to be working for me now

1. I create LCF in the Asembly (let's call it a Component Assembly) that I intent to link later to another Assembly (let's call it a Master Assembly)
LCF is attached to the hole in Concentric mode.
-> I must select the Assembly before attaching LCF or this will not work.

2. I link the "Component Assembly" to "Master Assembly"

3. I select Assembly in "Master Assembly" and add a fastener using the Insert Screw/Nut/Washer within Assembly 4 WB.
The default fastener is placed at the LCF0 of the "Master Assembly"
-> If I create a fastener using Fasteners WB this will not work.
--> I have only tried a few but it appears only metric fasteners work. Inch sizes generate error ({'sclassname': 'class Base::ValueError', 'sErrMsg': "'1/4in' is not part of the enumeration", 'sfile': '', 'iline': 0, 'sfunction': '', 'swhat': "'1/4in' is not part of the enumeration", 'btranslatable': False, 'breported': True}: Inappropriate argument value (of correct type).)

4. I select the fastener and use use Change Fastener Parameters to pick the size I need.

5. I select the fastener and use " Move/Add a Part in the assembly" from the toolbar or Constraints/Edit Placement of a Part from top menu
-> Both seem to be the same command

6. I attach the selected fastener to one of the LCSes in the "Component Assembly" linked to the "Master Assembly"
->It seems Hole Axis is not needed/does not work with fastener placement
--> It seems LCS can be added to the "Component Assembly" after it was linked to the "Master Assembly" and fastener can be linked to that new LCS in the the "Master Assembly"

I am posting this as a reference for my future self and others struggling with fasteners in Assembly 4.

Thank you for great software :-)

I hope a few most common inch fasteners (1/4, 5/16, 3/8, 1/2 with hex and cap socket heads) will be added at some point for FreeCAD users in Liberia, Myanmar, Canada and the United States of America ;-)
Attachments
TestBoltsinassembly.FCStd
(41.73 KiB) Downloaded 85 times
TestAssemblyWithBolts.FCStd
(95.02 KiB) Downloaded 89 times
User avatar
hasecilu
Posts: 124
Joined: Sat Jan 29, 2022 7:23 pm
Contact:

Re: Assembly 4 Using Fasteners

Post by hasecilu »

Juzer99 wrote: Fri Apr 01, 2022 10:55 pm It looks like things changed a bit since you have posted the original workflow. This is what seems to be working for me now
This information was useful :D

I just want to add an example in how to add multiple fasteners: Let's say you want to add 24 fasteners (same size and type) to an assembly that use a Part 4 times (6 fasteners in each instance)
  • Instead of creating 24 fasteners for the Master Assembly it's better to create a sub assembly and include there the 6 fasteners needed
  • Instead of creating 6 fasteners for the subassembly create 1 fastener and then use the Make Link function, then set the property "Element Count" to 5
  • Next manually place original fastener to the desired LCS, note that all 6 fasteners move. There is no way to assign any Link fastener to another LCS because all fasteners will move, so, the strategy is forget the Assembly4 way and move the links using the Transform Tool (right click>Transform) for every fastener of the 5 left and rotate and move to their position. This coordinates are relative position of the original fastener
In the master assembly add 4 instances of the subassembly and you are finish.

Drawbacks with Fasteners BOM:
  • There is a problem with the Fasteners BOM tool, instead of making the count of fasteners using the tree it looks like it counts the number the fasteners in the open instances, i. e. , it counts more than once.
    • If you create the BOM with only the sub-assembly open: in the BOM of subassembly there are 6 screws.
    • If you create the BOM with the sub-assembly AND the main assembly open: in the BOM of subassembly there are 30 screws instead of 24, 6 per each instance and 4 instances in master assembly and 1 instance in the subasassembly.
There is need to fix the BOM manually but if terms of assembly is OK. Another is to close the main assembly file in order to Fasters BOM tools don't counts all instances.

Drawbacks with Assembly4 BOM:
  • In the BOM of master there is no 24 fasteners but 4 instances of subassembly. (but this is not a big deal and it's expected and coherent)
  • It don't add parts that are inside a Group, so, if you organize your Parts in Groups (folders) these Parts will not appear in the BOM, if we compare with the BOM of Fasteners, there is no problem if the fasteners are inside a Group. This bug was already fixed some weeks ago but still not in main.Check this commit and chage the affected line
Last edited by hasecilu on Mon Jun 06, 2022 3:02 am, edited 1 time in total.
User avatar
hasecilu
Posts: 124
Joined: Sat Jan 29, 2022 7:23 pm
Contact:

Re: Assembly 4 Using Fasteners

Post by hasecilu »

I have just created a videotutorial showing how to work with fasteners in the Assembly4 WB.
It's here: https://youtu.be/tltsTgfC3U8
BassMati
Posts: 98
Joined: Sat Oct 06, 2018 11:39 am
Location: Germany Bielefeld
Contact:

Re: Assembly 4 Using Fasteners

Post by BassMati »

I just wanted to test the menu Assembly > Fasteners > Clone Fasteners to Axes.

To do that, I created an Assembly container, added a (linked) Body with 4 holes and hole axes.
Then added a nut to the assembly container with menu Assembly > Fasterners > Insert nut. So nut and link to the body are siblings with the same parent.
Then selected the nut and the axes and clicked "Clone Fasterners to Axes" in the menu. That worked exactly once. Four nuts in total were created and correctly positioned and attached to the axes.

The subsequent attempts only created a single nut (or screw or washer) clone instead of the desired 3, and positioning also failed.

Hopefully, the error report helps to tackle this:

Code: Select all

11:56:26  Running the Python command 'Asm4_cloneFastenersToAxes' failed:
Traceback (most recent call last):
  File "D:\Appdata\FreeCAD\Mod\Assembly4\FastenersLib.py", line 272, in Activated
    Asm4.placeObjectToLCS(newFstnr, axisData[2], axis.Document.Name, axisData[3])
  File "D:\Appdata\FreeCAD\Mod\Assembly4\Asm4_libs.py", line 98, in placeObjectToLCS
    Asm4.makeAsmProperties(attObj)

name 'Asm4' is not defined
Additionally, this message appears frequently, e. g. while selecting objects in the model tree:

Code: Select all

12:40:06  Traceback (most recent call last):
  File "D:\Appdata\FreeCAD\Mod\Assembly4\placePartUI.py", line 328, in addSelection
    idx = self.parentList.findText(Asm4.labelName(selLink), QtCore.Qt.MatchExactly)
<class 'RuntimeError'>: Internal C++ object (PySide2.QtWidgets.QComboBox) already deleted.
Best regards & thanks for your effort,
Ulrich

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2022.430.28641 (Git) (RealThunder's build)
Build type: Release
Branch: LinkStage3
Hash: a77045488092c24ece25d63c91f362cbd2181d36
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

Assembly 4 version: 0.11.12
Attachments
demo-06.FCStd
(48.56 KiB) Downloaded 73 times
Post Reply