Ticket #3379 - [Expressions] Cannot reference driven constraint

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!
chrisb
Posts: 17515
Joined: Tue Mar 17, 2015 9:14 am

Ticket #3379 - [Expressions] Cannot reference driven constraint

Postby chrisb » Tue Mar 13, 2018 10:12 pm

In the attached model I have a sketch with a normal (driving, red) and a driven constraint (blue).
I can use the normal constrant in subsequent steps within Expressions but not the driven. I am pretty sure that this worked before.
I am aware that it does not work within the same sketch to reference the driven constraints.
Attachments
Bildschirmfoto 2018-03-13 um 23.06.36.png
Bildschirmfoto 2018-03-13 um 23.06.36.png (18.97 KiB) Viewed 805 times
expressionDriven.FCStd
(6.58 KiB) Downloaded 13 times
Last edited by Kunda1 on Wed Jun 19, 2019 8:30 pm, edited 1 time in total.
Reason: Updated thread title with ticket number
User avatar
sgrogan
Posts: 5241
Joined: Wed Oct 22, 2014 5:02 pm

Re: Cannot reference driven constraint

Postby sgrogan » Tue Mar 13, 2018 10:19 pm

chrisb wrote:
Tue Mar 13, 2018 10:12 pm
I am aware that it does not work within the same sketch to reference the driven constraints.
Are you setting up a circular dependency elsewhere?
chrisb
Posts: 17515
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference driven constraint

Postby chrisb » Tue Mar 13, 2018 10:26 pm

sgrogan wrote:
Tue Mar 13, 2018 10:19 pm
Are you setting up a circular dependency elsewhere?
No, and the model is simple enough to be very sure.
I found that the problem is the name of the constraint. If I name it "y" instead of "h" it works as expected.
User avatar
Willem
Posts: 1251
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Cannot reference driven constraint

Postby Willem » Tue Mar 13, 2018 10:37 pm

I can confirm the problem. In other sketches you can not reference to the construction dimension.
The message appears: Failes to parse expression

My system
OS: Ubuntu 16.04.4 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13387 (Git)
Build type: None
Branch: master
Hash: c5f4079252b11e3c54cd603be7d3697fa9f9d922
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Dutch/Netherlands (nl_NL)
chrisb
Posts: 17515
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference driven constraint

Postby chrisb » Tue Mar 13, 2018 10:42 pm

Willem wrote:
Tue Mar 13, 2018 10:37 pm
I can confirm the problem. In other sketches you can not reference to the construction dimension.
The message appears: Failes to parse expression
Does my example work on your system if you rename "h" to "y"? Can you reference that like I can?
User avatar
Willem
Posts: 1251
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Cannot reference driven constraint

Postby Willem » Tue Mar 13, 2018 11:17 pm

Hi, I can confirm this issue. Renaming from "h" to "y" makes the expression valid. Renaming to "rad" makes the expression also invalid. Perhaps there are more values to be found for making the expression invalid. Is this a bug?
chrisb
Posts: 17515
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference driven constraint

Postby chrisb » Wed Mar 14, 2018 12:25 am

eivindkvedalen wrote: Eivind
Care to weigh in?
eivindkvedalen
Posts: 597
Joined: Tue Jan 29, 2013 10:35 pm

Re: Cannot reference driven constraint

Postby eivindkvedalen » Fri Mar 16, 2018 1:12 pm

chrisb wrote:
Wed Mar 14, 2018 12:25 am
eivindkvedalen wrote: Eivind
Care to weigh in?
Hi,

Both h and rad are reserved, as they are also units (h = hour, rad = radians). Even if they are unambiguous when used as a name (like Contraints.h), the parser does not understand that, as it parses word by word, and h and rad are immediately identified as units.

Eivind
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Cannot reference driven constraint

Postby NormandC » Fri Mar 16, 2018 4:47 pm

chrisb wrote:
Tue Mar 13, 2018 10:12 pm
a driven constraint
This is a contradiction in terms. If it is driven, it cannot be a constraint.
GeneFC
Posts: 1025
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Cannot reference driven constraint

Postby GeneFC » Fri Mar 16, 2018 5:13 pm

The official term, as shown in the tool tip, is "reference constraint." Of course it is really a "driven dimension" or a "reference dimension."

Gene