Using VCB Calc

VCB Calc Home    Download VCB Calc    Contact Us

Basic Usage

With the VCB Calc tool activated, typing   1*2/4 =   in the VCB (Measurements Box) and hitting Return yields the Result  0.5  in the VCB and   1 * 2 / 4 = 0.5   on the status line.  More examples appear below.

As with simple calculators, the expressions you enter must alternate number, operator, number, operator, etc.  The calculator uses the VCB label to prompt for what it expects next (Number or Operator).

When entering numbers or operators in the VCB, they may be entered one at a time (i.e. type a number, hit Return, type an operator, hit Return, etc.) or an appropriate alternating sequence of numbers and operators may be entered all at once.

Expressions may NOT include parentheses, braces, brackets, and the like.

The valid operators are addition (+), subtraction (-), multiplication (*), division (/) and exponentiation (^).

An expression is displayed (and updated) on the status line as it is entered. The current value of the expression is also displayed on the status line in square brackets.  For example, after  1*2   is entered, the status line displays 1 * 2    [ = 2 ]

Entering an equal sign (=) as an operator signals the end of an expression and causes the Result to be displayed in the VCB.  Alternatively, just hitting Return (Enter) when the calculator is prompting for an Operator is interpreted as entering an equal sign.

Hitting ESC clears the calculator either in mid-expression or after an expression has ended.

After a Result has been obtained, entering a new expression starting with a number causes the calculator to clear itself prior to processing the new expression.

[New in version 1.1]  On the other hand, after a Result has been obtained, entering a new expression starting with an operator causes the calculator to apply the new expression to the Result - effectively continuing the previous calculation.

Undo, prior to ending an expression, removes the last entered operator or number from an expression.  Multiple undos are accepted.  There is no Redo.

The calculator only accepts decimal number inputs (e.g. 5/32 is not considered a number).  A decimal separator ( . or , ) must be entered only when necessary to define the value.  Numbers must, however, begin with a digit.  For example, the entry .25 will not be accepted; it must be entered as 0.25

Units of Measure

Entered numbers may be unitless or have length units (e.g. 1.5m), area units (e.g. 3'2) or volume units (e.g. 2m3).  A number entered (or a result displayed) without explicit units is unitless.  A number entered without units does NOT default to a length.  A unit of measure must be a standard SketchUp unit ( ", ', mm, cm, m ) followed immediately by an optional exponent (> 0).

Different units of measure may be mixed in an expression provided that the different units are commensurate for the specified mathematical operation.  For example, entering  3" * 2 / 25.4mm =  gives the result 6.  Entering  10"2 + 5"  gives rise to an error because area and length are not commensurate.

Entering an equal sign followed by a unit of measure signals the end of the  expression and instructs the calculator to convert the Result to the specified unit of measure.  For example, entering  1 * 2 = mm  produces the Result  2mm.

When the calculator is expecting a number in an expression, clicking on an edge, curve or face in a SketchUp model enters the length of the edge (or curve) or the area of the face.  Clicking on a model element is equivalent to typing a number AND hitting Return.

User entries and computed results are displayed in the Ruby Console enabling it to serve as a virtual paper tape.  Writing to the Ruby Console will be suppressed when the user preference "Paper Tape" is set to false.  See information on setting user preferences below.

Simple Examples

With Length Units on Model Info set to decimal inches with 0.0000" precision...

Entry (in sequence)   VCB After Entry   Status Line After Entry

3" * 2 / 25.4mm =    Return

                               6                        3 in * 2 / 25.4 mm = 6

10m+5cm='    Return

                               32.9724'             10 m + 5 cm   =  32.9724 ft 

50"2 / 10" =    Return

                                5"                       50 in2 / 10 in = 5 in

3+4     Return

                                                          3 + 4    [ = 7 ]


                                 7                        3 + 4  = 7    ESC to clear.

-3=m    Return

                                 4 m                     7 - 3  = 4 m    [ = 157.4803 in ]

Precision and Display

All computations are done in standard floating point arithmetic.  INTERNALLY, the value of an entered number, variable or calculated result is its floating point value.  

Values (entered or computed) are DISPLAYED on the status line with the precision specified on the Units tab of the Model Info window.  Further, the status line display conforms, to the extent possible, with the format setting on the Units tab.  Otherwise, units of measure are DISPLAYED on the status line in a consistent format unique to VCB Calc.

If you make changes to the precision or format options on the Units tab of Model Info, be sure to Clear the calculator to allow the format changes to take effect.

Calculated results displayed in the VCB or in the Ruby Console are always in decimals and use standard SketchUp units of measure (for lengths) so that these values may be copied and pasted into other SketchUp tools.

