Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline gurney  
#1 Posted : 22 March 2019 06:54:47(UTC)
gurney

Rank: Newbie

Groups: Registered
Joined: 22/04/2010(UTC)
Posts: 4
Location: canada

I want to add custom units to the .xml file, but I can't find the schema that explains to me what the id="#" # references to.
I want to add custom units, in this case US Oil Barrels (volume).

<property dimension="289">
<add factor="1" exp="-3" system="Metric" id="337">
<synonym name="L" lang:rus="л" lang:ger="l" />

<extension for="L" lang:rus="л" lang:ger="l">
<prefix name="m" id="338" />
</extension>
</add>

<add factor="3.7854119678" exp="-3" system="Metric" id="339">
<synonym name="gal" lang:rus="гал" />
</add>

<add factor="6.28981" exp="0" system="Metric" id="#">
<synonym name="bbl" lang:rus="" />
</add>
</property>
Offline Kenny Lemens  
#2 Posted : 02 March 2023 21:20:01(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 137
Man
United States
Location: Wisconsin

Was thanked: 66 time(s) in 42 post(s)
Greetings,

Through Successive Iterations, I was able to determine the following:

o The 「id」 field correlates to the Language file; id=”635” is the 635th entry, which is the word: ‘per mille’ ( 「C:\Program Files (x86)\SMath Studio\lang\Text_ENG.lang」 )


With that being said, I am unaware of how to 'add' or 'redefine' a given Entry within the Text_ENG.lang file; you can find the word/phrase that best matches your custom unit, just be advised that you cannot define more than (1) unit the same id (SMath will not even attempt to open unless you have a valid Units.xml file (i.e., if you define an ID to a Unit and SMath opens: you configured it correctly!)).

Please note: you do not need to define an 「id」 field; the 「title」 field can be used instead (See below for title/lang syntax as an alternative to id):
Code:
<add factor="9.80665" exp="-3" system="All" title="Gram-force" lang:rus="Грамм-сила">
   <synonym name="gf" lang:rus="гс" />
</add>


Therefore, your 'new unit' can be inserted as follows:
Code:
<add factor="6.28981" system="Metric" title="US Oil Barrels">
   <synonym name="bbl" />
</add>


May this be of help to the next person;
-Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
thanks 1 user thanked Kenny Lemens for this useful post.
on 03/03/2023(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.