View Issue Details

IDProjectCategoryView StatusLast Update
0002100Expressions[FreeCAD] Featurepublic2019-07-23 23:44
ReporterFreeCadderAssigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status feedbackResolutionopen 
Product Version[FreeCAD] 0.15 
Target VersionFixed in Version 
Summary0002100: Spreadsheet: Additional Inverse Display Units
DescriptionIt would be nice if in addition to "K^-1" there could be cell display units like "1/K" or "/K" or "K?¹", see code below.
Steps To ReproduceApp.newDocument("Unnamed")
App.setActiveDocument("Unnamed")
App.ActiveDocument=App.getDocument("Unnamed")
Gui.ActiveDocument=Gui.getDocument("Unnamed")

App.activeDocument().addObject('Spreadsheet::Sheet','Spreadsheet')
App.ActiveDocument.Spreadsheet.set('B1', 'Feature /K')
App.ActiveDocument.Spreadsheet.set('C1', 'Feature 1/K')
App.ActiveDocument.Spreadsheet.set('D1', 'Feature 1/°C')
App.ActiveDocument.Spreadsheet.set('E1', 'Feature 1/°F')
App.ActiveDocument.Spreadsheet.set('F1', 'Feature K?¹')
App.ActiveDocument.Spreadsheet.set('G1', 'Workaround K^-1')
App.ActiveDocument.Spreadsheet.set('A2', 'Linear Expansion Coefficient')
App.ActiveDocument.Spreadsheet.set('B2', '1.6e-4')
App.ActiveDocument.Spreadsheet.set('C2', '1.6e-4')
App.ActiveDocument.Spreadsheet.set('D2', '1.6e-4')
App.ActiveDocument.Spreadsheet.set('E2', '1.6e-4')
App.ActiveDocument.Spreadsheet.set('F2', '1.6e-4')
App.ActiveDocument.Spreadsheet.set('G2', '1.6e-4')
App.ActiveDocument.Spreadsheet.setDisplayUnit('B2', '/K')
App.ActiveDocument.Spreadsheet.setDisplayUnit('C2', '1/K')
App.ActiveDocument.Spreadsheet.setDisplayUnit('D2', '1/°F')
App.ActiveDocument.Spreadsheet.setDisplayUnit('E2', '1/°C')
App.ActiveDocument.Spreadsheet.setDisplayUnit('F2', 'K?¹')
App.ActiveDocument.Spreadsheet.setDisplayUnit('G2', 'K^-1')
App.ActiveDocument.Spreadsheet.setColumnWidth('A', 180)
App.ActiveDocument.Spreadsheet.setColumnWidth('G', 120)

App.ActiveDocument.recompute()
# Application->Unnamed->Spreadsheet: "Show spreadsheet"
Tags#post-to-forum, spreadsheet

Activities

FreeCadder

2015-05-14 05:39

reporter  

code-utf8.txt (Attachment missing)

FreeCadder

2015-05-14 05:40

reporter   ~0006131

'K?¹' = U+004B U+207B U+00B9

FreeCadder

2015-05-14 06:29

reporter   ~0006132

Last edited: 2015-05-14 06:44

View 2 revisions

# other useful workarounds
App.ActiveDocument.Spreadsheet.set('H1', 'Workaround m/m/K')
App.ActiveDocument.Spreadsheet.set('H2', '1.6e-4')
App.ActiveDocument.Spreadsheet.setDisplayUnit('H2', 'm/m/K')
App.ActiveDocument.Spreadsheet.set('I1', 'Workaround mm/m/K')
App.ActiveDocument.Spreadsheet.set('I2', '1.6e-4')
App.ActiveDocument.Spreadsheet.setDisplayUnit('I2', 'mm/m/K')
App.ActiveDocument.Spreadsheet.setColumnWidth('H', 130)
App.ActiveDocument.Spreadsheet.setColumnWidth('I', 130)
App.ActiveDocument.recompute()

# fails?
App.ActiveDocument.Spreadsheet.set('J1', 'Workaround µm/m/K')
App.ActiveDocument.Spreadsheet.set('J2', '1.6e-4')
App.ActiveDocument.Spreadsheet.setDisplayUnit('J2', 'µm/m/K') # U+00B5
App.ActiveDocument.Spreadsheet.setColumnWidth('J', 130)
App.ActiveDocument.recompute()

Kunda1

2017-02-10 11:29

administrator   ~0008263

Reminder sent to: eivindkvedalen

@eivindkvedalen would you kindly weigh in on this?

Kunda1

2017-07-17 11:21

administrator   ~0009766

@FreeCadder do you mind re-upping code-utf8.txt ?

Kunda1

2017-08-23 12:03

administrator   ~0009999

@FreeCadder do you mind re-upping code-utf8.txt ?

ulrich1a

2018-05-04 20:44

reporter   ~0011229

The unit Kelvin is available in FreeCAD.

The above code does not work anymore. The code
App.ActiveDocument.Spreadsheet.setDisplayUnit('B2', '/K')

gives: Failed to parse expression. So there is some improvement in FreeCAD to avoid false expectations.

What remains is the feature request for the addition of °C and °F to the quantity-framework.

Kunda1

2018-08-26 15:36

administrator   ~0011666

Last edited: 2018-08-26 15:37

View 2 revisions

ulrich1a wrote

What remains is the feature request for the addition of °C and °F to the quantity-framework.


@ulrich1a is there a feature request open for that yet ?

Kunda1

2019-07-23 23:44

administrator   ~0013379

@ulrich1a please respond

Also @eivindkvedalen care to weigh in ?

Issue History

Date Modified Username Field Change
2015-05-14 05:34 FreeCadder New Issue
2015-05-14 05:39 FreeCadder File Added: code-utf8.txt
2015-05-14 05:40 FreeCadder Note Added: 0006131
2015-05-14 06:29 FreeCadder Note Added: 0006132
2015-05-14 06:44 FreeCadder Note Edited: 0006132 View Revisions
2017-01-19 14:24 Kunda1 Tag Attached: spreadsheet
2017-02-10 11:29 Kunda1 Note Added: 0008263
2017-07-17 11:21 Kunda1 Note Added: 0009766
2017-07-17 11:21 Kunda1 Status new => feedback
2017-08-23 12:02 Kunda1 Tag Attached: #post-to-forum
2017-08-23 12:03 Kunda1 Note Added: 0009999
2017-12-13 15:27 Kunda1 Project FreeCAD => Expressions
2018-05-04 20:44 ulrich1a Note Added: 0011229
2018-08-26 15:36 Kunda1 Note Added: 0011666
2018-08-26 15:37 Kunda1 Note Edited: 0011666 View Revisions
2019-07-23 23:44 Kunda1 Note Added: 0013379