(2020-05-06, 5:32)Roland Melkert Wrote: It works for me, gives angle -53.13 same as with the first version of the script.
Did you use helper parts whom all use the same x coordinate, placing the whole thing on the yz plane.
Yes…didn't think of that, to be honest, but they happen to be correct. Don't remember for sure since I didn't save the test file, but trying it now works correctly.
Looks like it was the same group vs. submodel problem. I can recreate the problem by selecting just the first helper part, and the group; it calculates the angle using the two parts in the group as getRef(2) and getRef(3), ignoring the second helper part.
Easiest fix, obviously, is to use a helper part at the rotation center, since the hinge part unhelpfully has its origin elsewhere…