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
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Ticket #3379 - [Expressions] Cannot reference driven constraint

Post by chrisb »

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 2567 times
expressionDriven.FCStd
(6.58 KiB) Downloaded 48 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
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Cannot reference driven constraint

Post by sgrogan »

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?
"fight the good fight"
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference driven constraint

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Willem
Veteran
Posts: 1852
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Cannot reference driven constraint

Post by Willem »

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
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference driven constraint

Post by chrisb »

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?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Willem
Veteran
Posts: 1852
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Cannot reference driven constraint

Post by Willem »

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
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference driven constraint

Post by chrisb »

eivindkvedalen wrote: Eivind
Care to weigh in?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Cannot reference driven constraint

Post by eivindkvedalen »

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
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Cannot reference driven constraint

Post by NormandC »

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
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Cannot reference driven constraint

Post by GeneFC »

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
Post Reply