Assembly3 preview

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Post by catman »

realthunder wrote: Sat Jul 25, 2020 6:06 am
catman wrote: Thu Jul 23, 2020 12:16 am I can not find an information about how to close all lined open files that belong to an assembly.
You can use the 'Go to the deepest linked object' command.
Sorry, my question was unclear.
The 'Go to the deepest linked object' opens the deepest final document for me after I selected an object in 3D space. That is not what I want to do.

Edit (was still to complicated):
Consider the following use case
* Open 10 files, two have an assembly consisting each of 3 linked files ( out of the other open files).
* select one of the assembly tabs
* select a (fictious) function "Close this and all linked files"
* then this tab (1 assembly file) and the 3 linked files are closed. If one was unsaved, a question pops up "There are unsaved files. Save (Y/N)?"
* After that 6 files are still open, one is an assembly with a link to 3 other files.

This really gets useful, if you are talking about a project with 20 subassemblies, each containing subassemblies again. Its good to have all open items in a tree, but the tree must be kept manageable by closing subassemblies that are not required any more. I have found no way to do this in one step. With functions like 'Go to the deepest linked object' you iterate through all liked subitems manually and close each of it. That is a very dense procedure I had hoped is already automated somewhere.
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Assembly3 preview

Post by fcaduser »

@realthunder
Thank you for your detailed reply. As I said, at the moment I use a2+ (because I was preliminary using a2), but I got your principle and will give it a try using asm3.

I have this idea : make an assembly of a (factious) machine, made of parts and assemblies as simple as possible (just to pinpoint difficulties), with the purpose of making a comprehensive collection of each possible situation of what we are talking about and raises hurdle : flexible or nested constraint, under-constrained assembly, etc.

This thread is now unusable for addressing a *specific* issue, there are too many topics here. I will open a new thread very soon...
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

catman wrote: Sat Jul 25, 2020 9:49 am Edit (was still to complicated):
Consider the following use case
* Open 10 files, two have an assembly consisting each of 3 linked files ( out of the other open files).
* select one of the assembly tabs
* select a (fictious) function "Close this and all linked files"
* then this tab (1 assembly file) and the 3 linked files are closed. If one was unsaved, a question pops up "There are unsaved files. Save (Y/N)?"
* After that 6 files are still open, one is an assembly with a link to 3 other files.
So, you want an action in tree view document item context menu to 'close all linked document', is that right?

BTW, you probably want to try the new 'hierarchy menu' feature for easy navigation within deep hierarchies, so that you can stay in the main document most of the time.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Post by catman »

realthunder wrote: Mon Jul 27, 2020 12:00 am So, you want an action in tree view document item context menu to 'close all linked document', is that right?
yes that descibes it very well.

But please, I do not want you to add something that can be achieved another way already. Its just that I have not found a way yet to do it at all. Maybe your test cases do have hierarchies with many parts on every stage very often. Otherwise I wonder that you did not have come across this issue yourself.

Let me try to describe another example.
Lets say your windmill model has 10 parts at each assembly stage - each in an own file. You open the main assembly first to work on the main axis. Not all files are loaded and not all files are listed in the tree. But when your are done and started to work on the rotor blade model (10 files as well) you will have 20 files open and listed in the tree. So this with two other subassemblies (the stand and the housing for example) then its 40 files. The files are not ordered in the tree so you are scrolling around in the tree all the time. At this point I would like to go to the Main Axis assembly file and select "close all linked documents". This closes 11 files (assembly file for the main axis and the 10 parts) and removes them from the tree. For the rotor blade assembly I select the rotor blad assembly in the main assembly files tree (the other way to apply the new command), then "ContextMenu/CloseAllLinkedDocuments" and its 10 parts and the assembly file (if open) are closed and removed from the tree. With theses two commands I have now closed 22 files and I am down to about 20 files again.

In this example there is only one main assembly file open. In case of a large project, say a machine, most of the time only sub-assembly files are open, e.g. hydraulics pump subsystem, tool head, electronics module etc. and each has the same problem. So I believe when working with largen assemblies loading and unloading linkes files would become a standard function the same are assembly tree navigation. And when the models are complex with many constraints the system load adds up. Even with the freeze function, I have to unfreeze assemblies that I actively work on, and if I need a few subsubsystems memory and performance becomes and issue.

Sorry for the long text, but I hope you can see what I mean.

realthunder wrote: Mon Jul 27, 2020 12:00 am BTW, you probably want to try the new 'hierarchy menu' feature for easy navigation within deep hierarchies, so that you can stay in the main document most of the time.
I have not yet tried it, but I can check it out. I am quite happy with what is possible so far, so I am really looking forward to see what is new.


BTW: You magic function "Multiply Constraint" keeps amazing me. Did I observe correctly that I does not work in the Screw-Holes use case if the target holes are distributed over two instances of the same part? I had a part that consists of two identical halfs that was assembled by 8 metric scews. Each half had 4 holes. I had 8 instances of the screws and aligned one hole with the first screw, but the multiply function did fail. It only worked when I reduced the instances to 4 screws.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

