WISH: Evaluate Command-Line Math as a Calculator

Hey there, a fairly simple feature request that I think could save time for many users. I find myself keeping a calculator app (well a Python terminal to be exact…) open on my machine anytime I’m modeling. I find the built in calculators lacking for my use and a bit painful to use.

Since Rhino 6 has brought better math evaluation in command arguments it would be really awesome to have a way to use the command line as a calculator. Typing 2pi or =2pi in the command line and getting the answer would be awesome.

Side note, I’m curious what prompted the change of language of the evaluation from Python to what seems to be the VB evaluation? Rhino 5 manual, Rhino 6 manual. I personally prefer Python but having to put the parentheses in was annoying.

If anyone is interested in getting something similar to this function, I have this simple Python command. It just requires a few more steps…

import rhinoscriptsyntax as rs
__commandname__ = "Evaluate"

# RunCommand is the called when the user enters the command name in Rhino.
# The command name is defined by the filname minus "_cmd.py"
def RunCommand( is_interactive ):
  value = rs.GetReal("Enter Expression")
  print value
  return 0

Hello - thanks, added to the heap.

https://mcneel.myjetbrains.com/youtrack/issue/RH-50335

@Louis_Leblanc - there is a testEval command, it turns out, that does about what you ask. You can type Rhino.pi for pi, btw, pi itself is not recognized…

-Pascal

1 Like