Assembly4: strange behaviour with the numeric part of the fasteners label

Discussion about the development of the Assembly workbench.
Post Reply
FCuser2019
Posts: 112
Joined: Fri Sep 13, 2019 12:15 pm

Assembly4: strange behaviour with the numeric part of the fasteners label

Post by FCuser2019 »

Hello, by casualty I have discovered this strange behaviour: if in an assembly made with Assembly4 there are 3 or more fasteners attached to LCS whose position is defined by a master sketch, then every time you enter and exit the Sketcher (even without making any change to the master sketch), the numeric part of the fasteners label string is incremented by one unit.
The same strange behaviour occurs if the master sketch depends on a variable defined in Variables and you change the value of this variable.
I have created a simple assembly that allows you to see this strange behaviour:
1) Load Assembly4 WB;

2) Open the attached file fasteners_test.FCStd;

3) double click on Sketch_1 to edit the sketch, don't modify anything and press Close to exit the Sketcher --> all ok: fasteners labels are not changed;

4) click on Variables and change the value of the variable angle --> all ok: the master sketch rotates and the labels of the fasteners have not changed;

5) click on Assembly in the tree view and add a new screw with the command "Insert a Screw in the Assembly" (the automatic label will be M6x8-Screw002), attach this new screw to LCS_2 by pressing the "Edit Placement of Part" button;

6) click on Assembly in the tree view and add a new nut with the command "Insert a Nut in the Assembly" (the automatic label will be M6-Nut002), attach this new nut to LCS_2 by pressing the "Edit Placement of Part" button (rotate 180° around the X axis so that it is positioned similarly to the other two nuts); we get this:
after_step6.png
after_step6.png (95.98 KiB) Viewed 814 times

7) double click on Sketch_1 to edit the sketch, do not modify anything and press Close to exit the Sketcher --> the fasteners labels are changed: M6x8-Screw001 --> M6x8-Screw003, M6x8-Screw002 --> M6x8-Screw004, M6-Nut001 --> M6-Nut003, M6-Nut002 --> M6-Nut004;

8) click on Variables and change the value of the variable angle --> the master sketch rotates and the labels of the fasteners are changed: M6x8-Screw003 --> M6x8-Screw005, M6x8-Screw004 --> M6x8-Screw006, M6-Nut003 --> M6-Nut005, M6-Nut004 --> M6-Nut006

after_step8.png
after_step8.png (104.59 KiB) Viewed 814 times

9) each time you repeat steps 7) and/or 8) the numeric part of labels change.

Thanks for your attention.

Code: Select all

OS: Linux Mint 20.2 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.28751 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 660655e)
Hash: 660655e54c97b5017ff0ac1e030059308cd4e3f5
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * kicadStepUpMod 10.10.5
  * DynamicData 2.32.0
  * Manipulator
  * Assembly4 0.11.11
  * fasteners 0.3.38

P.S. I have verified that the described behaviour also occurs with Assembly4 version v0.11.10
Attachments
fasteners_test.FCStd
(55.71 KiB) Downloaded 16 times
Last edited by FCuser2019 on Mon Apr 25, 2022 1:53 pm, edited 1 time in total.
Haavard
Posts: 107
Joined: Wed Feb 17, 2021 10:48 pm

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by Haavard »

This also happens when applying configurations. Weird indeed.
User avatar
Zolko
Veteran
Posts: 1794
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by Zolko »

FCuser2019 wrote: Mon Apr 25, 2022 10:58 am I have created a simple assembly that allows you to see this strange behavior:
...
6) click on Assembly in the tree view and add a new nut with the command "Insert a Nut in the Assembly" (the automatic label will be M6-Nut002)
this is strange indeed ... especially that when I create a new nut, it's called Nut002 and the label is M6-Nut. I don't see M6-Nut002.

Code: Select all

Installed mods: 
  * fasteners 0.3.38
can you please update the fastebers to 0.3.40 to check whether the strange behavior persists ?
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
FCuser2019
Posts: 112
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by FCuser2019 »

Hello Zolko, I have updated my FC to the following versions:

Code: Select all

OS: Linux Mint 20.2 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.28751 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 660655e)
Hash: 660655e54c97b5017ff0ac1e030059308cd4e3f5
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * kicadStepUpMod 10.10.5
  * DynamicData 2.32.0
  * Manipulator
  * Assembly4 0.11.12
  * fasteners 0.3.40

