As a design-builder in the US using a European product, I need to be able to easily switch between metric (Format:Decimal, Length: Millimeters, Display Precision: 0 mm) and standard (Format: Architectural, Length: Inches, Display Precision: 1/16").
Is there anyone who could help me adapt the script by @McGordon to fit this purpose. I have tried using Matt’s Toggle Units plugin from this link but it doesn’t work for me (SU 2021 Pro, Mac). Any would be much appreciated and hopefully helpful to others. Thank you in advance. Also, please advise if its best to fork this thread or start a new one for this specific task.
Fantastic @dezmo ! I have loaded it succesfully in SU Pro 2021 for Mac and it works as a menu item excactly as I had hoped. Nice work.
For some reason I am not able to get it to work with keyboard shortcuts despite trying a couple of different ones. It just beeps.
@dezmo I love the simplicity of your solution! Is there any way you’d be open to editing the ruby script to switch between Architectural and Fractional? Aka 12’ 6 1/4" > 150 1/4". Or if I’m able to do that with some guidance in case I want to switch between different formats in the future? Thanks!
This is an independent version, you can install it beside the previous version, but perhaps better to remove the old… since the new heve the the functions of previous one.
You will get a toolbar and menu in Tools. (You can assign shortcuts too.)
@dezmo This is absolutely fantastic, thank you so much! The shortcuts don’t seem to work but the toolbar does the trick! I so appreciate you helping me out–and so quickly!!!
That is strange, I don’t know how it is in Mac but I just checked the shortcut assignments in two version of SU on Windows and its okay. (The recording is on SU 2017 make):
(You need to click on a screen to “refresh” the new unit settings)
The reason that shortcuts won’t work for your extension on a Mac is that you have the / character in various things that are taken as menu paths, e.g. 1/16 and A/F appear in several places. On a Mac, the / is the path separator used to look up the menu commands for shortcuts. Those slashes cause the path to lead to a non-existent menu item! Replace them in the code with, e.g., _ and shortcuts will work.
Edit: IMO, since these things are just Strings, this might be considered a bug - or at least a poor design that needs clear documentation!
I can confirm that this version works on my Mac, including all three ways to launch: menu, toolbar, and shortcuts. One thing to know, which is mentioned in the Ruby API documentation, is that for some longstanding reason, on Mac the validation procs aren’t called “as often as they should be”. This means that the button state on the toolbar isn’t usually correct though the buttons themselves work correctly.
There is another problem, at least on Mac. After a menu change, tool button change, or keyboard shortcut change, the viewport has to be refreshed to see the change of units.