Problem with MeasurePoints contraint in Assembly3?

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mikecabq
Posts: 2
Joined: Wed Jan 11, 2023 10:45 pm

Problem with MeasurePoints contraint in Assembly3?

Post by mikecabq »

Greetings!

I've been working with FreeCAD for about two years now and I've done pretty well at finding solutions here for each problem I've encountered. I have to say, most solutions can be summed up by "take your time and be very meticulous about renaming elements and objects, examining constraints carefully, and following steps to fixes and work-arounds patiently and slowly. Sometimes it takes rewording the problem in the search bar to find the solution.

That being said, I've finally come across something that I have not found any discussion for. Of course, I'd be very pleased if someone can point me to any discussions I've missed.

The problem seems to be in using the MeasurePoints constraint in Assembly3. I first came across it in a rather complicated design project, and not wanting to overload everyone, I checked it out in a very basic context. That is the file attached.

Here's the About info:

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31391 (Git)
Build type: Release
Branch: master
Hash: 0ab2608a429f3a5ee9a63da9b66d13557655d7e4
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly3 0.11.4
  * Assembly4 0.12.5
  * boltsfc 2022.11.5
  * fasteners 0.4.53
  * FreeCAD_assembly3-master
  * TabBar 0.4.53
Here's the steps leading to the error:
1. Open a new file.
2. In Part Design WB create a Body and an object. I used Additive Primitive - Cube. Rename the Object and the Part. I colored it for convenience (red).
3. Add a second Additive Primitive - Cube, and color it a second color for convenience (blue).
4. Transform the second, blue Cube to the side.
5. In Assembly3 WB, add Assembly Objects. Put each cube's Body in its own Assembly. Rename everything. (I eliminated all spaces in names; that seemed to be a topic of discussion at one point.)
6. Each cube's Assembly was dropped in the Parts for the Main_Assembly. (I believe this is proper assembly hierarchy method?)
7. Anchor an element of one object with Locked constraint (bottom face of Red_cube).
8. In my original file, I'm wanting to set the length of a third pad part to equal the distance between these two cubes. I wanted this to be adjustable dynamically, as I worked through my design, not having to go back and measure and reset pad length each time I needed to change the distance between the cubes. It seemed that MeasurePoints could be the right tool for this. I was planning to refer to the Distance field of MeasurePoints constraint in the Length field of the pad. So, I select a point on each cube and hit the MeasurePoints button.
9. However, upon implementing MeasurePoints, before doing anything else, I get the following error messages in the Report view:
16:55:56 <Exception> Failed to convert to Quantity
in property binding 'Test_Boxes#Constraint.Label2'
16:55:56 Recompute failed! Please check report view.
I've looked at the Expression Engine field of the Problem_Constraint, and see that it includes .Label2 and .Distance properties.
As you can see, the .Label2 field appears to be empty. I've attempted to make sure there wasn't a hidden space, by clearing the Formula Editor.
I've looked at the associated Dependency Graph (see attached) which helps me deduce that .Label2 is expecting to get something from .Distance. But I don't know what. Every other usage of .Label2 seems to be simply a text field available for the user to add additional info/description of the object.
Is there perhaps a bug here? Is there a different field or property that is supposed to be referencing the .Distance field? Or perhaps nothing should be referencing it, in this initial implementation of the constraint, until the user inserts the reference into another property's field?
Note also that the related constraints, MeasurePointLine and MeasurePointPlane give the same error message.

Even if my methodology of trying to stretch an interposed pad between these two cubes is flawed, there seems to be something intrinsically wrong with MeasurePoints.
Naturally, I'm happy to be shown that I'm using the constraint incorrectly, or some other error in process or methodology.
And of course, I'm happy to help by answering questions and trying out tips and tricks and work-arounds.

I've been scratching my head trying to figure this out. Thanks in advance for your help.

Mike
Attachments
Test_Boxes.FCStd
(24.86 KiB) Downloaded 44 times
Text_Boxes screenshot.png
Text_Boxes screenshot.png (289.66 KiB) Viewed 949 times
Test_Boxes Dependency Graph.png
Test_Boxes Dependency Graph.png (184.59 KiB) Viewed 949 times
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Problem with MeasurePoints contraint in Assembly3?

Post by bambuko »

1 - This thread probably would be better in the assembly section of the forum? (or perhaps not? since my proposed solution has nothing to do with assembly 3 :mrgreen: )


2 - Have you tried using Dynamic Data workbench? (https://wiki.freecadweb.org/DynamicData_Workbench). Works great for me in such situations!

file attached below


Screenshot from 2023-01-12 10.50.14.jpeg
Screenshot from 2023-01-12 10.50.14.jpeg (53.72 KiB) Viewed 839 times
Screenshot from 2023-01-12 10.50.37.jpeg
Screenshot from 2023-01-12 10.50.37.jpeg (54.48 KiB) Viewed 839 times
Screenshot from 2023-01-12 10.51.22.jpeg
Screenshot from 2023-01-12 10.51.22.jpeg (69.29 KiB) Viewed 839 times
Screenshot from 2023-01-12 10.53.13.jpeg
Screenshot from 2023-01-12 10.53.13.jpeg (71.17 KiB) Viewed 839 times
Test_Boxes_ck.FCStd
(21.55 KiB) Downloaded 44 times
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
mikecabq
Posts: 2
Joined: Wed Jan 11, 2023 10:45 pm

Re: Problem with MeasurePoints contraint in Assembly3?

Post by mikecabq »

Thanks for the suggestion, bambuko.
I did not know about Dynamic Data WB. That does indeed look like it might help me with the over all design.
Of course, the challenge with MeasurePoints constraint in Assemby3 is still a question.
I do not know how to change sections/topics for an existing post. Or is that something only moderators/administrators can do?

Thanks!

Mike
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Problem with MeasurePoints contraint in Assembly3?

Post by bambuko »

I haven't used this particular constraint, so don't know :oops:
Don't worry about which section of the forum... (I think only mods can move) - just that I thought you might get more answers in assembly section?

perhaps try:
https://github.com/realthunder/FreeCAD_assembly3


Last bumped by mikecabq on Fri Jan 27, 2023 3:29 pm.
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
Post Reply