and I confirm the strange behaviour described in my first post.

Even with this new FC configuration when I add the third screw to the assembly I get:
internal name= Screw002 , label= M6x8-Screw002

when I add the third nut to the assembly I get:
internal name= Nut002 , label= M6-Nut002

(doing copy-paste, by mistake, I wrote in the first post M6x8-Nut001,M6x8-Nut002, ... ,M6x8-Nut006 instead of M6-Nut001,M6-Nut002, ... ,M6-Nut006; I have now corrected it).
FCuser2019
Posts: 112
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by FCuser2019 »

This strange behaviour is more tedious than you might imagine at first glance. Let's imagine we have a complex assembly in which we need to identify some screws and/or nuts with labels that are more descriptive than the default ones and we have renamed all these labels with appropriate names... As a result of the problem described above, as soon as we enter and exit the Sketcher and/or modify a variable on which the MasterSketch depends, all the work done is lost because the labels are renamed!
For example, in the attached file fasteners_test2.FCStd I have renamed the labels as shown in the following figure (I have not renamed the inner screw and the inner nut):

1.png
1.png (90.84 KiB) Viewed 602 times

By entering and exiting the Sketcher and/or modifying the angle variable, the labels are renamed as shown in the following figure:

2.png
2.png (92.45 KiB) Viewed 602 times

If you continue to modify the angle variable, the labels will be renamed with increasing numerical parts.
Obviously, if you try to animate the angle variable with the "Animate Assembly" tool, you will reach numerical parts in the order of hundreds or thousands:

2b.png
2b.png (113.67 KiB) Viewed 602 times

In the attached file fasteners_test3.FCStd I have renamed all the labels, as shown in the following figure:

3.png
3.png (92.16 KiB) Viewed 602 times

entering and exiting the Sketcher and/or modifying the angle variable, the labels are renamed as shown in the following figure:

4.png
4.png (92.1 KiB) Viewed 602 times

from this configuration of the labels names, continuing to modify the variable angle the labels are not renamed further: strange indeed.
FCuser2019
Posts: 112
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by FCuser2019 »

The files:
Attachments
fasteners_test3.FCStd
(78.98 KiB) Downloaded 12 times
fasteners_test2.FCStd
(79.01 KiB) Downloaded 10 times
User avatar
Zolko
Veteran
Posts: 1794
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by Zolko »

FCuser2019 wrote: Thu Apr 28, 2022 2:42 pm The files:
I tested both files, with the stable FreeCAD v0.19 and with the latest v0.20 from GitHub, and I don't see the numeric part of the renaming. You're right that the fasteners are renamed (re-labelled) when changing some parameters (angle, sketch ...), but they always keep their original (as per fasteners WB) name, no numbers.

What version of FreeCAD are you using ?

Code: Select all

OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28746 (Git)
Build type: Compiled
Branch: master
Hash: dc53e6dce1eb7f7a67d0f448355d92e4ac086d7f
Python 3.7.3, Qt 5.11.3, Coin 4.0.0a, OCC 7.3.0
Locale: English/UnitedKingdom (en_GB)
Installed mods: 
  * A2plus
  * CurvedShapes 1.0.1
  * fcgear 1.0.0
  * sheetmetal 0.2.49
  * TabBar
  * Render 2022.1.0
  * fasteners 0.3.40
  * Curves 0.4.1
  * WeldingWB_GitHub 0.0.1
  * Assembly4_GitHub 0.11.12

Code: Select all

OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24366 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0f9259c)
Hash: 0f9259cda103ae1824ac16c68ac9b4a0d54b05fc
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: English/United Kingdom (en_GB)
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
FCuser2019
Posts: 112
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: strange behaviour with the numeric part of the fasteners label

Post by FCuser2019 »

Hello Zolko, I confirm all the strange behaviour described above also with this version of FC:

Code: Select all

OS: Linux Mint 20.2 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.28774 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 716213b)
Hash: 716213beacd25a907f2c164ad8ef8309b8a284b0
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * kicadStepUpMod 10.10.5
  * DynamicData 2.32.0
  * Manipulator
  * Assembly4 0.11.12
  * fasteners 0.3.40
I confirm that the problems only affect the fasteners labels (the internal names remain unchanged).
Post Reply