Hi, @brian@pascal
I just downloaded the V7 wip and I find this old bug is present in the latest v7 wip.
My vb unit conversion scripts do not work in the latest V7 wip. The vb scripts are present in the link attached here to an older thread topic where this occurred as a bug in V6. This has since been fixed for V6 but now I find them broken in the V7 wip.
Hi Brian @brian,
I spoke too soon without proper testing in V6. The scripts are broken there too so now it’s both in the V7 wip and in the latest V6 service patch.
Hope you can fix this for the next sr of V6 as I use those scripts quite often checking when doing meter units. Now I’m working or transferring files to metric and I need those scripts to work since they give me quicker design feedback than changing the unit options in the distance commands etc. These allow me to work in two unit systems easily.
Thanks for your help,
RM
_NoEcho -RunScript (
modes = Array("Decimal", "Fractional", "Feet & Inches")
new_mode = -1
text = Rhino.ListBox(modes, "Select distance display mode:", "Distance Display")
If text = "Decimal" Then
new_mode = 0
ElseIf text = "Fractional" Then
new_mode = 1
ElseIf text = "Feet & Inches" Then
new_mode = 2
End If
If new_mode > -1 Then
old_mode = Rhino.UnitDistanceDisplayMode(new_mode, True)
Call Rhino.Command("_Distance")
Call Rhino.UnitDistanceDisplayMode(old_mode, True)
End If
)
Hi Dale,
It’s not working in the latest sr 26 of Rhino 6 so your corrections also don’t work unfortunately and are not the problem.
Open a Rhino template in millimeters,
Create a line
Run the script you posted or my old one,
Notice rhino doesn’t report or switch to any of the chosen units in the script, but ignores the script and reports in millimeters still.
Someone at McNeel keeps breaking this I notice camera units are not transferring correctly as well as you can see in another thread.
RM
I’m confused. Perhaps you can explain what the goal of the script is? If the goal is to have the output of the Distance command print using an alternate unit system, then your script won’t work. You see, your script isn’t changing the unit system. Rather, it is only changing the distance display mode of the current unit system. And, the feet & inches distance display mode requires that the document’s units system be set to either inches or feet.
Also, the Distance command in Rhino 6 and newer can already print the results in alternate units. So there isn’t any reason to toggle the document settings.
The goal of the script is to report in any imperial system or my custom units when I am in any other measurement system without having to use the command line distance settings. I want to leave the command line distance settings as they are so I can quickly compare measurements.
“You see, your script isn’t changing the unit system. Rather, it is only changing the distance display mode of the current unit system. And, the feet & inches distance display mode requires that the document’s units system be set to either inches or feet.”
Ok fair enough but previously you fixed/changed this for v6 where these scripts worked now it’s changed again.
“Also, the Distance command in Rhino 6 and newer can already print the results in alternate units. So there isn’t any reason to toggle the document settings.”
I prefer not to set units in the distance command it’s too many mouse clicks and worse I often to forget to set it back when I continue modeling. I prefer to use my scripts because they allow me to not ever have to reset back to metric at the command line for measuring. Using scripts I can have the best of both worlds I might check once in metric using the regular distance command than quickly check in imperial using my scripts and not have to set Rhino back to metric which I often forget to do. I do this to make sure of sizes when designing. I can also check in imperial and still see metric sizes at the read out and can do conversions of volumes and areas not just distance and have nifty dialog boxes that popup when I need them. Also I need this for my custom units which are Palladian Tuscan or cubits.
I looked at one of my really old scripts and it did change document properties and then went into the distance command then changed back to document units. I guess I will have to do a document conversion than a reset to previous doc units. But I would like to be able to convert between any of the 25 types and especially custom units (item 11).
If you could provide an example of how to list original document properties change those to another unit setting then reset them back would greatly appreciated. I find working with the scripts less error prone for me than constantly resetting or checking document units in any of the distance or reporting commands. I pretty much club these scripts together as I am not a programmer so please bear with my ineptitudes. I attached some of my olden scripts hope you can point me in a better direction with less verbosity.
I’ve attached a script that provided a dialog box front-end to the Distance command. The script lets you pick one of the supported unit systems and then script the command. Then, it resets the command back to it’s default model units.
Hi Dale, @dale
Thanks for that python script unfortunately I don’t know anything about python as you might notice I only know a bit about Vbscript. Could you provide a Vbscript example so I can apply and learn from that instead. I can’t learn another scripting language at this point in time.
Thanks for your help,
RM
You don’t need to know anything about Python to make use of the script. The script is more complex than needed - I roll my own dialog using Eto instead of using something built-in.
It’s possible to replicate this scripting using RhinoScirpt. Giving time, I’ll see if I can put together another sample.
Hi @dale
Nice work on that python script! I’m keeping that one on an icon in my analyze toolbox. I didn’t have a chance to run it until now I only looked at the code yesterday. I’m sure it will make a nice example for the python people to learn from too.
Looking forward to what ever you come up for the Vbscript example.
Thanks for your generous help,
RM