Units on Expressions page not supported?

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
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Units on Expressions page not supported?

Post by Roy_043 »

I am trying out some of the units mentioned on the Expressions page in the Wiki.
Some of them are not recognized in a spreadsheet, f.e. ml and Hz.
Is the implementation incomplete or am I missing something.
User avatar
Shalmeneser
Veteran
Posts: 9558
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Units on Expressions page not supported?

Post by Shalmeneser »

Roy_043 wrote: Wed Oct 27, 2021 9:09 am ...

Code: Select all

OS: Linux Mint 20.2 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.26155 (Git) AppImage
Build type: Release
Branch: master
Hash: 0926a4148bcff11249fd4f56bc30256102ffe105
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: French/France (fr_FR)
Attachments
Capture du 2021-10-27 12-23-16.png
Capture du 2021-10-27 12-23-16.png (31.7 KiB) Viewed 453 times
Capture du 2021-10-27 12-23-47.png
Capture du 2021-10-27 12-23-47.png (38.37 KiB) Viewed 453 times
unit in spreadsheet.FCStd
(2.77 KiB) Downloaded 6 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Units on Expressions page not supported?

Post by TheMarkster »

I recall seeing a commit where some new units were added. Perhaps something additional needs to be done for them to work in spreadsheets. Or this might be unrelated.
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Units on Expressions page not supported?

Post by Roy_043 »

TheMarkster wrote: Wed Oct 27, 2021 7:44 pm Perhaps something additional needs to be done
Looking around in the code a bit I think (guess) that only the units in src/App/lex.ExpressionParser.c work. In other files more units are mentioned which may have confused the author of the Units paragraph.

@Shalmeneser Thanks for checking and the file. I'll use it when I clean up the Wiki page.
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Units on Expressions page not supported?

Post by Roy_043 »

Some things are strange about the available units:

Recognized:
A (Ampere)
VA (VoltAmpere)
VAs (VoltAmpereSecond = Joule)

Not recognized:
V (Volt)
Post Reply