[Bug, Solved] A2plus error aligning pin to hole

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
andyandy
Posts: 3
Joined: Sat Jan 23, 2021 11:39 am

[Bug, Solved] A2plus error aligning pin to hole

Post by andyandy »

OS: Debian GNU/Linux 10 (buster) (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git) AppImage
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)

Workbench A2plus V0.4.48

Open FreeCAD, Create New, switch to A2Plus workbench, save as "assembly.FCStd".
Add hole.FXStd first, then pin.FCStd.
Select edge on hole, STRG + select edge on pin (see screenshot)
Image

Click "Add an axisCoincidence constraint"
An error is shown in the console:
------------------------------------------------------------------------
Running the Python command 'a2p_AxialConstraintCommand' failed:
Traceback (most recent call last):
File "/home/andy/.FreeCAD/Mod/A2plus/a2p_constraintcommands.py", line 167, in Activated
c = a2p_constraints.AxialConstraint(selection)
File "/home/andy/.FreeCAD/Mod/A2plus/a2p_constraints.py", line 386, in __init__
self.create(selection)
File "/home/andy/.FreeCAD/Mod/A2plus/a2p_constraints.py", line 104, in create
self.calcInitialValues() #override in subclass !
File "/home/andy/.FreeCAD/Mod/A2plus/a2p_constraints.py", line 391, in calcInitialValues
axis2 = getAxis(self.ob2, c.SubElement2)
File "/home/andy/.FreeCAD/Mod/A2plus/a2plib.py", line 988, in getAxis
axis = a.Axis

name 'a' is not defined
------------------------------------------------------------------------

The pin is originally part of bigger STEP created by "PDElib Version 3.2.7"
and I'm unsure if I'm allowed to upload the whole STEP file due to copyright restrictions.

It looks for me like the code at a2plib.py:988 is trying to find the axis for an edge made out of multiple arcs but failed.

This also happens if the pin is converted to a "A2plus part" and also if I do not select the edge but the face on both sides.

-- Andy
Attachments
assembly.FCStd
(6.7 KiB) Downloaded 9 times
hole.FCStd
(10.41 KiB) Downloaded 8 times
pin.FCStd
(4.63 KiB) Downloaded 10 times
Last edited by andyandy on Mon Jan 25, 2021 6:36 am, edited 1 time in total.
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: A2plus error aligning pin to hole

Post by kbwbe »

andyandy wrote: Sat Jan 23, 2021 4:19 pm
Hi,
i could reproduce this error and fixed it. Please update to A2plus version V0.4.49
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
andyandy
Posts: 3
Joined: Sat Jan 23, 2021 11:39 am

Re: A2plus error aligning pin to hole

Post by andyandy »

Thank you for your fast response.
It works perfektly in V0.4.49

Thanks you, Andy
Post Reply