View Issue Details

IDProjectCategoryView StatusLast Update
0003696ExpressionsGeneralpublic2021-02-06 06:30
ReporterTheRainHarvester Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformwinOS8.1OS Versionpro
Product Version0.18 
Target Version0.20 
Summary0003696: Constraints lose values upon reloading file.
DescriptionWhen you use the "formula button" when typing in a constraint, it works only if you don't reload the file! When reloading, the constraint reverts to the value that was saved. It doesn't follow the formula anymore, so if you change a parameter, the linked constraint does not get updated.
Steps To ReproduceOpen the attached file. Open the Sketcher window.
Notice the 44mm dimention to the VERY right. it has the label "Global".
Notice the 44 mm dimension next to it (just left). We'll call this "LinkedVersion". I saved it's formula's constraint as "Constraints.Global" but when you load the program, it gets set to the 44mm value.

You can repeat the bug by updating the "LinkedVersion" constraint by clicking the blue formula icon and typing "Constraints.Global".

Now change the "Global" value (the length constraint to the VERY right).
The "LinkedVersion" will update as it should.
Now save the file. Close. And reload the file.

Now change the "Global" value (the length constraint to the Very right).
Notice that the "LinkedVersion" will not get updated!!

This bug can hide itself and ruin CNC paths if one is not aware of the problem.
Additional InformationOS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15214 (Git)
Build type: Release
Branch: master
Hash: b3721f8613b975be13e1801f499fa06f6f0ad836
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
TagsNo tags attached.
FreeCAD Information

Activities

TheRainHarvester

2018-11-16 19:01

reporter  

abdullah

2018-11-16 19:09

manager   ~0012202

@Normandc
@Kunda1

Can somebody from the CAD experts check this case to confirm?

normandc

2018-11-17 16:40

manager   ~0012205

IMO this should have been discussed in the forum first before a report was created; just as is already explained in the GIGANTIC yellow banner at the top.

This file document has multiple user errors. One not pertaining to this issue is starting a sketch in a Body then going to Part to create an Extrude. This produces the following warning in the Report view after a recompute:

Part::Extrusion: Links go out of the allowed scope

One other thing hinting at an error is that at load time, the Report view prints the error "Failed to parse expression".

Notice the 44 mm dimension next to it (just left). We'll call this "LinkedVersion".

TheRainHarvester
It is NOT called "LinkedVersion" in your file, its label is "Edge Vert 1 of 2". I highly doubt that spaces are allowed in contraint names. When I try to refer through it in an expression, it fails with "Failed to parse expression".

This file is a very poor case for a bug, and should have been simplified to only contain the elements to reproduce the issue. The whole Path job is irrelevant here. BTW it is completely inefficient to create such a sketch with >225 constraints and repeated circles. Posting on the forum before creating this bug, you would have received this advice.

I recommend that the next steps should be for the reporter to:
  1. Register to the forum and create a topic to discuss the issue.
  2. Following discussion and insight from forum regulars, provide a streamlined FreeCAD document that follows recommended practice, uses proper labels and still reproduces the issue.

normandc

2018-11-17 16:41

manager   ~0012206

Last edited: 2018-11-17 16:42

As per comment above, please post on the forum for advice. There may be usage errors that are actually resulting in the issue.

abdullah

2018-11-17 19:46

manager   ~0012207

Thank you very much Normand. It saves me time when things are streamlined :)

TheRainHarvester

2018-11-26 15:20

reporter   ~0012224

I added a simple file and started a discussion at:
https://forum.freecadweb.org/viewtopic.php?f=8&t=32437

abdullah

2018-11-27 14:28

manager   ~0012226

Thank you everybody for taking the time to streamline this.

I have moved this ticket to "Expressions", as the problem lies in the Expression Engine. It is not specific to the Sketcher.

Almost 40 years after the boom of the personal computer, spaces keep being a problem...

Kunda1

2019-02-25 13:35

administrator   ~0012765

@eivindkvedalen care to take a look at this?

yorik

2022-03-03 13:55

administrator   ~0016672

This ticket has been migrated to GitHub as issue 5837.

Issue History

Date Modified Username Field Change
2018-11-16 19:01 TheRainHarvester New Issue
2018-11-16 19:01 TheRainHarvester File Added: BugLinkedConstraintsDontSurviveASave.FCStd
2018-11-16 19:08 abdullah Target Version => 0.19
2018-11-16 19:08 abdullah Steps to Reproduce Updated
2018-11-16 19:08 abdullah Additional Information Updated
2018-11-16 19:09 abdullah Note Added: 0012202
2018-11-17 16:40 normandc Note Added: 0012205
2018-11-17 16:41 normandc Status new => feedback
2018-11-17 16:41 normandc Note Added: 0012206
2018-11-17 16:42 normandc Note Edited: 0012206
2018-11-17 19:46 abdullah Note Added: 0012207
2018-11-26 15:20 TheRainHarvester Note Added: 0012224
2018-11-26 15:20 TheRainHarvester Status feedback => new
2018-11-27 14:23 abdullah Project Sketcher => Expressions
2018-11-27 14:23 abdullah Category Bug => General
2018-11-27 14:28 abdullah Note Added: 0012226
2019-02-25 13:35 Kunda1 Note Added: 0012765
2021-02-06 06:30 abdullah Target Version => 0.20