Spreadsheet and sketch parameters: incompatible units for + operator

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!
User avatar
Syranolic
Posts: 16
Joined: Wed Jul 20, 2016 3:32 pm
Location: Sweden
Contact:

Spreadsheet and sketch parameters: incompatible units for + operator

Post by Syranolic »

Hi,

I switched to FreeCAD 0.17 since it seemed easier to install than 0.16 on Linux:
OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8186 (Git)
Build type: None
Branch: master
Hash: 137c951e7b397edf369300f6214b1a820f45742b
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

And now I get this problem:
error
error
Screenshot from 2016-08-12 15-25-43.png (26.11 KiB) Viewed 5822 times
I think it worked in 0.16 but not always (after closing and opening the file again maybe), I'm not entirely sure. It might be a bug.
Here is what I did... I have a spreadsheet with a parameter in millimeter and and alias
spreadsheet units
spreadsheet units
Screenshot from 2016-08-12 15-27-08.png (47.79 KiB) Viewed 5822 times
spreadsheet alias
spreadsheet alias
Screenshot from 2016-08-12 15-27-37.png (15.39 KiB) Viewed 5822 times
I also have a reference constraint in a skecth:
sketch
sketch
Screenshot from 2016-08-12 15-28-49.png (33.78 KiB) Viewed 5822 times
I'm trying to place a parameterized point object like this
error
error
Screenshot from 2016-08-12 15-25-43.png (26.11 KiB) Viewed 5822 times
but the two parameters can't be added...
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by NormandC »

Syranolic wrote:I switched to FreeCAD 0.17 since it seemed easier to install than 0.16 on Linux:
OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Your assumption is totally wrong where Ubuntu is concerned. There are two PPA repositories, one for the "stable" release, the other for "daily builds". How could one be easier to install than the other?!?

0.17 brings huge changes in PartDesign, along with quite a crop of new bugs. Us regulars still have to get our bearings with this new version; most tutorials found on PartDesign are obsolete with 0.17. If you are a newcomer, you should stick to 0.16 unless you require specialized tools in the Path or FEM workbenches.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by ulrich1a »

There is one point to say. The FreeCAD spreadsheet is different to other spreadsheets. It is not enough to put mm in the displayed unit, to make it a value with the length property attached. You have to explicitly put in the value with the unit. Or if it is just a number coming from some calculation, then you have to multiply it with "1 mm".

Ulrich
User avatar
Syranolic
Posts: 16
Joined: Wed Jul 20, 2016 3:32 pm
Location: Sweden
Contact:

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by Syranolic »

Thanks, I'll just enter a value in the cell and then later multiply with 1mm. If I enter the value with a unit, it works well with sketch constraints. But the parameter can't be used in object properties, seemingly.

And I'm back to 0.16 now.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by eivindkvedalen »

Syranolic wrote:Thanks, I'll just enter a value in the cell and then later multiply with 1mm. If I enter the value with a unit, it works well with sketch constraints. But the parameter can't be used in object properties, seemingly.

And I'm back to 0.16 now.
If the object property expects the same unit, it should work. Do you have an example where this is not the case?

Eivind
User avatar
Syranolic
Posts: 16
Joined: Wed Jul 20, 2016 3:32 pm
Location: Sweden
Contact:

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by Syranolic »

Yes, I see that if the object property is normally displayed as "0,00 mm", for example, then it works.
But for the value of an offset, it doesn't. I don't many features, this is the only case I found...

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by eivindkvedalen »

Syranolic wrote:Yes, I see that if the object property is normally displayed as "0,00 mm", for example, then it works.
But for the value of an offset, it doesn't. I don't many features, this is the only case I found...
Ok, the offset value should then have units attached to it (at least) in the GUI. Could you please register this in the bug tracker?

Eivind
User avatar
Syranolic
Posts: 16
Joined: Wed Jul 20, 2016 3:32 pm
Location: Sweden
Contact:

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by Syranolic »

Done! The base vector of a mirror is also affected.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by ulrich1a »

It seems there are some comfort-functions at work, that can lead into a trap:
- Make a spreadsheet value in a cell with an alias but without a unit .
- Define a sketch length with this value. The length gets automatically a mm unit in the sketch. Give the constraint a name.
- Define a property that should be the sum of the spreadsheet-value and the sketch-value. This does not work as there are incompatible units.
- What does work, is giving a property either the spreadsheet-value or the sketch-value but not the sum.

In order to get the sum, the spreadsheet-value has to be multiplied with 1 mm.

The only thing I see at the moment, is to work on the documentation, that there may be some remaining values that are not tagged with the appropriate unit. Some examples are given already in the spreadsheet manual: The volume of a shape is not tagged with a unit.

Ulrich
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Spreadsheet and sketch parameters: incompatible units for + operator

Post by jmaustpc »

Syranolic wrote:Thanks, I'll just enter a value in the cell and then later multiply with 1mm. If I enter the value with a unit, it works well with sketch constraints. But the parameter can't be used in object properties, seemingly.

And I'm back to 0.16 now.
Just to be clear, in case you have not already worked this out, the two different PPA FreeCAD versions have been set up such that both FreeCADs can be installed at once on the same system. 0.16 package is named FreeCAD where as 0.17 is named "FreeCAD-Daily" or something like that. Your system can then have both FreeCAD versions and the system in effect just considers them as two different programs that can open the same file types. For example, similar to having Koffice and LibreOffice on the same system.
Post Reply