default units

default units - how to set default units - Messages

#1 Posted: 4/6/2018 12:04:43 PM
sarregouset

sarregouset

0 likes in 6 posts.

Group: User

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:

Show Spoiler


mod: code too long, moved under spoiler; code tags added.
#2 Posted: 4/6/2018 12:24:36 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 4/6/2018 12:32:24 PM
sarregouset

sarregouset

0 likes in 6 posts.

Group: User

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.
#4 Posted: 4/9/2018 10:46:23 AM
sarregouset

sarregouset

0 likes in 6 posts.

Group: User

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:

a:=1lbf
b:=1ft
a/b^2=1lbf/ft^2
a/b^2=70.7262lbf/ft^2inHg*psf
#5 Posted: 4/9/2018 12:29:49 PM
sarregouset

sarregouset

0 likes in 6 posts.

Group: User

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.
#6 Posted: 4/9/2018 1:32:01 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Posted: 4/9/2018 1:51:47 PM
sarregouset

sarregouset

0 likes in 6 posts.

Group: User

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.
#8 Posted: 8/22/2022 7:30:59 PM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

Greetings,

Wrote

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.
      <!-- 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 BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
#9 Posted: 8/23/2022 9:58:56 AM
sarregouset

sarregouset

0 likes in 6 posts.

Group: User

Thanks, but that doesn't help due to bug SS-2286 described above.
#10 Posted: 8/23/2022 10:16:19 AM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

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/forum/yaf_postsm79741_Usable-default-units-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.
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
  • New Posts New Posts
  • No New Posts No New Posts