Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
Syres
Posts: 472
Joined: Thu Aug 09, 2018 11:14 am

Re: Another approach to assembly solver (A2plus)

Postby Syres » Mon Dec 30, 2019 1:25 pm

Using v0.4.35, when deleting constraints I was occasionally getting the following error in the Report View but not consistently:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\JPS\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 126, in getIcon
    FreeCAD.ActiveDocument.getObject(self.constraintObj_name).Type
<class 'AttributeError'>: 'NoneType' object has no attribute 'Type'
I modified my a2p_viewProviderProxies.py file at line 124 from:

Code: Select all

    def getIcon(self):
        return a2plib.A2P_CONSTRAINTS_ICON_MAP[
            FreeCAD.ActiveDocument.getObject(self.constraintObj_name).Type
            ]
to:

Code: Select all

    def getIcon(self):
        if FreeCAD.ActiveDocument.getObject(self.constraintObj_name).Type != None:
            return a2plib.A2P_CONSTRAINTS_ICON_MAP[
                FreeCAD.ActiveDocument.getObject(self.constraintObj_name).Type
                ]
and the error hasn't reappeared since.

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19060 (Git)
Build type: Release
Branch: master
Hash: 72065b0d3960ec9b4aa90cce1a6e810e8bab68c4
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Mon Dec 30, 2019 3:54 pm

Syres wrote:
Mon Dec 30, 2019 1:25 pm
Hi @Syres,
thank you for your post. Probably you already have found the error. I will have a look at this section and fix it on master branch.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Mon Dec 30, 2019 5:46 pm

Syres wrote:
Mon Dec 30, 2019 1:25 pm
Using v0.4.35, when deleting constraints I was occasionally getting the following error in the Report View but not consistently:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\JPS\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_viewProviderProxies.py", line 126, in getIcon
    FreeCAD.ActiveDocument.getObject(self.constraintObj_name).Type
<class 'AttributeError'>: 'NoneType' object has no attribute 'Type'
The bug is fixed. Please update to version v0.4.35a .
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Wed Jan 01, 2020 5:28 pm

A2plus V0.4.36 has a new constraint.

Angle between an axis and a plane: "axisPlaneAngle constraint"
.
axisPlaneAngleConstraint.png
axisPlaneAngleConstraint.png (127.29 KiB) Viewed 473 times
.
Have fun !
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Koemi
Posts: 108
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Another approach to assembly solver (A2plus)

Postby Koemi » Wed Jan 15, 2020 3:27 pm

Still using FC V0.16 and Assembly2. But making small steps to A2plus V0.4.39a (using the Addon manager) and implemented it in FC V0.18 version.

Quite scary to ruin all the parts and assemblies already made the last 2,5 years :?

:?: Is there already some solution to update assemblies from Assembly2 to A2Plus without losing constraints (searched, but couldn't find it)?
:?: Compared kbwbe screendump with my A2Plus and it seems I am missing a few "A2p_Part" kbwbe above and mine below?
image 26.png
image 26.png (36.96 KiB) Viewed 328 times

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Belgium (nl_BE)
triplus
Posts: 9278
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Postby triplus » Wed Jan 15, 2020 5:48 pm

kbwbe wrote:
Sun Dec 22, 2019 12:55 pm
Hi people,

A2plus V0.4.33 has a new feature (thanks to a user request). Now you can click a part and move it around under rule of all constraints.
kbwbe wrote:
Wed Jan 01, 2020 5:28 pm
A2plus V0.4.36 has a new constraint.

Angle between an axis and a plane: "axisPlaneAngle constraint"
Thanks!
Koemi wrote:
Wed Jan 15, 2020 3:27 pm
:?: Is there already some solution to update assemblies from Assembly2 to A2Plus without losing constraints (searched, but couldn't find it)?
Such attempts are usually error-prone and don't work good beyond offering some basic migration capabilities. Therefore for existing Assembly 2 projects best to use FreeCAD 0.16 and Assembly 2, for new projects use FreeCAD and A2plus. The third viable option is to take an existing Assembly 2 project and redefine relations with A2plus (manually). I guess for projects that are still under active development and would benefit by migration to A2plus.
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Wed Jan 15, 2020 11:05 pm

Hi @Koemi,
Koemi wrote:
Wed Jan 15, 2020 3:27 pm
:?: Is there already some solution to update assemblies from Assembly2 to A2Plus without losing constraints (searched, but couldn't find it)?
@triplus already answered this correctly and sorry for no better news. You will probably loose many constraints during migration from A2 to A2plus. The imported parts can be kept alive, but not the constraints. There is a menu entry within the A2plus WB menu: "migrate proxies of imported parts" which updates the imported parts to recent state. The constraints have to be deleted and you have to redefine them manually. Please always keep a robust backup.
Koemi wrote:
Wed Jan 15, 2020 3:27 pm
:?: Compared kbwbe screendump with my A2Plus and it seems I am missing a few "A2p_Part" kbwbe above and mine below?
I am a little bit confused. If activating the option "enable recursive update..." in A2p prefs, you will see this additional icon:
update-recursive.png
update-recursive.png (1.45 KiB) Viewed 281 times
.
But your screenshot does not seem like A2p version V0.4.39a . Please can you provide a screenshot including the workbench selector like this one:
a2plus-V0.39a.png
a2plus-V0.39a.png (31.73 KiB) Viewed 281 times
.
Additional comment: For me, i do not recommend FC0.18.x anymore. If you are doing some transitions, you should directly switch to FC0.19. It is much more performant and already very stable, if you are using the standard and well known features.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Koemi
Posts: 108
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Another approach to assembly solver (A2plus)

Postby Koemi » Thu Jan 16, 2020 7:03 am

Thanks for your info guys.
Additional comment: For me, i do not recommend FC0.18.x anymore. If you are doing some transitions, you should directly switch to FC0.19. It is much more performant and already very stable, if you are using the standard and well known features.
Ok. I want to do this right away. There is this "Uninstall-FreeCAD.exe" file present inside the "FreeCAD 0.18" folder. Can I activate this without removing the FreeCAD V0.16 installation and what goes with it (like: 2,5 years of hard work for instance)?
Please can you provide a screenshot including the workbench selector like this one:
The WB selector shows V0.4.39a. I will provide a screenshot when FC V0.19 is installed correctly
Koemi
Posts: 108
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Another approach to assembly solver (A2plus)

Postby Koemi » Thu Jan 16, 2020 7:25 am

am a little bit confused. If activating the option "enable recursive update..." in A2p prefs, you will see this additional icon
Activated the option, still using V0.18 (screendumps: above kbwbe, below mine + content of pulldown A2plus)
Image 2.png
Image 2.png (91.01 KiB) Viewed 248 times

- Apparently "enable recursive update" helps, but still a few buttons missing, also not present in the pulldown of A2plus.
- Version A2Plus V0.4.39a
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Thu Jan 16, 2020 10:26 am

Koemi wrote:
Thu Jan 16, 2020 7:03 am
There is this "Uninstall-FreeCAD.exe" file present inside the "FreeCAD 0.18" folder. Can I activate this without removing the FreeCAD V0.16 installation and what goes with it (like: 2,5 years of hard work for instance)?
Better you ask for this in an appropiate forum (help or install/compile). I am no Expert for this.
But here https://github.com/FreeCAD/FreeCAD/releases/ you can download appimages of FC starting from FC0.16 up to FC0.19. All are running without installation. So you can test new versions. Always keep a backup before testing.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench