Assembly 4 workbench

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly 4 workbench

Post by project4 »

onekk wrote: Mon Oct 10, 2022 6:05 am When you create a new file, it has no name until you save it.
From this "fact" derive the "unnamed" name that you see in the treeview.
The unknown is shown even AFTER you save the file and it gets its proper name in the tree and properties.
That issue was discussed here some time ago (I disappeared from the forum for a year or two), so I asked Zolko if he know something, what code could be checked.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Assembly 4 workbench

Post by onekk »

project4 wrote: Mon Oct 10, 2022 8:15 am ...
The unknown is shown even AFTER you save the file and it gets its proper name in the tree and properties.
That issue was discussed here some time ago (I disappeared from the forum for a year or two), so I asked Zolko if he know something, what code could be checked.
Sorry probably I have misundestood your question.

I have supposed it was related to the "unnamed" file that is present in treeview.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
jackfreecad
Posts: 53
Joined: Sun Oct 25, 2020 4:56 pm

Re: Assembly 4 workbench

Post by jackfreecad »

Code: Select all

OS: macOS 10.16
ARM or M1 version
Word size of FreeCAD: 64-bit
Version: 0.21.30492 (Git)
Build type: Release
Branch: master
Hash: b4578fb3eae842eb510a1bc055d07d369a67ce94
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * freecad.gears-master 1.0.0
  * FreeCAD_Assembly4-master 0.12.4
  * freecad-slic3r-tools-master
  * fasteners 0.3.40
FYI animation was not working, was still working on old 28... something version
older files that used to work where not working anymore
I deleted/removed the assembly WB located at ../Users/myName/Library/Application Support/FreeCAD/Mod
downloaded the new WB from https://github.com/Zolko-123/FreeCAD_Assembly4
moved the dowloaded file to the Mod folder
restart freeCAD
and it is working again both in
arm release

Code: Select all

OS: macOS 12.6
Word size of FreeCAD: 64-bit
Version: 0.21.30402 (Git)
Build type: Release
Branch: master
Hash: 78cc184d50ff96621f23c037e3291a291a0948f3
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * freecad.gears-master 1.0.0
  * FreeCAD_Assembly4-master 0.12.4
  * freecad-slic3r-tools-master
  * fasteners 0.3.40
and intel release

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.30492 (Git)
Build type: Release
Branch: master
Hash: b4578fb3eae842eb510a1bc055d07d369a67ce94
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * freecad.gears-master 1.0.0
  * FreeCAD_Assembly4-master 0.12.4
  * freecad-slic3r-tools-master
  * fasteners 0.3.40
Thanks for the hard work, Freecad is awesome
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly 4 workbench

Post by project4 »

Zolko,
In case you didn't looked into the auto-numbering problem, here are the test results of adding a model named "GOB-1102-0005-0040" 7 times:

1st case: Fully automatic mode with current code, adding the first with selection in the add link dialog, the rest are added while the previous model is still selected, so it's the "fully automated" mode:
Screenshot from 2022-10-20 21-23-48.png
Screenshot from 2022-10-20 21-23-48.png (18.01 KiB) Viewed 4434 times
2nd case: Manual mode, clicking on the added model name in the add link dialog for every added instance (to fix the wrong auto-generated name):
Screenshot from 2022-10-20 21-24-40.png
Screenshot from 2022-10-20 21-24-40.png (19.03 KiB) Viewed 4434 times
There's also a 3rd case where you add some with clicks, some without, so it screws the naming completely. Without "correction" of the name for the auto-numbering, it will strip all last numbers that appear after the last underline.

Proposed solution: Fully automatic mode, the same flow as in the 1st case:
Screenshot from 2022-10-20 21-25-54.png
Screenshot from 2022-10-20 21-25-54.png (19.34 KiB) Viewed 4434 times
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

project4 wrote: Thu Oct 20, 2022 6:34 pm In case you didn't looked into the auto-numbering problem, here are the test results of adding a model named "GOB-1102-0005-0040" 7 times:
OK, I see. Could you show the result of adding a model named "GOB-1102-0005-0040" 7 times by adding "_1" at the end of the first instance's proposed name ?
try the Assembly4 workbench for FreCAD — tutorials here and here
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly 4 workbench

Post by project4 »

As I explained in GitHub discussion, when you work on a large assembly, you don't really know if you add that part for the first time to add the "_1" or that part exist in the assembly 20 times already. And you don't really want to start looking in the tree for every part you add. You just want to move forward, fast, and without distraction.
I'm using "ready" parts, not something I create myself, so you cant really keep track what is in the assembly already.

Here, with "_1" added for the first part and the rest added without "fixing" the name in the add link dialog:
Screenshot from 2022-10-21 09-38-35.png
Screenshot from 2022-10-21 09-38-35.png (18.62 KiB) Viewed 4350 times
It doesn't mater how many numbers you'll add after the name, the auto-numbering will strip them as long as it's a number after underscore.

And here a test with "_1" for the first instance and clicking on the name in the add link dialog to "fix" the name:
Screenshot from 2022-10-21 09-45-08.png
Screenshot from 2022-10-21 09-45-08.png (19.17 KiB) Viewed 4350 times
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

project4 wrote: Fri Oct 21, 2022 6:47 am And you don't really want to start looking in the tree for every part you add.
that is debatable.

And here a test with "_1" for the first instance and clicking on the name in the add link dialog to "fix" the name:
Screenshot from 2022-10-21 09-45-08.png
this is clearly a bug. (that I introduced in PR #293, my bad). Can you please make the same test, but first change in file insertLinkCmd.py the line 158 startAtOne=False to startAtOne=True :

Code: Select all

proposedLinkName = Asm4.nextInstance(rootName,startAtOne=False)
=> proposedLinkName = Asm4.nextInstance(rootName,startAtOne=True)
try the Assembly4 workbench for FreCAD — tutorials here and here
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly 4 workbench

Post by project4 »

Zolko wrote: Fri Oct 21, 2022 10:38 am
project4 wrote: Fri Oct 21, 2022 6:47 am And you don't really want to start looking in the tree for every part you add.
that is debatable.
I'm working on an assembly that will most likely pass 100 parts in it.
It's not feasible manually checking the tree for every part you add.
Or manually adding "_1" if I want the auto-numbering to work correctly.
When I add a link to a part, I have no idea if it's already in the assembly, that's why we use computers that suppose to do some stuff automatically.

Don't you agree? Or you think that a user should intentionally look on the tree to see that there is no duplicate names or to understand that the added instance was already used in that assembly in order to know if he should add "_1" to the name?

What is the intention of adding the "_1" to the name?
To force the code to apply auto-numbering?
I proposed to add a checkbox with the same meaning, which you also didn't like for some reason.
If the checkbox is selected, the auto-numbering logic will be applied. If not, the name will not be touched.
Even better than realizing that the code added some numbers without your intention.
With the checkbox you have the full control.
Set it -> Get the numbering added for every instance.
Don't set it -> The name will be exactly as you typed in the dialog. There is a model with exactly the same name? Error pop-up will appear.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

project4 wrote: Fri Oct 21, 2022 11:20 am Don't you agree?
no

What is the intention of adding the "_1" to the name? To force the code to apply auto-numbering?
yes. Brilliant, isn't-it ? Simple, effective, easy to understand, easy to follow.
try the Assembly4 workbench for FreCAD — tutorials here and here
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly 4 workbench

Post by project4 »

Looks like you don't really want any help with the project.
That's a great way to turn contributors against you.
I'll probably stick with my repo and continue the development there.

Have fun
Post Reply