weird issue - dimension not updating from expression, no errors

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!
Post Reply
contemporiser
Posts: 2
Joined: Sun Feb 05, 2023 7:52 am

weird issue - dimension not updating from expression, no errors

Post by contemporiser »

Simple furniture design made of boxes,problematic element - FrontSink -

if I set it's height with integer, it updates properly.
if I set it's height with an expression, it calculates the height properly inside the expression dialog, but Height remains unchanged.

it throws no warnings in the report view and commands in the python console look normal

Code: Select all

>>> App.getDocument('law').Box064.setExpression('Height', u'550mm - 5mm')
submitting recompute object does nothing

Image

Code: Select all

OS: Linux Mint 20.3 (awesome)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
Attachments
law.FCStd
(93.77 KiB) Downloaded 12 times
freepoop.png
freepoop.png (27.59 KiB) Viewed 456 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: weird issue - dimension not updating from expression, no errors

Post by Roy_043 »

Recomputing the whole document fixes the issue here.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31709 (Git)
Build type: Release
Branch: master
Hash: e188802ca6997d2564e7570ab648462e6a059f87
Python 3.10.8, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Dutch/Netherlands (nl_NL)
Installed mods:
contemporiser
Posts: 2
Joined: Sun Feb 05, 2023 7:52 am

Re: weird issue - dimension not updating from expression, no errors

Post by contemporiser »

It does not work for me. Tried it. I just updated to the newest version, but the issue persists.

This is only one of several elements in my model that does it. I have simplified the model not to confuse everyone.

I see no pattern, in some cases it is position that doesn't update, in other a dimension.
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: weird issue - dimension not updating from expression, no errors

Post by dprojects »

contemporiser wrote: Sun Feb 05, 2023 8:26 am Simple furniture design made of boxes,problematic element - FrontSink -
I guess there is problem with Position.x expression, if you remove the expression it is working.
However, the expression Position.x looks correct, it is even recalculated during writing.
But looks like FreeCAD expression parser collapse on that...

EDIT: Try latest weekly build, there is no such issue at Version: 0.21.0.31772 (Git) AppImage


Image

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Jolbas
Posts: 327
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: weird issue - dimension not updating from expression, no errors

Post by Jolbas »

It's probably related to the issues in this thread which is partly fixed in 0.21. The Expression Engine sometimes can't find the correct evaluation order for sub-properties of placements and rotations.
Post Reply