Bug? Can't mix sketch ref with spreadsheet alias?

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!
psommerfeld
Posts: 38
Joined: Fri Jul 08, 2022 2:11 pm

Bug? Can't mix sketch ref with spreadsheet alias?

Post by psommerfeld »

In attached project, I have a spreadsheet called "p" with one alias called "thickness", whose unit is in mm. I've labelled the radius of circle in the "master" as "dia". In "Sketch001" I create another circle and can set the expression for its radius as <<master>>.Constraints.dia, or as <<p>>.thickness, but I cannot set it as <<master>>.Constraints.dia - <<p>>.thickness, as I get the error shown in the pic. I can multiply these two references, which makes me think that FC thinks the p.thickness is unit-less when used with the labelled reference. A bug?
Attachments
testref.FCStd
(7.15 KiB) Downloaded 20 times
Screen Shot 2022-08-08 at 4.44.05 PM.png
Screen Shot 2022-08-08 at 4.44.05 PM.png (166.57 KiB) Viewed 776 times
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by chrisb »

Not sure if it is an error, but you can give the value from the spreadsheet a unit:

Code: Select all

<<master>>.Constraints.dia - <<p>>.thickness*1mm
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Shalmeneser »

Within a Formula editor :
* <<master>>.Constraints.dia -> 10 mm
* <<p>>.thickness -> 2
They have not the same unit, so a Unit mismatch occurs.

It seems that Unit in SpreadSheet is not used inside Formula editor.
Last edited by Shalmeneser on Tue Aug 09, 2022 12:31 am, edited 1 time in total.
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Shalmeneser »

Clicking in cell B1 in spreadsheet 'p' crashs FC in 0.21.29923. :evil:

Code: Select all

OS: Windows 10 Version 1809
Word size of FreeCAD: 64-bit
Version: 0.21.29923 (Git)
Build type: Release
Branch: master
Hash: 30cb46cc5f630c97311162413b68edcff95db481
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: French/France (fr_FR)
Installed mods: 
  * fasteners 0.3.50
  * fcgear 1.0.0
  * Manipulator 1.4.9
  * sheetmetal 0.2.53
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by chrisb »

Shalmeneser wrote: Tue Aug 09, 2022 12:26 am Clicking in cell B1 in spreadsheet 'p' crashs FC in 0.21.29923. :evil:
No problem here. Does it need a special procedure such as a certain other cell to be selected before?

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.29865 (Git)
Build type: Release
Branch: master
Hash: fb5c731847398c5bfbc37468ba851e70860a86d5
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * fasteners 0.3.51
  * sheetmetal 0.2.56
  * ExplodedAssembly
  * Curves 0.5.4
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Shalmeneser »

(in fact, today) Left-Clicking in cell B1 in spreadsheet 'p' freezes FC in 0.21.29923. (no problem in 0.21.29485)
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Syres »

Shalmeneser wrote: Tue Aug 09, 2022 9:49 am (in fact, today) Left-Clicking in cell B1 in spreadsheet 'p' freezes FC in 0.21.29923. (no problem in 0.21.29485)
I've got my eye on a commit that may have triggered this so I'll test backing it out and if so I'll raise it with the author.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Syres »

Actually I can't replicate this with either my self compiled build or the latest AppImage, I can left click, double-click and right click in any cell without a crash or freezing. I'll boot into Windows and see how the Conda build behaves there.

Code: Select all

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.29997 (Git) AppImage
Build type: Release
Branch: master
Hash: b52967d52ac46eff7c59e74d991f3f5b298944ef
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * fasteners 0.3.50
  * Silk 1.0.0
  * Plot 2022.4.17
  * CfdOF 1.16.1
  * BIM 2021.12.0
  * FeedsAndSpeeds 0.4.0
  * dodo
  * Curves 0.5.4
  * Manipulator 1.4.9
  * fcgear 1.0.0
  * ThreadProfile 1.82.0
  * A2plus 0.4.56a
  * sheetmetal 0.2.56

Code: Select all

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.30019 (Git)
Build type: Release
Branch: master
Hash: a32e92722700c8584d74e3fe3e4823fbbabba9bc
Python 3.6.9, Qt 5.9.5, Coin 4.0.0a, Vtk 7.1.1, OCC 7.3.0
Locale: English/UnitedKingdom (en_GB)
Installed mods: 
  * fasteners 0.3.50
  * Silk 1.0.0
  * Plot 2022.4.17
  * CfdOF 1.16.1
  * BIM 2021.12.0
  * FeedsAndSpeeds 0.4.0
  * dodo
  * Curves 0.5.4
  * Manipulator 1.4.9
  * fcgear 1.0.0
  * ThreadProfile 1.82.0
  * A2plus 0.4.56a
  * sheetmetal 0.2.56
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Shalmeneser »

Thank you.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Bug? Can't mix sketch ref with spreadsheet alias?

Post by Syres »

@Shalmeneser, it looks to me as though this maybe specific to your config files, all OK using the latest Windows Conda build.

@psommerfeld, I'll be honest I'll have to read the Wiki to see whether there's something wrong with the documentation but, from my point of view it's simply the way you have entered the data into the cell. I can fully understand why you've put a number 2 in the Content and then added mm to the Display Unit. The Display Unit should be empty and the dimension entered in the cell as =2mm. This then allows the two sides of the subtraction to be in the same units.

UnitEntryinSS.jpg
UnitEntryinSS.jpg (44.14 KiB) Viewed 437 times

My understanding has always been that the Display Unit was for things such as Bags, Barrels or Pallets, something that FreeCAD does not have in it's core Units handling (and there is a lot in it's core units when you consider all the Power, Temperature Expansion, Density of materials, I could go on :D ).

Code: Select all

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.21.29997 (Git)
Build type: Release
Branch: master
Hash: b52967d52ac46eff7c59e74d991f3f5b298944ef
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.56a
  * Assembly3 0.11.3
  * CfdOF 1.17.7
  * Curves 0.5.4
  * fasteners 0.3.51
  * fcgear 1.0.0
  * freecad.xray 2022.4.17
  * Manipulator 1.4.9
  * Plot 2022.4.17
  * sheetmetal 0.2.56
  * Silk 1.0.0
Edit: The Wiki corrected part of my understanding.
Last edited by Syres on Tue Aug 09, 2022 11:38 am, edited 1 time in total.
Post Reply