FreeCAD / FreeCAD/FreeCAD

Gui: Error with units using expressions

Open
#30,549 14 comments 2 reactions 1 assignee Claimed by @pieterhijma View on GitHub
Mod: Core Status: Confirmed Topic: Expressions
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 17h
Merged PRs (30d)
196

Description

### Problem description

When using a spreadsheet value in an expression, there is an error with units.

### Workbench affected?

None

### Steps to reproduce

- Create a new file
- Create a spreadsheet
- Add the value 10 in a cell and give it the alias "Length"
- Create a cube (Part workbench) and set the property Length to `Spreadsheet.Length`

### Expected behavior

This works without exceptions.

### Actual behavior

An exception is thrown:

```
11:16:25 pyException: Traceback (most recent call last):
File "", line 1, in
: Failed to parse expression 'Spreadsheet.Length mm'
```

### Development version About Info (in Safe Mode)

```shell
OS: Arch Linux (tty)
Architecture: x86_64
Version: 1.2.0dev.47083 (Git)
Build date: 2026/06/01 06:26:40
Build type: Debug
Branch: main
Hash: 68523793d1f8e3c1436ecbf72a7576cd735412e7
Python 3.14.4, Qt 6.11.0, Coin 4.0.8, Vtk 9.6.1, boost 1_91, Eigen3 5.0.1, PySide 6.11.0
shiboken 6.11.0, SMESH 7.7.1.0, xerces-c 3.3.0, Clipper2 , OCC 7.9.3
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Light/
Navigation Style/Orbit Style/Rotation Mode: CAD/Trackball/Drag at cursor
Logical DPI/Physical DPI/Pixel Ratio: 96/92.6073/1.33333
```

### Last known good version (optional)

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.