catman wrote: Mon Jul 27, 2020 12:37 am Let me try to describe another example.
Lets say your windmill model has 10 parts at each assembly stage - each in an own file. You open the main assembly first to work on the main axis. Not all files are loaded and not all files are listed in the tree. But when your are done and started to work on the rotor blade model (10 files as well) you will have 20 files open and listed in the tree. So this with two other subassemblies (the stand and the housing for example) then its 40 files. The files are not ordered in the tree so you are scrolling around in the tree all the time. At this point I would like to go to the Main Axis assembly file and select "close all linked documents". This closes 11 files (assembly file for the main axis and the 10 parts) and removes them from the tree. For the rotor blade assembly I select the rotor blad assembly in the main assembly files tree (the other way to apply the new command), then "ContextMenu/CloseAllLinkedDocuments" and its 10 parts and the assembly file (if open) are closed and removed from the tree. With theses two commands I have now closed 22 files and I am down to about 20 files again.
Closing linked document does not remove the document icon in the tree view. It merely remove the corresponding tab in 3D view. There is currently no way to reverse a fully loaded document into a partial loaded one, other than manually close all and then reopen the main document. I'll probably add that logic in the future. It is not easy to handle as reloading document wipes out its undo/redo stack, which may break linking document's undo/redo.

To it a bit easier to navigate among large number of documents, you can try 'Tree view option -> Auto expand/collapse' mode, so that only the active document is expanded in the tree view.

BTW: You magic function "Multiply Constraint" keeps amazing me. Did I observe correctly that I does not work in the Screw-Holes use case if the target holes are distributed over two instances of the same part? I had a part that consists of two identical halfs that was assembled by 8 metric scews. Each half had 4 holes. I had 8 instances of the screws and aligned one hole with the first screw, but the multiply function did fail. It only worked when I reduced the instances to 4 screws.
Can you please provide a document demonstrating the problem?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Post by catman »

realthunder wrote: Mon Jul 27, 2020 1:40 am Closing linked document does not remove the document icon in the tree view. It merely remove the corresponding tab in 3D view. There is currently no way to reverse a fully loaded document into a partial loaded one, other than manually close all and then reopen the main document. I'll probably add that logic in the future. It is not easy to handle as reloading document wipes out its undo/redo stack, which may break linking document's undo/redo.

To it a bit easier to navigate among large number of documents, you can try 'Tree view option -> Auto expand/collapse' mode, so that only the active document is expanded in the tree view.
Right, I see. Thanks for the explanation. I appreaciate yout time to explain about the background issues.
Using the auto expand/collapse is a good way to manage the tree, I will switch to that one for larger trees. However, you say that the document tree can not shrink, but you say the tabs could be removed? So to mimic in code what I do by hand should not leave broken links, I would hope. If a function to run the procedure: "loop over the linked parts of selected assembly, if the tab is open close" is doable I would consider that already very helpful.
realthunder wrote: Mon Jul 27, 2020 1:40 am

magic function "Multiply Constraint"

Can you please provide a document demonstrating the problem?
magic function "Multiply Constraint"

Sure, I'll try to make a simple demo case,
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Post by catman »

realthunder wrote: Mon Jul 27, 2020 1:40 am Can you please provide a document demonstrating the problem?
magic function "Multiply Constraint"
Asm3_MultiplyConstraintLimit.jpg
Asm3_MultiplyConstraintLimit.jpg (100.12 KiB) Viewed 2097 times

Please check out this file. There is one part with holes for 2 type of screws, M6 and M10. The assembly joins two instances of the same part.

In the screenshot you see that the 4 M6 screws work fine. The holes belong to one body. The 2 M10 screws enable the MultiplyContraint function, but it fails.

The difference I see is that the holes of the failed joint are in 2 body instances. Maybe its the same if they are two fully separate bodies, but I did not test that.
Attachments
Asm3_MultiplyConstraintLimit.FCStd
(71.26 KiB) Downloaded 64 times
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

catman wrote: Mon Jul 27, 2020 8:46 am Using the auto expand/collapse is a good way to manage the tree, I will switch to that one for larger trees. However, you say that the document tree can not shrink, but you say the tabs could be removed? So to mimic in code what I do by hand should not leave broken links, I would hope. If a function to run the procedure: "loop over the linked parts of selected assembly, if the tab is open close" is doable I would consider that already very helpful.
I have added that menu action. It will be in my next release.

I have also fixed some problem in the constraint multiplication. It will work with your posted document. However, in order to auto expand the holes across multiple instances you must wrap the link array in some group, either a LinkGroup, App::Part, or another Assembly container. The reason is that, when you add a Link and expand it as array, the parent assembly will treat each array element as a separate 'part', each having its own independent 6 DOF. The multiplication logic cannot expand across part boundary, as all the expanded circles (holes) will be moved together. By wrapping the instances inside another group, it will be treated as a single 'part'. If it is your intention to add those link array elements as separate parts, then you'll have to drag the hole in each instance manually to that multiplied constraint.

BTW, you might want to try the 'Attachment' constraint for screws, which is cheaper than the plane coincidence.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Post by catman »

realthunder wrote: Tue Jul 28, 2020 1:24 pm I have added that menu action. It will be in my next release.
Thanks a lot, also for the explanation. I admit I did not fully understand everything, but I guess I need some further reading about your linkarrays and link groups and then some testing with the modified function.

Attachment is technically the equality of both element's coordinate frames, correct?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

catman wrote: Tue Jul 28, 2020 1:40 pm Attachment is technically the equality of both element's coordinate frames, correct?
Yes, that's right. You can apply additional offset to the element(link) to attach two parts in any relation. For the multiplication fix, you can test it now if you want, by cloning my asm3 github repository to your [user directory]/FreeCAD/Mod. Or, just want for my next release, probably tomorrow.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
Post Reply