Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline sarregouset  
#1 Posted : 06 April 2018 18:04:43(UTC)
sarregouset

Rank: Newbie

Groups: Registered
Joined: 06/04/2018(UTC)
Posts: 6
United States

Hi, I am trying to set the default units to Imperial (as required by my work) by changing the Units.xml file. However SMath crashes when I try to open it with the edited file in place. Can someone help identify my problem? My Units.xml file follows:


mod: code too long, moved under spoiler; code tags added.

Edited by moderator 06 April 2018 18:27:09(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 06 April 2018 18:24:36(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline sarregouset  
#3 Posted : 06 April 2018 18:32:24(UTC)
sarregouset

Rank: Newbie

Groups: Registered
Joined: 06/04/2018(UTC)
Posts: 6
United States

Thanks; that's better than nothing. It would still be nice to know how to set default units (in vs ft) via Units.xml if there is no other way.
Offline sarregouset  
#4 Posted : 09 April 2018 16:46:23(UTC)
sarregouset

Rank: Newbie

Groups: Registered
Joined: 06/04/2018(UTC)
Posts: 6
United States

Scratch that; it's worse than nothing. The OutputUnitsSystem=Imperial setting seems to break the unit-display override feature. With it set, I can no longer specify which derived unit I want the results displayed in - I have to use the default. For example:
Code:

a:=1lbf
b:=1ft
a/b^2=1lbf/ft^2
a/b^2=70.7262lbf/ft^2inHg*psf
Offline sarregouset  
#5 Posted : 09 April 2018 18:29:49(UTC)
sarregouset

Rank: Newbie

Groups: Registered
Joined: 06/04/2018(UTC)
Posts: 6
United States

The point is, if I use the setting Davide suggested (OutputUnitsSystem=Imperial), I canNOT "append the result with the appropriate unit", whereas with the =Metric setting I can. In other words, this Smath feature does not work. Thanks anyway.
Offline Davide Carpi  
#6 Posted : 09 April 2018 19:32:01(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: sarregouset Go to Quoted Post
Thanks; that's better than nothing. It would still be nice to know how to set default units (in vs ft) via Units.xml if there is no other way.

Yes, it is a known bug (SS-2286); as you can see from the post I've linked above, it should be considered an experimental feature (this is enforced by the fact that you have to edit the settings file to enable it).

Loalized default units are part of [SS-1], still opened.

I do not encourage to modify the unts.xml file except for hardcore users on portable executables, since the file it is overwritten on software installations and not linked within the worksheets, that it means you cannot read a worksheet as it was created unless you have the same units file.

Edited by user 09 April 2018 19:38:11(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline sarregouset  
#7 Posted : 09 April 2018 19:51:47(UTC)
sarregouset

Rank: Newbie

Groups: Registered
Joined: 06/04/2018(UTC)
Posts: 6
United States

Thanks for those details. I noticed it was overwritten but did not it was not linked within worksheets. Looks like I am stuck with Metric unless something happens on [SS-1]. Thanks for your time.
Offline Kenny Lemens  
#8 Posted : 23 August 2022 01:30:59(UTC)
Kenny Lemens


Rank: Advanced Member

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

Was thanked: 58 time(s) in 37 post(s)
Greetings,

Originally Posted by: sarregouset Go to Quoted Post
Thanks; that's better than nothing. It would still be nice to know how to set default units (in vs ft) via Units.xml if there is no other way.


If you are using (OutputUnitsSystem=Imperial); then there is a quick way to force 'inches' as the default unit.

- 1) Edit the Units.xml file
- 2) Locate the 'inches' factor
- 3) Edit the name: name="in" to name="ⅰn in"
- 4) Save & Close Units.xml

When you reopen Smath, you should note [ⅰn] as the preferred unit.

This works because [ⅰ] is a special character; it looks like an [i], but it sorts before [f]; thus it is your first to display.
Code:
      <!-- used [ⅰ] to sort in in front of other Imperial units (KML) 2022-08-19 -->
      <add factor="2.54" exp="-2" system="Imperial" id="309">
        <synonym name="ⅰn in" lang:rus="дюйм" lang:dan="tommer in" />
      </add>


A bit late, but I hope this helps 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
Offline sarregouset  
#9 Posted : 23 August 2022 15:58:56(UTC)
sarregouset

Rank: Newbie

Groups: Registered
Joined: 06/04/2018(UTC)
Posts: 6
United States

Thanks, but that doesn't help due to bug SS-2286 described above.
Offline Kenny Lemens  
#10 Posted : 23 August 2022 16:16:19(UTC)
Kenny Lemens


Rank: Advanced Member

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

Was thanked: 58 time(s) in 37 post(s)
Greetings,

I am still exploring the issues outlined in [SS-2286]; currently my fixes are:
-̶ ̶C̶r̶e̶a̶t̶e̶ ̶a̶n̶ ̶i̶m̶p̶e̶r̶i̶al̶ ̶u̶n̶i̶t̶ ̶f̶o̶r̶ ̶̶̶a̶c̶c̶e̶l̶e̶r̶a̶t̶i̶o̶n̶
-̶ ̶S̶u̶p̶p̶r̶e̶s̶s̶ ̶u̶n̶s̶u̶p̶p̶o̶r̶t̶e̶d̶ ̶u̶n̶i̶t̶s̶ ̶(̶e̶.̶g̶.̶,̶ ̶%̶ ̶̶a̶n̶d̶ ̶̶d̶e̶g̶r̶e̶̶e̶s̶)

- Redefine some constants in terms of imperial units ( i.e., g=32.2 ft/s² )
- Redefine some units in terms of imperial base units ( e.g., kip=1000lbf )
Far from a solution, but progress none-the-less.

I am currently trying to find a way to declare "Default Units" for system=Metric, but I haven't made much progress in that regard.

[EDIT] It is possible to edit the Units.xml file, so that the 'base units' are in terms of your desired 'default units'. An example to such a document is referenced in this post: https://en.smath.com/for...ts-for-US.aspx#post79741. There are a lot of rules to construct the Units.xml file correctly; no good way of summarizing the method to assign a custom unit as default.


-Kenny Lemens, P.E.

Edited by user 28 February 2023 22:07:27(UTC)  | Reason: Not specified

"No matter where you go, there you are." -Buckaroo Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
Users browsing this topic
Similar Topics
Usable default units for US (Feature Requests)
by Jason McCool 30/10/2022 18:05:38(UTC)
default units ? J to Nm (Questions)
by MaikTheBike 04/04/2020 23:00:37(UTC)
Default Units for Empirical Formulas (Questions)
by dlawrence529 28/03/2016 19:59:52(UTC)
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.