Breaking assemblies - Correcting my A2+ workflow

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
kemes
Posts: 63
Joined: Wed Mar 02, 2022 8:05 am

Breaking assemblies - Correcting my A2+ workflow

Post by kemes »

I'm using:

Code: Select all

OS: Ubuntu 20.04.5 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * ExplodedAssembly
  * Curves 0.5.7
  * A2plus 0.4.58
  * fasteners 0.4.4
  * sheetmetal 0.2.56

I have an assembly with multiple sub-assemblies. Overall around a 100 parts total. I'm facing this issue where if I go and edit a part even slightly (e.g. add a Techdraw sheet to the part) and return to the main assembly and update the imported parts - the constraints will be broken because of the add of the Techdraw sheet. Even if the geometry of the part has not changed the constraints break. This leads to deleting the faulty constraints and re constraining the edited parts which process wise can be very time consuming (I'm doing this after every edit). I do understand the breaking constraints in the case where if I modify the geometry of the part. But I guess the small changes I make (e.g. changing a diameter, adding a drawing sheet etc.) should not break the assembly (TNP?) in the way they do now.

I assume I will have to change my workflow in some way. What would be the optimal way of working with an A2+ assy? Deleting the constraints before editing the part?
Last edited by kemes on Tue Sep 06, 2022 12:41 pm, edited 3 times in total.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: Breaking assemblies - Correcting my A2+ workflow

Post by chrisb »

Moved from Help forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
kemes
Posts: 63
Joined: Wed Mar 02, 2022 8:05 am

Re: Breaking assemblies - Correcting my A2+ workflow

Post by kemes »

Here are a few tips that I have found useful so far:

1. - If you edit your parts you will have to fix the existing constraints. Broken constraints are a drawback in A2+. This is mainly due to the names of the faces changing when editing the parts belonging to the assembly. For now this is something that has to be accepted. I assume that once the TNP has been solved the user experience of A2+ shall improve as well.

2. - dan-miel created a nice series of videos on how do troubleshoot the A2+ constraints:
01 when you first open Constraints. https://youtu.be/9L8u2-xBT1Y (Not necessary, you can find the functionality directly in A2+)
02 How to view constraints associated with a part. https://youtu.be/jA9JBXVcd34
03 Highlighted parts not moved error. https://youtu.be/v5dIPjdV-y8
04 Find small constraint with a label. https://youtu.be/yXG1muuJtHk
05 Update constraints one at a time. https://youtu.be/_JWpEvC0AqQ
06 Move a constraint’s attachment to a new surface. https://youtu.be/XtKRF33v5EU
07 How to view constraints in tree. https://youtu.be/Y1-iExD65fs
08 Modifying parts. https://youtu.be/ng9QSUHW09w
08 Video is about 2 minutes but it show the second button to use when modifying parts.

3. - Instead of the yellow/green update button you are probably better of by using the black/orange update button. Even though you can only update one part at a time.

4. - Learning how to efficiently diagnose and fix broken constraints in A2+ is something you should not skip. Once you master this it will make your life easier.
User avatar
kemes
Posts: 63
Joined: Wed Mar 02, 2022 8:05 am

Re: Breaking assemblies - Correcting my A2+ workflow

Post by kemes »

I realized that even if you have not edited your part the black/orange update button tends to break a fully working assembly. See the video below.
Attachments
update_breaking_assembly.gif
update_breaking_assembly.gif (548.74 KiB) Viewed 1726 times
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Breaking assemblies - Correcting my A2+ workflow

Post by dan-miel »

kemes wrote: Tue Sep 06, 2022 5:26 pm I realized that even if you have not edited your part the black/orange update button tends to break a fully working assembly. See the video below.
Hi Kemes: Thanks for trying out these new functions in A2plus. Looking at the video it looks like the program is finding the edge because it moves the part into place when you press the run button. Pressing the run button only solves the one constraint, sometimes the Direction of the constraint needs to be changed or it will conflict with the other constraints. This can be done in column 1. Also, to check if all constraints are not conflicting you can use the viewing button and import the constraints of the part and run them one at a time.
If you can post the assembly, I will take a look at it and see if I can find what is going on.
Again, Thanks
Dan Miel
User avatar
kemes
Posts: 63
Joined: Wed Mar 02, 2022 8:05 am

