VB Script - getting started

VB Script - Getting Started

What can I do with VB Scripting?

CMM-Manager VB Scripts run in line with program execution and can be used to perform loops and flow control, display custom messages, prompt user for input that then influences program execution - i.e. skip section of a programadjust location of measurement operation, perform calculations for report output, dynamically rename features during program running, or adjust nominal, tolerance, etc. for report output.  It's also possible to interact with applications or files outside of CMM-Manager, for example read the contents of a text file or Excel worksheet and use values to adjust current program execution.

The CMM-Manager VB Scripting engine is based on Windows VBScript Active Scripting Language.  All standard VBScript functions, commands, etc. are available inside of CMM-Manager, as well as some application specific commands used to extract Feature, Report and Machine variables into the currently running VB Script.  For example, you can set a variable from actual Feature data as follows:
  1. MyDia = GetFeaturePropertyAct("CIRCLE1", 7)
Or from Report data like this:
  1. MyDia = GetReportInfo("CIRCLE1", "DIA", 2)

VB Variables can then be introduced back into measured features, report characteristics, feature names, report header data, etc. using the Set Variables button as shown below:




User Guide

The CMM-Manager specific VB Script user guide is found here - C:\Program Files\QxSoft\CMM-Manager xxxx\Help\User Guide - VB Script.pdf - on any PC with CMM-Manager installed.  See latest version of this file attached to KB article below.

Online Resources

VBScript Functions (w3schools.com)
VBScript Keywords (w3schools.com)
ASP Tutorial (w3schools.com) - Note - these examples are specific to Web / ASP but still applicable to CMM-Manager VB Scripting engine.