Personal Units

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
proghettolab
Posts: 52
Joined: Sat Jun 27, 2020 3:09 pm

Personal Units

Post by proghettolab »

Reading the wiki (https://wiki.freecadweb.org/Units#Unit_dictionary) I found this:
Unit dictionary
All the units available in FreeCAD, and new ones created by the user, should be stored in unit dictionary, which is an XML file (FreeCAD configuration file), so as to be retrieved when needed, i.e. when achieving unit scaling.
Where this XML is and how can I create my personal units?
Example:
In a spreadsheet I would multiply m^2 * euro/m^2 to get the value in euro.
Is it possible?

Thx in advice!
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Personal Units

Post by wandererfan »

proghettolab wrote: Fri Jun 03, 2022 5:19 pm Where this XML is and how can I create my personal units?
AFAIK, unit schemas are defined in c++ files such as src/Base/UnitsSchemaInternal.cpp. I don't know of a way to add a schema without c++ programming.
drmacro
Veteran
Posts: 8866
Joined: Sun Mar 02, 2014 4:35 pm

Re: Personal Units

Post by drmacro »

He is correct that the wiki discusses an xml file and makes no mention of where it lives.

Does the wiki need updating?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: Personal Units

Post by NewJoker »

It seems that this wiki page describes in detail some concept that could be implemented in the future, not an existing functionality:

proposal of an extension of the unit management system
It can be quite misleading and maybe it should be highlighted that this functionality is just an idea.
User avatar
onekk
Veteran
Posts: 6145
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Personal Units

Post by onekk »

NewJoker wrote: Sat Jun 04, 2022 7:34 am It seems that this wiki page describes in detail some concept that could be implemented in the future, not an existing functionality:

proposal of an extension of the unit management system
It can be quite misleading and maybe it should be highlighted that this functionality is just an idea.
Maybe changing the "rank" of the title making it clear that what follow is a "separate thing"?

But this is feasible in the wiki as it seem that is == Ttitle == there are a more higher "rank" in the Wiki?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Personal Units

Post by Roy_043 »

I have moved the proposal text to a separate page.
Unit_Management_System_Proposal

But since the proposal is quite old (ca. 2011) maybe we should just delete it?
drmacro
Veteran
Posts: 8866
Joined: Sun Mar 02, 2014 4:35 pm

Re: Personal Units

Post by drmacro »

Roy_043 wrote: Sat Jun 04, 2022 10:51 am I have moved the proposal text to a separate page.
Unit_Management_System_Proposal

But since the proposal is quite old (ca. 2011) maybe we should just delete it?
My vote would be to delete it?

Why have information that is clearly not current?

Is there any issue tracking that is relevant? Maybe the idea is defunct.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Personal Units

Post by Roy_043 »

OK. Deleted.
drmacro
Veteran
Posts: 8866
Joined: Sun Mar 02, 2014 4:35 pm

Re: Personal Units

Post by drmacro »

Roy_043 wrote: Sat Jun 04, 2022 2:07 pmOK. Deleted.
Ok, but...this didn't really address the OP's need for additional units. :roll:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Personal Units

Post by Roy_043 »

You can use such an expression as a workaround:
=1.23 / m ^ 2
Last edited by Roy_043 on Sat Jun 04, 2022 4:39 pm, edited 1 time in total.
Post Reply