Re: Breaking assemblies - Correcting my A2+ workflow

Post by kemes »

Hi dan-miel,

yes that's correct, on the first click of the solve constraints the part is moved correctly and the constraint between the two parts is correct + the assembly is solved without errors. But after this when I click the black/orange update the update function looses the other edge (yellow column in the list). This is something that I find weird. I would understand this one of the parts was edited before clicking the update button but as nothing has been changed pressing the update button should end up giving "thumbs up" on everything.

The assembly on the video was just created to outline a possible issue. But you can find it attached.
Attachments
example_assembly.zip
(50.98 KiB) Downloaded 50 times
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Breaking assemblies - Correcting my A2+ workflow

Post by dan-miel »

dan-miel wrote: Tue Sep 06, 2022 5:57 pm If you can post the assembly, I will take a look at it and see if I can find what is going on.
If you put this in the "mod" directory and overwrite the one that is in there, the update program should work.
Line 489 now reads "getfacebynum", this version reads getedgebynum. I became too excited by copy/paste.

As always let me know if it is still broken.
Dan
Attachments
CD_A2plusupdater.py
(23.96 KiB) Downloaded 56 times
User avatar
kemes
Posts: 63
Joined: Wed Mar 02, 2022 8:05 am

Re: Breaking assemblies - Correcting my A2+ workflow

Post by kemes »

Thank you dan for fixing the edge / face "glitch".

It seems that at least (might be in production also) in the latest version you provided the black/orange update button (the update function) does not catch the existing conflict (in a situation where the Solve Constraints and Checks Constraints functions do catch the conflict) instead it gives a "Update complete. All surfaces found" -message. (see the attached video).

Is it correctly assumed that all of these functions should catch a constraint conflict in somewhat a similiar way:
Solve Constraints
Identify conflicting constraints
Updates parts from the A2plus program that has been modified
Checks constraints
Attachments
conflict_not_found.gif
conflict_not_found.gif (463.59 KiB) Viewed 1632 times
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Breaking assemblies - Correcting my A2+ workflow

Post by dan-miel »

kemes wrote: Wed Sep 07, 2022 5:30 am Is it correctly assumed that all of these functions should catch a constraint conflict in somewhat a similiar way:
Hi Kemes:
The functions work in different ways. I’ll try to explain by using a straight edge as an example. An edge can be identified two ways, by its name or by its length, starting point and end point.
A constraint holds two features together and identifies the features by their name. The features of a constraint might be part1/edge4 and feature two is part2/edge14

The yellow and green update button solves all of the constraints by name. If a part is changed by updating just a dimension, the names of the features normally stay the same and then when the assembly is updated using this button the constraints updates fine. When updating parts by changing just the dimensions, I recommend trying this update button first.

The black/orange button does not solve the constraints. It loops through the constraints for the part that is being updated and records the physical traits of the feature it is attached to. In our case the length, starting point and ending point of an edge. It then loops through the edges of the part and when it finds a matching edge it replaces the name in the constraint with the newly found edge. If a matching feature is not found it is reported as missing and gives you a chance to reattach it. If you view the “Report View “window this function prints a report of the number of broken and repaired constraints. After the names are updated, you can use the Solve button.

The “Solve” button solves all of the constraints and produces a completely solved assembly. If it errors, it gives an error message. For me the error messages are unclear and hard to work with.

The “Check Constraints” button solves all of the constraint but solves them one constraint at a time then looks to see if a part that is connected to that constraint moved. If a part has moved it is reported as a conflicting mate. This function is not perfect, but it usually gives me a starting point to start looking for a conflicting constraint with the view function. You use the Solve button after the conflicting constraints are fixed.

I hope this explains better how these functions work.
Dan Miel
User avatar
kemes
Posts: 63
Joined: Wed Mar 02, 2022 8:05 am

Re: Breaking assemblies - Correcting my A2+ workflow

Post by kemes »

Thank you Dan for the in depth explanation!
Post Reply