Calculated results are always displayed with maximum precision in the Ruby Console.  A VCB Result is displayed either in the precision specified on the Units tab or with four digits to the right of the decimal whichever is greater.

A VCB Result value will also display maximum precision when the user preference "VCB Precise" is true.  The default for VCB Precise is false.

Variables (Named Memory)

Because of differences in the way keyboard shortcuts are handled by SketchUp on PC's and Mac's, the use of variables is, for all practical purposes, a Mac-only feature.

Computed results may be saved in variables (named memories) by entering a name after the equal sign.  For example, entering  3/4=x  will compute the Result   0.75  and store it in the variable named "x".  Note that the equal sign is required for a Result to be saved in a variable.

Variables which have defined values may appear in subsequent expressions.  For example,  2*x=b .  Expressions such as   x * 3 = x  may also be entered to update the value of a variable.

Variables retain their current values when the calculator is cleared and when the tool is deactivated.

In addition to setting the value of a variable by entering its name after an equal sign, a unit of measure for the variable may be prescribed by entering a unit identifier following the variable name. For example, entering   1cm=x mm yields the Result   10mm   stored in "x".  When a unit of measure is also prescribed for a variable, a space MUST appear between the variable name and the unit of measure.

Variable names must begin with a letter, and comprise only letters, numbers and underscores (_).  The calculator ignores the case of what you enter and stores variable names internally in lower-case.  Entering "X" is therefore the same as entering "x".  The names "pi" (or "PI") and "e" (or "E") are reserved for the corresponding mathematical constants.  Similarly, variable names which look like units of measure (e.g. mm2, cm3, ft, etc.) should not be used to avoid confusion.

CAUTION:  Creating and using named variables may conflict with SketchUp's handling of keyboard shortcuts.  For example, if "s" is the shortcut for the SketchUp Scale tool, SketchUp will intercept an "s" that a user is trying to use as a variable name.  In that event, SketchUp deactivates the VCB Calc tool in favor of the Scale tool.  This may also happen when a user erroneously attempts to enter a shortcut letter as the first character of an Operator.

To avoid this conflict, two work arounds are available on a Mac.

  • Click in the VCB prior to entering the first letter of the first variable name.
  • Hold down the shift key while entering the variable name.
  • Precede the first letter of the first variable name in the expression with a a digit.  For example, "1s0" is recognized on a Mac as the variable "s0".

When VCB Calc is prompting for a Number to be entered in the VCB, typing a question mark ( ? ) - assuming ? is not a shortcut - will bring up a message box that displays all variable names that have been defined and their current values. The calculator clears itself after the message box is dismissed.  

With version 8.0.4810, preceding a variable name with a space or underscore no longer avoids SketchUp intercepting a shortcut on a Mac.

Reserved Words

The following are reserved words and cannot be used as variable names.  

  "e" - reserved for the mathematical constant e - displayed as "E"

  "g" - reserved for the golden ratio 1/2 * ( 1 + sqrt( 5 ) ) - displayed as "G" [new in version 1.1]

  "pi" - reserved for the mathematical constant Pi - displayed as "PI"

The work arounds mentioned above may need to be employed when entering these constants.

Examples Involving Variables

With Length Units on Model Info set to decimal inches with 0.0000" precision...

Entry (in sequence)   VCB After Entry   Status Line After Entry

22/7 Return

                                                        22 / 7    [ = 3.1429 ]

=x Return

                               3.1429                22 / 7 = 3.1429 -> x

3=b Return

                               3                       3 = 3 -> b  

+x= Return

                               6.1429                 b + x = 6.1429                      

_pi/2= Return

                               1.5708                 PI / 2 = 1.5708   

1"=y mm Return

                               25.4mm               1 in = 25.4 mm -> y   [ = 1 in ] 

Setting User Preferences

When VCB Calc is prompting for a Number to be entered in the VCB, typing an exclamation point ( ! ) - assuming ! is not a shortcut - will bring up a dialog that can be used to set all preferences.  The calculator clears itself after the dialog is dismissed.  On a Mac, typing " !", "_!", or "1!" is necessary if ! is a shortcut (and assuming the space, digit and underscore have not been assigned as shortcuts).

The current preferences are:

Paper Tape

Default value is true.  When true, all inputs and outputs are logged to the Ruby Console.

VCB Precise

Default value is false.  When false, computed Result values are displayed in the VCB with the precision specified on the Units tab of the Model Info window or with up to 3 digits to the right of the decimal whichever is greater.   When true, computed Result values are displayed in the VCB with all available precision.   For example, 22/7= might yield the Result 3.1429 when VCB Precise is false or 3.14285714285714 when VCB Precise is true.  Result values are always displayed with maximum precision in the Ruby Console.