PC Dmis Basic PDF
PC Dmis Basic PDF
Language Reference
Contents
Basic Script Editor
11
Introduction................................................................................................................... ...........11
File Menu ...................................................................................................................... ...........11
New............................................................................................................................ 11
Open...........................................................................................................................11
Save............................................................................................................................11
Save As ......................................................................................................................12
Print ...........................................................................................................................12
Print Preview..............................................................................................................12
Exit.............................................................................................................................12
Edit Menu.................................................................................................................................12
Undo ..........................................................................................................................12
Cut..............................................................................................................................12
Copy...........................................................................................................................12
Paste...........................................................................................................................12
Delete.........................................................................................................................12
Select All ...................................................................................................................13
Find ............................................................................................................................13
Find Next ...................................................................................................................13
Replace ......................................................................................................................13
View.........................................................................................................................................14
Run...........................................................................................................................................14
Help..........................................................................................................................................14
Basic Help..................................................................................................................14
Syntax Help ...............................................................................................................14
Syntax Help File ........................................................................................................15
Basic Script Toolbar.................................................................................................................15
New............................................................................................................................15
Open...........................................................................................................................15
Save............................................................................................................................15
Print ...........................................................................................................................15
Print Preview..............................................................................................................15
Find ............................................................................................................................15
Cut..............................................................................................................................16
Copy...........................................................................................................................16
Paste...........................................................................................................................16
Undo ..........................................................................................................................16
Start............................................................................................................................16
Pause ..........................................................................................................................16
Stop ............................................................................................................................16
Set Breakpoint............................................................................................................16
Quick Watch ..............................................................................................................17
Step Into.....................................................................................................................17
Step Over ...................................................................................................................17
Contents i
19
Comments ............................................................................................................................... 19
Statements:................................................................................................................ 19
Line Continuation Character:.................................................................................... 20
Numbers .................................................................................................................................. 20
Variable and Constant Names ................................................................................................. 20
Variable Types ........................................................................................................................ 20
Variant ...................................................................................................................... 20
Variants and Concatenation ...................................................................................... 21
Other Data Types .................................................................................................................... 21
Data Types ................................................................................................................ 21
Scope of Variables .................................................................................................... 22
Declaration of Variables ........................................................................................... 22
Control Structures ................................................................................................................... 22
Loop Structures......................................................................................................... 22
Subroutines and Functions ...................................................................................................... 24
ByRef and ByVal .................................................................................................................... 25
Scalar Variables ........................................................................................................ 25
Passing User Defined Types by Ref to DLLs and Enable functions ....................... 26
Calling Procedures in DLLs .................................................................................................... 27
Passing and Returning Strings .................................................................................. 27
File Input/Output ..................................................................................................................... 28
File I/O Examples ..................................................................................................... 28
Arrays...................................................................................................................................... 29
Ways to Declare a Fixed-Size Array......................................................................... 30
Manipulating Arrays ................................................................................................. 31
MultiDimensional Arrays ......................................................................................... 31
User Defined Types................................................................................................................. 32
Dialog Support ........................................................................................................................ 33
Dialog Box controls .................................................................................................. 33
OK and Cancel Buttons............................................................................................. 34
List Boxes, Combo Boxes and Drop-down List Boxes............................................. 34
Check Boxes ............................................................................................................. 35
Text Boxes and Text ................................................................................................. 36
Option Buttons and Group Boxes ............................................................................. 37
The Dialog Function ................................................................................................. 38
The Dialog Box Controls .......................................................................................... 39
The Dialog Function Syntax ..................................................................................... 39
Statements and Functions Used in Dialog Functions .............................................................. 40
DlgControlId Function.............................................................................................. 41
DlgFocus Statement, DlgFocus() Function............................................................... 42
DlgListBoxArray, DlgListBoxArray()...................................................................... 42
DlgSetPicture ............................................................................................................ 42
DlgValue, DlgValue()............................................................................................... 43
OLE Automation ..................................................................................................................... 44
Accessing an Object ................................................................................................................ 45
What is an OLE Object?.......................................................................................................... 46
OLE Fundamentals.................................................................................................................. 47
OLE Object ............................................................................................................... 47
OLE Automation....................................................................................................... 48
Class.......................................................................................................................... 48
OLE Automation and Microsoft Word Example: ................................................................... 48
Making Applications Work Together...................................................................................... 49
WIN.INI.................................................................................................................... 49
The Registration Database. ....................................................................................... 49
ii Contents
51
Language Reference A - Z
57
Contents iii
iv Contents
Automation
171
Introduction................................................................................................................... .........171
Active Tip Object Overview ..................................................................................................171
Active Tip Members ..............................................................................................................171
Properties: ................................................................................................................171
Methods: ..................................................................................................................171
AlignCommand Object Overview..........................................................................................172
AlignCommand Members ......................................................................................................172
Properties: ................................................................................................................172
Methods: ..................................................................................................................176
Application Object Overview.................................................................................................177
Application members .............................................................................................................177
Properties: ................................................................................................................177
Methods: ..................................................................................................................179
Contents v
vi Contents
Properties: ................................................................................................................232
Methods: ..................................................................................................................232
EditWindow Object Overview ...............................................................................................235
EditWindow Class Members..................................................................................................235
Properties: ................................................................................................................235
Methods: ..................................................................................................................237
ExternalCommand Object Overview .....................................................................................238
ExternalCommand Members..................................................................................................238
Properties: ................................................................................................................238
FeatCommand Object Overview ............................................................................................238
FeatCommand Members ........................................................................................................238
Properties: ................................................................................................................238
Methods: ..................................................................................................................249
FeatData Object Overview .....................................................................................................25 7
FeatData Members .................................................................................................................257
Properties .................................................................................................................257
File IO Object Overview........................................................................................................259
File IO Members ....................................................................................................................259
Properties: ................................................................................................................259
FlowControlCommand Object Overview...............................................................................260
FlowControlCommand Members...........................................................................................261
Properties: ................................................................................................................261
Methods: ..................................................................................................................263
Leitz Motion Object Overview...............................................................................................268
Leitz Motion Members...........................................................................................................268
Properties: ................................................................................................................268
Load Machine Object Overview ............................................................................................269
Load Machine Members.........................................................................................................269
Properties: ................................................................................................................269
Load Probes Object Overview ...............................................................................................269
Load Probes Members............................................................................................................269
Properties: ................................................................................................................269
Machine Object Overview .....................................................................................................269
Machine Object Members ......................................................................................................270
Properties: ................................................................................................................270
Events: .....................................................................................................................270
Machines Object Overview....................................................................................................270
Machines Object Members.....................................................................................................271
Properties: ................................................................................................................271
Methods: ..................................................................................................................271
ModalCommand Object Overview ........................................................................................272
ModalCommand Members.....................................................................................................272
Properties: ................................................................................................................272
MoveCommand Object Overview..........................................................................................274
MoveCommand Members......................................................................................................274
Properties: ................................................................................................................274
Opt Motion Object Overview.................................................................................................275
Opt Motion Members.............................................................................................................276
Properties: ................................................................................................................276
PartProgram Object Overview ...............................................................................................276
PartProgram Members ...........................................................................................................276
Properties: ................................................................................................................276
Methods: ..................................................................................................................278
PartPrograms Object Overview..............................................................................................280
PartPrograms Object Members ..............................................................................................280
Properties: ................................................................................................................280
Contents vii
309
viii Contents
Contents ix
PutFeatData............................................................................................................. 321
Functions R ........................................................................................................................... 321
ReadCommBlock .................................................................................................... 321
RecallIn ................................................................................................................... 322
RecallEx.................................................................................................................. 322
Retract..................................................................................................................... 322
RetroOnly................................................................................................................ 322
Rotate ...................................................................................................................... 322
RotateCircle ............................................................................................................ 322
RotateOffset ............................................................................................................ 323
Roundness ............................................................................................................... 323
Runout..................................................................................................................... 323
Functions S............................................................................................................................ 323
SaveAlign................................................................................................................ 323
SetAutoParams........................................................................................................ 323
SetAutoVector......................................................................................................... 324
SetNoms.................................................................................................................. 324
SetPrintOptions ....................................................................................................... 325
SetProgramOption................................................................................................... 325
SetProgramValue .................................................................................................... 325
SetReportOptions .................................................................................................... 325
SetRmeasMode ....................................................................................................... 325
SetSlaveMode ......................................................................................................... 326
SetScanHitParams................................................................................................... 326
SetScanHitVectors .................................................................................................. 326
SetScanParams........................................................................................................ 326
SetScanVectors ....................................................................................................... 327
SetTheos.................................................................................................................. 327
ShowXYZWindow.................................................................................................. 327
Sleep........................................................................................................................ 327
StartAlign................................................................................................................ 328
StartDim.................................................................................................................. 328
StartFeature ............................................................................................................. 328
StartGetFeatPoint .................................................................................................... 330
StartScan ................................................................................................................. 330
Straitness ................................................................................................................. 331
Stats......................................................................................................................... 331
Functions T............................................................................................................................ 331
Tip........................................................................................................................... 331
Touchspeed ............................................................................................................. 332
Trace ....................................................................................................................... 332
Translate.................................................................................................................. 332
TranslateOffset........................................................................................................ 332
Functions W .......................................................................................................................... 332
Wait......................................................................................................................... 332
Workplane............................................................................................................... 332
WriteCommBlock ................................................................................................... 332
Glossary of Terms
Index
x Contents
335
337
Introduction
The UTILITIES | SCRIPTING | BASIC SCRIPT EDITOR menu option opens the
Basic Script Editor. The Basic Script Editor can be used to create and edit basic
scripts that can be used in Basic Script objects during execution or from the Basic
Script toolbar.The Basic Script Editor consists of the following menus:
1)
File menu
2)
Edit menu
3)
View menu
4)
Run menu
5)
Help menu
File Menu
The Basic Script Editors FILE menu gives you the following commands and
options:
New
The FILE | NEW men option opens a new Basic Script Editor in which you can write
a new script.
Open
The FILE | OPEN menu option allows you to navigate to and open an existing script.
In order for files to appear in the Basic Script Editor, files must be of file type .BAS.
Save
The FILE | SAVE menu option allows you to save a script. With a new script, the
first time this option is selected, the Save As Dialog box will appear.
Save As
The FILE | SAVE AS menu option allows you to save a new script, or an already
existing script by a new file name. The Save As Dialog box appears, allowing you to
select the file name and the directory to which you will be saving the script.
Print
The FILE | PRINT menu option allows you to print the script in the Basic Script
Editor from your systems printer.
Print Preview
The FILE | PRINT PREVIEW menu option allows you to preview what will be sent
to the printer when PRINT is selected from the Basic Script Editors FILE menu.
Exit
The FILE | EXIT menu option allows you to exit out of the Basic Script Editor
without saving any changes you have made to any open scripts. Choosing FILE |
EXIT will return you the the main user interface. The menu bar will return to normal
PC-DMIS functions.
Edit Menu
The EDIT menu of the Basic Script Editor allows you to use basic Edit functions to
manipulate the text displayed in the Basic Script Editor.
Undo
The EDIT | UNDO menu option allows you to undo the most recent action taken in
the Basic Script Editor.
Cut
The EDIT | CUT menu option allows you to cut selected text from the Basic Script
Editor. Cut text is stored in the Windows clipboard to later be pasted elsewhere.
Copy
The EDIT | COPY menu option allows you to copy selected text. Copied text is
stored in the Windows clipboard to later be pasted elsewhere.
Paste
The EDIT | PASTE command allows you to paste text that is stored in the Windows
clipboard.
Delete
The EDIT | DELETE command allows you to delete highlighted text.
Select All
The EDIT | SELECT ALL menu option automatically selects all the text within the
Basic Script Editor. You can then CUT, COPY, or DELETE the selected text.
Find
The EDIT | FIND menu option brings up the Find Dialog box.
This dialog allows you to search for a specific word, or term within the Basic Script
Editor.
If you choose the Match whole word only check box the
dialog will display only those words that match the entire
word.
If you choose the Match Case check box, then the dialog
will display only those terms that match the case
(Uppercase or Lowercase) that you used in the Find what
field.
Find Next
The EDIT | FIND NEXT will search in the Basic Script Editor for the next term that
meets the qualifications specified in the Find Dialog box (See EDIT | FIND above.)
Replace
The EDIT | REPLACE menu option brings up the Replace Dialog box
This dialog is an extension of the EDIT | FIND command. This allows you to search
for a specific term and then replace it with the term entered in the Replace with field.
Find Next
The Find Next button searches through the Basic Script Editor and brings up the
first instance that meets the qualifications entered in the dialog box.
Replace
The Replace button allows you to replace what has been found (using the Find
Next button) with what is in the Replace with field.
Replace All
The Replace All button allows you to replace all instances in the Basic Script
Editor that meet the search qualifications with what is in the Replace with field.
Cancel
The Cancel button closes the Replace Dialog box.
View
The VIEW menu allows you to choose if the Basic Script Editors Toolbar and / or
Status Bar is being displayed. Select VIEW | TOOLBAR to toggle the toolbar on or
off. Select VIEW | STATUS BAR to toggle the status bar on or off.
Run
The RUN menu allows you to COMPILE a scriptor EXECUTE a script. Use the
compile command to test the script for syntactic errors. The execute command
executes the script.
Help
The HELP menu allows you to access various options that aid you in using the Basic
Script Editor.
Basic Help
The HELP | BASIC HELP command brings up the on-line help file created for the
add on Basic Module.
Syntax Help
The HELP | SYNTAX HELP toggles the option to use the syntax help when using
the Basic Script Editor. If this option is selected, a pop up scroll box appears within
the Basic Script Editor whenever you type in a command or term used in the Basic
programming language. You can use arrow keys to select the appropriate term. Once
selected, hit the TAB key and that term will appear in the Basic Script Editor.
Hitting the Spacebar displays the syntax needed for the command.
New
This button allows you to create a new basic script in the editor.
Open
This button brings up an Open File Dialog box allowing you opens an existing basic
script into the editor.
Save
This button saves the current basic script. If you have not already named the current
script, a Save As Dialog box asking for the name of the script will appear.
Print
This button prints the current basic script.
Print Preview
This button allows you to see the current basic script in the Print Preview window as
it will appear when printed.
Find
This button allows you to search for text in the current basic script.
Cut
Ths button cuts currently selected text and put text on the clipboard.
Copy
This button copies currently selected text and put text on the clipboard.
Paste
This button pastes text from the clipboard into the editor at the current insertion
point.
Undo
This button allows you to undo the last editing change.
Start
This button compiles and runs the current basic script.
Note: Scripts run from the editor using the PC-DMIS basic commands can insert
objects into the current part program.
Pause
This button pauses the currently running basic script
Stop
This button stops the currently running basic script
Set Breakpoint
This button allows you to set a breakpoint at the current line of the insertion point in
the editor.
Quick Watch
This button allows you to evaluate and show the current value of selected variable in
basic editor
Step Into
This button moves the basic script execution pointer forward to the next basic
instruction. This command is used in conjunction with break points and execution of
a basic script.
Step Over
This button steps over the current basic function call to the next statement following
the call. Clicking Step Into while on a basic function call will cause the execution
pointer to point at the first command of the called function.
In this Section, the general elements of the Enable language are described. Enable
scripts can include comments, statements, various representations of numbers, 11
variable data types including user defined types, and multiple flow of control
structures. Enable is also extendable by calling external DLLs or calling functions
back in the applications .exe file.
Comments
Comments are non-executed lines of code which are included for the benefit of the
programmer. Comments can be included virtually anywhere in a script. Any text
following an apostrophe or the word Rem is ignored by Enable. Rem and all other
keywords and most names in Enable are not case sensitive
rem
REM
Rem
Display message.
Statements:
In Enable there is no statement terminator. More than one statement can be put on a
line if they are separated by a colon.
X.AddPoint( 25, 100) :
X.AddPoint(
0,
75)
0,
75)
Numbers
Cypress Enable supports three representations of numbers: Decimal, Octal and
Hexadecimal. Most of the numbers used in this manual are decimal or base 10
numbers. However, if you need to use Octal (base 8) or hexadecimal (base 16)
numbers simply prefix the number with &O or &H respectively.
Variable Types
Variant
As is the case with Visual Basic, when a variable is introduced in Cypress Enable, it
is not necessary to declare it first (see option explicit for an exception to this rule).
When a variable is used but not declared then it is implicitly declared as a variant
data type. Variants can also be declared explicitly using "As Variant" as in Dim x As
Variant. The variant data type is capable of storing numbers, strings, dates, and
times. When using a variant you do not have to explicitly convert a variable from
one data type to another. This data type conversion is handled automatically.
Sub Main
Dim x
variant variable
x = 10
x = x + 8
x = "F" & x
print x
prints F18
End Sub
A variant variable can readily change its type and its internal representation can be
determined by using the function VarType. VarType returns a value that
corresponds to the explicit data types. See VarType in A-Z Reference for return
values.
When storing numbers in variant variables the data type used is always the most
compact type possible. For example, if you first assign a small number to the variant
it will be stored as an integer. If you then assign your variant to a number with a
fractional component it will then be stored as a double.
For doing numeric operations on a variant variable it is sometimes necessary to
determine if the value stored is a valid numeric, thus avoiding an error. This can be
done with the IsNumeric function.
Data Types
Variable
Symbol
Type Declaration
Size
Byte
0 to 255
Boolean
Dim BoolVar As
Boolean
True or False
String
0 to 65,500 char
Integer
2 bytes
Long
&
4 bytes
Single
4 bytes
Double
8 bytes
Variant
Dim X As Any
Currency
8 bytes
Object
Dim X As Object
4 bytes
Date
Dim D As Date
8 bytes
size of each
element
Scope of Variables
Cypress Enable scripts can be composed of many files and each file can have many
subroutines and functions in it. Variable names can be reused even if they are
contained in separate files. Variables can be local or global.
Declaration of Variables
In Cypress Enable variables are declared with the Dim statement. To declare a
variable other than a variant the variable must be followed by As or appended by a
type declaration character such as a % for Integer type.
Sub Main
Dim X As Integer
Dim Y As Double
Dim
Name$, Age%
End Sub
Control Structures
Cypress Enable has complete process control functionality. The control structures
available are Do loops, While loops, For loops, Select Case, If Then , and If Then
Else. In addition, Cypress Enable has one branching statement: GoTo. The Goto
Statement branches to the label specified in the Goto Statement.
Goto label1
.
.
.
label1:
The program execution jumps to the part of the program that begins with the label
"Label1:".
Loop Structures
Do Loops
The Do...Loop allows you to execute a block of statements an indefinite number of
times. The variations of the Do...Loop are Do While, Do Until, Do Loop While,
and Do Loop Until.
Do While|Until condition
Statement(s)...
[Exit Do]
Statement(s)...
Loop
Do Until condition
Statement(s)...
Loop
Do
Statements...
Loop While condition
Do
statements...
Loop Until condition
Do While and Do Until check the condition before entering the loop, thus the block
of statements inside the loop are only executed when those conditions are met. Do
Loop While and Do Loop Until check the condition after having executed the block
of statements thereby guaranteeing that the block of statements is executed at least
once.
While Loop
The While...Wend loop is similar to the Do While loop. The condition is checked
before executing the block of statements comprising the loop.
While condition
statements...
Wend
If condition Then
statements...
End If
End If
The Select Case statement tests the same variable for many different values. This
statement tends to be easier to read, understand and follow and should be used in
place of a complicated If...Then...ElseIf statement.
End Sub". Functions are similar "Function <funcname> As <type> ... <funcname> =
<value> ... End Function. DLL functions are declared via the Declare statement.
The parameter var3 in this case is passed by value and cannot be changed by the
subroutine SubOne.
Function R( X As String, ByVal n As Integer)
In this example the function R is receiving two parameters X and n. The second
parameter n is passed by value and the contents cannot be changed from within the
function R.
In the following code samples scalar variable and user defined types are passed by
reference.
Scalar Variables
Sub Main
Dim x(5) As Integer
Dim i As Integer
for i = 0 to 5
x(i) = i
next i
Print i
Joe (i), x The parenthesis around it turn it into an
expression which passes by value
print "should be 6: "; x(2), i
End Sub
OpenFile() Flags
Global Const OF_READ = &H0
Global Const OF_WRITE = &H1
Global Const OF_READWRITE = &H2
Global Const OF_SHARE_COMPAT = &H0
Global Const OF_SHARE_EXCLUSIVE = &H10
Global Const OF_SHARE_DENY_WRITE = &H20
Global Const OF_SHARE_DENY_READ = &H30
Global Const OF_SHARE_DENY_NONE = &H40
Global Const OF_PARSE = &H100
Global Const OF_DELETE = &H200
Global Const OF_VERIFY = &H400
Global Const OF_CANCEL = &H800
Global Const OF_CREATE = &H1000
Global Const OF_PROMPT = &H2000
Global Const OF_EXIST = &H4000
Global Const OF_REOPEN = &H8000
Sub Main
Dim ofs As OFSTRUCT
Print OF_READWRITE
ofs.szPathName = "c:\enable\openfile.bas"
print ofs.szPathName
ofs.nErrCode = 5
print ofs.nErrCode
OpenFile "t.bas", ofs
print ofs.szPathName
print ofs.nErrCode
End Sub
Notice the line extension character - the underscore. If a piece of code is too long
to fit on one line a line extension character can be used when needed.
Once a procedure is declared, you can call it just as you would another Enable
Function.
It is important to note that Enable cannot verify that you are passing correct values to
a DLL procedure. If you pass incorrect values, the procedure may fail.
You can pass a string from Cypress Enable to a DLL in one of two ways. You can
pass it "by value" (ByVal) or "by reference". When you pass a string ByVal,
Cypress Enable passes a pointer to the beginning of the string data (i.e. it passes a
BSTR). When a string is passed byreference, Enable passes a pointer to a pointer
to the string data (i.e. it passes a BSTR *).
OLE API
SysAllocString/SysAllocStringLen
SysAllocString/SysAllocStringLen
SysFreeString
SysStringLen
SysReAllocStringLen
SysReAllocString
Note:: The BSTR is a pointer to the string, so you dont need to dereference it.
File Input/Output
Enable supports full sequential and binary file I/O.
Open file.
Loop
Close #1
Close file.
End Sub
Sub test
Open "MYFILE" For Input As #1 Open file for input.
Do While Not EOF(1)
MsgBox InputData
Loop
Close #1
Close file.
End Sub
Sub FileIO_Example()
Dim Msg
Declare variable.
Call Make3Files()
Msg = "Several test files have been created on your disk. "
Msg = Msg & "Choose OK to remove the test files."
MsgBox Msg
For I = 1 To 3
Kill "TEST" & I Remove data files from disk.
Next I
End Sub
Sub Make3Files ()
Dim I, FNum, FName Declare variables.
For I = 1 To 3
FNum = FreeFile
Write string to
"line";
Next I
Close
End Sub
Arrays
Cypress Enable supports single and multi dimensional arrays. Using arrays you can
refer to a series of variables by the same name each with a separate index. Arrays
have upper and lower bounds. Enable allocates space for each index number in the
array. Arrays should not be declared larger then necessary.
All the elements in an array have the same data type. Enable supports arrays of
bytes, Booleans, longs, integers, singles, double, strings, variants and User Defined
Types.
q
q
the procedure
section of a code module to declare the array.
To create a local array, use the Dim statement inside a
procedure.
Cypress Enable supports
Dynamic arrays.
Declaring an Array
The array name must be followed by the upper bound in parentheses. The upper
bound must be an integer.
Dim
Sub Main ()
As Integer
The first declaration creates an array with 11 elements, with index numbers running
from 0 to 10. The second creates an array with 21 elements. To change the default
lower bound to 1 place an Option Base statement in the Declarations section of a
module:
Option Base 1
Another way to specify the lower bound is to provide it explicitly (as an integer, in
the range -32,768 to 32,767) using the To key word:
Dim Counters (1 To 13) As Integer
Dim Sums (100 To 126) As String
In the preceding declarations, the index numbers of Counters run from 1 to 13, and
the index numbers of Sums run from 100 to 126.
Note: Many other versions of Basic allow you to use an array without first
declaring it. Enable Basic does not allow this; you must declare an array before using
it.
Manipulating Arrays
Loops often provide an efficient way to manipulate arrays. For example, the
following For loop initializes all elements in the array to 5:
Static Counters (1 To 20) As Integer
Dim I As Integer
For I = 1 To 20
Counter ( I ) = 5
Next I
MultiDimensional Arrays
Cypress Enable supports multidimensional arrays. For example the following
example declares a two-dimensional array within a procedure.
Static Mat(20, 20) As Double
You can efficiently process a multidimensional array with the use of for loops. In the
following statements the elemtents in a multidimensional array are set to a value.
Dim L As Integer, J As Integer
Static TestArray(1 To 10, 1 to 10) As Double
For L = 1 to 10
For J = 1 to 10
TestArray(L,J) = I * 10 + J
Next J
Next L
Arrays can be more than two dimensional. Enable does not have an arbitrary upper
bound on array dimensions.
Dim ArrTest(5, 3, 2)
This declaration creates an arrray that has three dimensions with sizes 6 by 4, by 3
unless Option Base 1 is set previously in the code. The use of Option Base 1 sets the
lower bound of all arrays to 1 instead of 0.
Type type2
a As Integer
o As type1
End Type
Sub TypeExample ()
a = 5
type1a.a = 7472
type1a.d = 23.1415
type1a.s = "YES"
type2a.a = 43
type2a.o.s = "Hello There"
MsgBox type1a.a
MsgBox type1a.d
MsgBox type1a.s
MsgBox type2a.a
MsgBox type2a.o.s
MsgBox a
End Sub
Dialog Support
Cypress Enable has support for custom dialogs. The syntax is similar to the syntax
used in Microsoft Word Basic. The dialog syntax is not part of Microsoft Visual
Basic or Microsoft Visual Basic For Applications (VBA). Enable has complete
support for dialogs. The type of dialogs supported are outlined below.
Sub Main
Begin Dialog ButtonSample 16,32,180,96,"OK and Cancel"
OKButton 132,8,40,14
CancelButton 132,28,40,14
End Dialog
Dim Dlg1 As ButtonSample
Button = Dialog (Dlg1)
End Sub
Every custom dialog box must contain at least one command button - a OK button
or a Cancel button. Enable includes separate dialog box definition statements for
each of these two types of buttons.
Sub Main
Dim MyList$ (5)
MyList (0) = "line Item 1"
MyList (1) = "line Item 2"
MyList (2) = "line Item 3"
End Sub
You can use a list box, drop-down list box, or combo box to present a list of items
from which the user can select. A drop-down list box saves space (it can drop down
to cover other dialog box controls temporarily). A combo box allows the user either
to select an item from the list or type in a new item. The items displayed in a list box,
drop-down list box, or combo box are stored in an array that is defined before the
instructions that define the dialog box.
Check Boxes
Sub Main
Begin Dialog CheckSample15,32,149,96,"Check Boxes"
OKButton 92,8,40,14
CancelButton 92,32,40,14
CheckBox 12,8,45,8,"CheckBox",.CheckBox1
CheckBox 12,24,45,8,"CheckBox",.CheckBox2
CheckBox 12,40,45,8,"CheckBox",.CheckBox3
CheckBox 12,56,45,8,"CheckBox",.CheckBox4
End Dialog
Dim Dlg1 As CheckSample
Button = Dialog ( Dlg1 )
End Sub
You use a check box to make a yes or no or on or off choice. for example, you
could use a check box to display or hide a toolbar in your application.
Sub Main
Begin Dialog TextBoxSample 16,30,180,96,"Text Boxes and
Text"
OKButton 132,20,40,14
CancelButton 132,44,40,14
Text 8,8,32,8,"Text Box:"
TextBox 8,20,100,12,.TextBox1
Text 8,44,84,8,"Multiline Text Box:"
TextBox 8,56,100,32,.TextBox2
End Dialog
Dim Dlg1 As TextBoxSample
Button = Dialog ( Dlg1 )
End Sub
A text box control is a box in which the user can enter text while the dialog box is
displayed. By default, a text box holds a single line of text. Enable support single and
multi-line text boxes. The last parameter of the textbox function contains a variable
to set the textbox style.
=========================================================
This sample shows how to implement a multiline textbox
=========================================================
Const ES_LEFT
= &h0000& Try these different styles or-ed
together
Const ES_CENTER
the change
Const ES_RIGHT
Const ES_MULTILINE
position defaults to
Const ES_UPPERCASE
AutoVScroll testbox.
Const ES_LOWERCASE
Const ES_PASSWORD
Const ES_AUTOVSCROLL
Const ES_AUTOHSCROLL
Const ES_NOHIDESEL
Const ES_OEMCONVERT
Const ES_READONLY
Const ES_WANTRETURN
Const ES_NUMBER
= &h0001&
= &h0002&
= &h0004&
= &h0008&
A multiline, Wantreturn,
=
=
=
=
=
=
=
=
=
&h0010&
&h0020&
&h0040&
&h0080&
&h0100&
&h0400&
&h0800&
&h1000&
&h2000&
Sub Multiline
Begin Dialog DialogType 60, 60, 140, 185, "Multiline text Dialog",
.DlgFunc
TextBox 10, 10, 120, 150, .joe, ES_MULTILINE Or ES_AUTOVSCROLL
Or ES_WANTRETURN
Indicates multiline TextBox
TextBox 10, 10, 120, 150, .joe, 1 indicates multi-line
textbox
CancelButton 25, 168, 40, 12
OKButton 75, 168, 40, 12
End Dialog
Dim Dlg1 As DialogType
Dlg1.joe = "The quick brown fox jumped over the lazy dog"
Dialog returns -1 for OK, 0 for Cancel
button = Dialog( Dlg1 )
MsgBox "button: " & button
If button = 0 Then Exit Sub
MsgBox "TextBox: "& Dlg1.joe
End Sub
CancelButton 120,68,40,14
GroupBox 12,8,72,52,"GroupBox",.GroupBox1
GroupBox 100,12,72,48,"GroupBox",.GroupBox2
OptionGroup .OptionGroup1
OptionButton 16,24,54,8,"OptionButton",.OptionButton1
OptionButton 16,40,54,8,"OptionButton",.OptionButton2
CheckBox 108,24,45,8,"CheckBox",.CheckBox1
CheckBox 108,40,45,8,"CheckBox",.CheckBox2
End Dialog
Dim Dlg1 As GroupSample
Button = Dialog (Dlg1)
End Sub
Sub Main
Begin Dialog DialogName1 60, 60, 160, 70
TEXT 10, 10, 28, 12, "Name:"
TEXTBOX 42, 10, 108, 12, .nameStr
TEXTBOX 42, 24, 108, 12, .descStr
CHECKBOX 42, 38, 48, 12, "&CHECKME", .checkInt
OKBUTTON 42, 54, 40, 12
End Dialog
Dim Dlg1 As DialogName1
Dialog Dlg1
MsgBox Dlg1.nameStr
MsgBox Dlg1.descStr
MsgBox Dlg1.checkInt
End Sub
any commands to execute. Typical commands that might be used are disabling or
hiding a control. By default all dialog box controls are enabled. If you want a control
to be hidden you must explicitly make it disabled during initialization. After
initialization Enable displays the dialog box. When an action is taken by the user
Enable calls the dialog function and passes values to the function that indicate the
kind of action to take and the control that was acted upon.
The dialog box and its function are connected in the dialog definition. A function
name argument is added to the Begin Dialog instruction, and matches the name of
the dialog function located in your Enable program.
Begin Dialog UserDialog1 60,60, 260, 188, "3", .Enable
The controls identifier and label are different. An identifier begins with a period and
is the last parameter in a dialog box control instruction. In the sample code above
Check to display controls is the label and .chk1 is the identifier.
ControlID$
ControlID$ Receives the identifier of the dialog box control
Action
Action Identifies the action that calls the dialog function. There are six possibilities,
Enable supports the first 4.
Action 1
Action 2 The value passed when an action is taken ( i.e. a button is pushed,
checkbox is checked etc...) The controlID$ is the same as the identifier for the
control that was chosen
Action 3 Corresponds to a change in a text box or combo box. This value is passed
when a control loses the focus (for example, when the user presses the TAB key to
move to a different control) or after the user clicks an item in the list of a combo box
(an Action value of 2 is passed first). Note that if the contents of the text box or
combo box do not change, an Action value of 3 is not passed. When Action is 3,
ControlID$ corresponds to the identifier for the text box or combo box whose
contents were changed.
Supp Value
SuppValue receives supplemental information about a change in a dialog box
control. The information SuppValue receives depends on which control calls the
dialog function. The following SuppValue values are passed when Action is 2 or 3.
Control
SuppValue passed
ListBox, DropListBox,
or ComboBox
CheckBox
OptionButton
TextBox
ComboBox
CommandButton
Action or Result
Function
DlgControlId
DlgEnable, DlgEnable()
DlgFocus, DlgFocus()
DlgListBoxArray,
DlgListBoxArray()
DlgSetPicture
DlgText, DlgText
DlgValue, DlgValue()
DlgVisible,
DlgVisible()
DlgControlId Function
DlgControlId(Identifier)
Used within a dialog function to return the numeric identifier for the dialog box
control specified by Identifier, the string identifier of the dialog box control.
Numeric identifiers are numbers, starting at 0 (zero) , that correspond to the positions
of the dialog box control instructions within a dialog box definition. For example,
consider the following instruction in a dialog box definition:
CheckBox 90, 50, 30, 12, &Update, .MyCheckBox
The instruction DlgControlId(MyCheckBox) returns 0 (zero) if the CheckBox
instruction is the first instruction in the dialog box definition, 1 if it is the second,
and so on.
In most cases, your dialog functions will perform actions based on the string
identifier of the control that was selected.
The DlgFocus statement is used within a dialog function to set the focus on the
dialog box control identified by Identifier while the dialog box is displayed. When a
dialog box control has the focus, it is active and responds to keyboard input. For
example, if a text box has the focus, any text you type appears in that text box.
The DlgFocus() function returns the string identifier for the dialog box control that
currently has the focus.
Example
This example sets the focus on the control MyControl1 when the dialog box is
initially displayed. (The main subroutine that contains the dialog box definition is not
shown.)
Function MyDlgFunction( identifier, action, suppvalue)
Select Case action
Case 1
DlgFocus MyControl1
Case 2
Statements that perform actions based on which
control is selected
End Select
End Function
DlgListBoxArray, DlgListBoxArray()
DLGLISTBOXARRAY IDENTIFIER, ARRAYVARIABLE()
DLGLISTBOXARRAY(IDENTIFIER, ARRAYVARIABLE())
DlgSetPicture
DlgSetPicture
Identifier, PictureName
DlgValue, DlgValue()
DlgValue Identifier, Value
DlgValue(Identifier)
The DlgValue statement is used in a dialog function to select or clear a dialog box
control by setting the numeric value associated with the control specified by
Identifier. For example, DlgValue MyCheckBox, 1 selects a check box, DlgValue
MyCHeckBox, 0 clears a check box, and DlgValue MyCheckBox, -1 fills the
check box with gray. An error occurs if Identifier specifies a dialog box control such
as a text box or an option button that cannot be set with a numeric value.
The following dialog function uses a Select Case control
structure to check the value of Action. The SuppValue is
ignored in this function.
Sub Main
Case 1
DlgEnable "Group", 0
DlgVisible "Chk2", 0
DlgVisible "History", 0
Case 2
If ControlID$ = "Chk1" Then
DlgEnable "Group"
DlgVisible "Chk2"
DlgVisible "History"
End If
Case Else
End Select
Enable =1
End Function
OLE Automation
What is OLE Automation?
OLE Automation is a standard, promoted by Microsoft, that applications use to
expose their OLE objects to development tools, Enable Basic, and containers that
Where class is the parameter representing the class of the object to retrieve. The first
parameter at this time must be an empty string.
The properties and methods an object supports are defined by the application that
created the object. See the application's documentation for details on the properties
and methods it supports.
Accessing an Object
The following functions and properties allow you to access an OLE Automation
object:
Name.
CreateObject Function
Description
Creates a new object of a specified type
GetObject Function
Methods
Properties
Help
ActiveDocument
Quit
Application
Add Data
Caption
Repeat
DefaultFilePath
Undo
Documents
Height
Name
Parent
Path
Printers
StatusBar
Top
Value
Visible
Width
Document
Activate
Application
Close
NewWindow
Comments
FullName
PrintPreview
Author
Keywords
RevertToSaved
Name
Save
Parent
SaveAs
Path
ReadOnly
Saved
Subject
Title
Value
To provide access to more than one instance of an object, expose a collection object.
A collection object manages other objects. All collection objects support iteration
over the objects they manage. For example, Microsoft suggests an application with a
multiple document interface (MDI) might expose a Documents collection object with
the following methods and properties:
Collection object
Documents
Methods
Add
Properties
Application
Close
Count
Item
Parent
Open
OLE Fundamentals
Object linking and embedding (OLE) is a technology that allows a programmer of
Windows-based applications to create an application that can display data from many
different applications, and allows the user to edit that data from within the
application in which it was created. In some cases, the user can even edit the data
from within their application.
OLE Object
An OLE object refers to a discrete unit of data supplied by an OLE application. An
application can expose many types of objects. For example a spreadsheet application
can expose a worksheet, macro sheet, chart, cell, or range of cells all as different
types of objects. You use the OLE control to create linked and embedded objects.
When a linked or embedded object is created, it contains the name of the application
that supplied the object, its data (or, in the case of a linked object, a reference to the
data), and an image of the data.
OLE Automation
Some applications provide objects that support OLE Automation. You can use
Enable Basic to programmatically manipulate the data in these objects. Some objects
that support OLE Automation also support linking and embedding. You can create
an OLE Automation object by using the CreateObject function.
Class
An objects class determines the application that provides the objects data and the
type of data the object contains. The class names of some commonly used Microsoft
applications include MSGraph, MSDraw, WordDocument, and ExcelWorksheet.
myData = 4 * Atn(1)
conversion
word.Insert myData
word.Bold 0
MsgBox "Done"
End Sub
WIN.INI
The win.ini file contains a special section called [embedding] that contains
information about each of three applications that operate as object servers.
Associations.
The table contains information that associates files with specific extensions to
particular applications. This is essentially the same function performed by the
[extensions] section of the WIN.INI.
Shell Operations.
Windows contains two programs that are refered to as Shell programs. The term
Shell refers to a program that organizes basic operating system tasks, like running
applications, opening files, and sending files to the printer. Shell programs use list,
windows, menus, and dialog boxes to perform these operations. In contrast,
command systems like DOS require the entry of explicit command lines to
accomplish these tasks
DDE/OLE Automation.
The registration database contains the details and the applications that
support various types of DDE/OLE Automation operations.
It is useful to appreciate the difference in structure between the WIN.INI file and the
REG.DAT database. WIN.INI is simply a text document. There are no special
structures other than headings (simply titles enclosed in brackets) that organize the
information. If you want to locate an item in the WIN.INI file, you must search
through the file for the specific item you want to locate. The registration database is
a tree-like, structured database used for storing information relating to program and
file operations, in particular, those that involve the use of DDE or OLE. The tree
structure makes it easier to keep the complex set of instructions, needed to
implement DDE and OLE operations, organized and accessible by the applications
that need to use them. This is not possible when you are working with a text
document like WIN.INI. The WIN.INI file records all sorts or information about the
Windows system in a simple sequential listing.
Converting
Chr, Hex, Oct, Str, CDbl, CInt, Clng, CSng, CStr, CVar, CVDate, Asc, Val, Date, DateSerial,
DateValue, Format, Fix, Int, Day, Weekday, Month, Year, Hour, Minute, Second, TimeSerial,
TimeValue
Dialog
Text, TextBox, ListBox, DropList, ComboBox, CheckBox, OKButton, BeginDialog,
EndDialog, OptionGroup, OKButton, CancelButton, PushButton, Picture, GroupBox, Multiline TextBox,
File I/O
FileCopy, ChDir, ChDrive, CurDir, CurDir, MkDir,RmDir, Open, Close, Print #, Kill,
FreeFile, LOF, FileLen, Seek, EOF, Write #, Input, Line Input, Dir, Name, GetAttr, SetAttr,
Dir, Get, Put
Math
Exp, Log, Sqr, Rnd, Abs, Sgn, Atn, Cos, Sin, Tan, Int, Fix
Procedures
Call, Declare, Function, End Function, Sub, End Sub, Exit, Global
Strings
Let, Len, InStr, Left, Mid, Asc, Chr, Right, LCase, Ucase, InStr, LTrim, RTrim, Trim, Option
Compare, Len, Space, String, StrComp Format,
Error Trapping
On Error, Resume
Date/Time
Date, Now, Time, Timer
DDE
DDEInitiate, DDEExecute, DDETerminate
Arrays
Option Base, Option Explicit, Static, Dim, Global, Lbound, Ubound, Erase, ReDim
Miscellaneous
Data Types
Variable
Type Specifier
String
Dim St
Integer
Dim In
Long
&
Dim Lo
Single
Dim Sin
Double
Dim Db
Variant
Dim
Boolean
Dim
Byte
Dim
Object
Dim
Currency
(Not cur
Operators
Arithmetic Operators
Operator
Function
Exponentiation
Negation
Multiplication
Modulo
Addition
Subtraction
Relational Operators
Operator
Function
<
Less than
<=
division
Mod
Equals
x=
>=
x >=
>
Greater than
x>
<>
Not equal to
x <>
Logical Operators
Operator
Function
Usa
Not
Logical Negation
If No
And
Logical And
Or
Logical Or
If (x> y) A
if (x = y) O
Operator Precedence
Operator
Description
Ord
()
^
Parenthesis
Exponentiation
High
Unary minus
/,*
Division / Multplication
mod
Modulo
+, -, &
Addition, subtraction,
concatenation
Relational
not
Logical negation
and
Logical conjunction
or
Logical disjunction
Xor
Logical exclusion
Eqv
Logical Equivalence
Imp
Logical Implication
Low
Language Reference A - Z
Abs Function
Abs (number)
Example:
Sub Main
Dim Msg, X, Y
X = InputBox("Enter a Number:")
Y = Abs(X)
& X
Msg = Msg + ". The Absolute value of " & X & " is " & Y
MsgBox Msg Display Message.
End Sub
Language Reference A - Z 57
AppActivate Statement
AppActivate app
Activates an application.
The parameter app is a string expression and is the name that appears in the title bar
of the application window to activate.
Related Topics: Shell, SendKeys
Example:
Sub Main ()
AppActivate "Microsoft Word"
SendKeys %F,%N,Cypress Enable,True
Msg = Click OK to close Word
MsgBox Msg
AppActivate Microsoft Word
SendKeys %F,%C,N, True
End Sub
Asc Function
Asc ( str)
58 Language Reference A - Z
Returns a numeric value that is the ASCII code for the first character in a string.
Example:
Sub Main ()
Dim I, Msg
Declare variables.
From A through Z.
Create a string.
Next I
MsgBox Msg
Display results.
End Sub
Atn Function
Atn (rad )
The argument rad can be any numeric expression. The result is expressed in radians
Example:
Sub AtnExample ()
Dim Msg, Pi
Pi = 4 * Atn(1)
Declare variables.
Calculate Pi.
Display results.
End Sub
Language Reference A - Z 59
Beep Statement
Beep
Sounds a tone through the computers speaker. The frequency and duration of the
beep depends on hardware, which may vary among computers.
Example:
Sub BeepExample ()
Dim Answer, Msg
Declare variables.
Do
Answer = InputBox("Enter a value from 1 to 3.")
If Answer >= 1 And Answer <= 3 Then
Exit Do
Check range.
Exit Do...Loop.
Else
Beep
Beep if not in
range.
End If
Loop
MsgBox "You entered a value in the proper range."
End Sub
Call Statement
Call funcname [(parameter(s)]
or
[parameter(s)]
60 Language Reference A - Z
Activates an Enable Subroutine called name or a DLL function with the name name.
The first parameter is the name of the function or subroutine to call, and the second
is the list of arguments to pass to the called function or subroutine.
You are never required to use the Call statement when calling an Enable subroutine
or a DLL function. Parentheses must be used in the argument list if the Call
statement is being used.
Example:
Sub Main ()
Call Beep
MsgBox "Returns a Beep"
End Sub
CBool Function
CBool (expression)
Converts expressions from one data type to a boolean. The parameter expression
must be a valid string or numeric expression.
Example:
Sub Main
Dim A, B, Check
A = 5: B = 5
Check = CBool(A = B)
Print Check
A = 0
Check = CBool(A)
Print Check
Language Reference A - Z 61
End Sub
CDate Function
CVDate (expression)
Example:
Sub Main
Define date.
Print MDate
Print MSTime
End Sub
CDbl Function
CDbl (expression)
Converts expressions from one data type to a double. The parameter expression must
be a valid string or numeric expression.
Example:
Sub Main ()
62 Language Reference A - Z
Dim y As Integer
y = 25555
If
VarType(y) = 2 Then
Print y
x = CDbl(y)
Converts the integer value of y to a
double value in x
x = x * 100000 y is now 10 digits in the form of x
Print x
End If
End Sub
ChDir Statement
ChDir pathname
The parameter pathname is a string limited to fewer then 128 characters. The drive
parameter is optional. The dir parameter is a directory name. ChDir changes the
default directory on the current drive, if the drive is omitted.
Related Topics: CurDir, CurDir$, ChDrive, Dir, Dir$, MkDir, RmDir
Example:
Sub Main ()
Dim Answer, Msg, NL
NL = Chr(10)
Declare variables.
Define newline.
Language Reference A - Z 63
ChDrive Statement
ChDrive drivename
Example:
Sub Main ()
Dim Msg, NL Declare variables.
NL = Chr(10)
Define newline.
CheckBox
CheckBox starting x position, starting y position, width, height
Example:
Sub Main ()
Begin Dialog DialogName1 60, 70, 160, 50, "ASC - Hello"
64 Language Reference A - Z
End Sub
Choose Function
Choose(number, choice1, [choice2,] [choice3,] )
Example:
Sub Main
number = 2
GetChoice = Choose(number, "Choice1", "Choice2", "Choice3")
Print GetChoice
End Sub
Chr Function
Chr(int )
Language Reference A - Z 65
Example:
Sub ChrExample ()
Dim X, Y, Msg, NL
NL = Chr(10)
For X = 1 to 2
For Y = Asc("A") To Asc("Z")
Msg = Msg & Chr(Y)
Next Y
Msg = Msg & NL
Next X
MsgBox Msg
End Sub
CInt Function
CInt (expression)
Example:
Sub Main ()
Dim y As Long
y = 25
If
VarType(y) = 2 Then
Print y
x = CInt(y)
value in x
Print x
End If
66 Language Reference A - Z
End Sub
CLng Function
CLng (expression)
Example:
Sub Main ()
Dim y As Integer
y = 25000
digits
If
VarType(y) = 2 Then
Print y
x = CLng(y)
value in x
End Sub
Close Statement
Close [[#filenumber] [, [#]filenumber],,,
The Close Statement takes one argument filenumber. Filenumber is the number used
with the Open Statement to open the file. If the Close Statement is used without any
arguments it closes all open files.
Example:
Sub Main
Open "c:\test.txt" For Input As #1
Do While Not EOF(1)
MyStr = Input(10, #1)
MsgBox MyStr
Language Reference A - Z 67
Loop
Close #1
End Sub
Sub Make3Files ()
Dim I, FNum, FName Declare variables.
For I = 1 To 3
FNum = FreeFile
Write string to
"line";
Next I
Close
End Sub
Const Statement
Const name = expression
68 Language Reference A - Z
The definition of a Const in Cypress Enable outside the procedure or at the module
level is a global. The syntax Global Const and Const are used below outside the
module level are identical.
A type declaration character may be used however if none is used Enable will
automatically assign one of the following data types to the constant, long (if it is a
long or integer), Double (if a decimal place is present), or a String ( if it is a string).
Example:
Global Const Height = 14.4357
Const PI = 3.14159
Sub Main ()
Begin Dialog DialogName1 60, 60, 160,70, "ASC - Hello"
TEXT 10, 10, 100, 20, "Please fill in the radius of circle
x"
TEXT 10, 40, 28, 12, "Radius"
TEXTBOX 42, 40, 28, 12, .Radius
OKBUTTON 42, 54,40, 12
End Dialog
Dim Dlg1 As DialogName1
Dialog Dlg1
CylArea = Height * (Dlg1.Radius * Dlg1.Radius) * PI
MsgBox "The volume of Cylinder x is " & CylArea
End Sub
Cos Function
Cos (rad)
Example:
Sub Main()
Dim J As Double
Dim I As Single
Declare variables.
Dim K As Integer
For I =1 To 10
Language Reference A - Z 69
J=Cos(I)
Print J
K=Cos(I)
Print K
Next I
MsgBox Msg
Display results.
MsgBox Msg1
End Sub
CreateObject Function
CreateObject (class)
word6.Bold 1
name = "Some Body"
word6.Insert name
word6.Bold 0
word6.InsertPara
word6.Insert "
Vender Address:"
word6.InsertPara
word6.Insert "
Vender Product:"
word6.InsertPara
word6.InsertPara
word6.Insert "Dear Vender:"
word6.InsertPara
word6.InsertPara
word6.Insert "The letter you are reading was created with
Cypress Enable."
word6.Insert " Using OLE Automation Cypress Enable can call
any other OLE _ enabled "
70 Language Reference A - Z
word6.InsertPara
word6.Insert "
word6.InsertPara
word6.InsertPara
MsgBox "You have just called Word 6.0 using OLE"
End Sub
Dear Vender:
CSng Function
CSng (expression)
Example:
Language Reference A - Z 71
Sub Main ()
Dim y As Integer
y = 25
If
VarType(y) = 2 Then
Print y
x = CSng(y)
value in x
Print x
End If
CStr Function
CStr(expression)
Example:
Sub Main
Dim Y As Integer
Y = 25
Print Y
If VarType(Y) = 2 Then
X = CStr(Y) converts Y To a Str
X = X + "hello"
strings
Print X
End If
End Sub
CurDir Function
CurDir (drive)
72 Language Reference A - Z
Example:
Declare Function CurDir Lib "NewFuns.dll" ()
As String
Sub Form_Click ()
Dim Msg, NL Declare variables.
NL = Chr(10)
Define newline.
CVar Function
CVar (expression)
Example:
Sub Main
End Sub
Language Reference A - Z 73
Date Function
Date, Date()
Example:
Format Function Example
This example shows various uses of the Format function to
format values
using both named and user-defined formats. For the date
separator (/),
time separator (:), and AM/ PM literal, the actual formatted
output
displayed by your system depends on the locale settings on
which the code
is running. When times and dates are displayed in the
development
environment, the short time and short date formats of the
code locale
are used. When displayed by running code, the short time and
short date
formats of the system locale are used, which may differ from
the code
locale. For this example, English/United States is assumed.
Sub Main
x = Date()
Print Date
Print x
Print VarType: & VarType(Date)
MyTime = "08:04:23 PM"
MyDate = "03/03/95"
MyDate = "January 27, 1993"
SysDate = Date
MsgBox Sysdate,0,"System Date"
MsgBox Now,0,"Now"
74 Language Reference A - Z
MsgBox MyTime,0,"MyTime"
End Sub
DateSerial Function
Language Reference A - Z 75
Returns a variant (Date) corresponding to the year, month and day that were passed
in. All three parameters for the DateSerial Function are required and must be valid.
Related Topics: DateValue, TimeSerial, TimeValue
Example:
Sub Main
Dim MDate
MDate = DateSerial(1959, 5, 29)
Print MDate
End Sub
DateValue Function
DateValue(dateexpression)
Returns a variant (Date) corresponding to the string date expression that was passed
in. dateexpression can be a string or any expression that can represent a date, time or
both a date and a time.
Related Topics: DateSerial, TimeSerial, TimeValue
Example:
Sub Main()
Dim v As Variant
Dim d As Double
d = Now
Print d
v = DateValue("1959/05/29")
MsgBox (VarType(v))
MsgBox (v)
End Sub
Day Function
Day(dateexpression)
76 Language Reference A - Z
Returns a variant date corresponding to the string date expression that was passed in.
dateexpression can be a string or any expression that can represent a date.
Related Topics: Month, Weekday, Hour, Second
Example:
Sub Main
End Sub
Declare Statement
Declare Sub procedurename Lib Libname$ [Alias aliasname$][(argument list)]
Declare Function procedurename Lib Libname$ [Alias aliasname$] [(argument list)][As Type]
The optional ByVal parameter specifies that the variable is [passed by value instead
of by reference (see ByRef and ByVal in this manual). The optional As type
parameter is used to specify the data type. Valid types are String, Integer, Double,
Long, and Varaint (see Variable Types in this manual).
Language Reference A - Z 77
Cypress Enable extentions to the declare statement. The following syntax is not
supported by Microsoft Visual Basic.
Declare Function procedurename App [Alias aliasname$] [(argument list)][As Type]
This form of the Declare statement makes a reference to a function located in the
executable file located in the application where Enable is embedded.
Related Topics: Call
Example:
Declare Function GetFocus Lib "User" () As Integer
Declare Function GetWindowText Lib "User" (ByVal hWnd%, ByVal
Mess$, ByVal cbMax%) As _ Integer
Sub Main
Dim hWindow%
Dim str1 As String *51
Dim str2 As String * 25
hWindow% = GetFocus()
print "GetWindowText returned: ", GetWindowText( hWindow%,
str1,51 )
print "GetWindowText2 returned: ", GetWindowText( hWindow%,
str2, 25)
print str1
print str2
End Sub
78 Language Reference A - Z
Example:
This sample shows all of the dialog controls on one dialog
and how to
vary the response based on which PushButton was pressed.
Sub Main ()
Dim MyList$(2)
MyList(0) = "Banana"
MyList(1) = "Orange"
MyList(2) = "Apple"
Begin Dialog DialogName1 60, 60, 240, 184, "Test Dialog"
Text 10, 10, 28, 12, "Name:"
TextBox 40, 10,50, 12, .joe
ListBox 102, 10, 108, 16, MyList$(), .MyList1
ComboBox 42, 30, 108, 42, MyList$(), .Combo1
DropListBox 42, 76, 108, 36, MyList$(), .DropList1$
OptionGroup .grp1
OptionButton 42, 100, 48, 12, "Option&1"
OptionButton 42, 110, 48, 12, "Option&2"
OptionGroup .grp2
OptionButton 42, 136, 48, 12, "Option&3"
OptionButton 42, 146, 48, 12, "Option&4"
GroupBox 132, 125, 70, 36, "Group"
CheckBox 142, 100, 48, 12, "Check&A", .Check1
CheckBox 142, 110, 48, 12, "Check&B", .Check2
CheckBox 142, 136, 48, 12, "Check&C", .Check3
CheckBox 142, 146, 48, 12, "Check&D", .Check4
CancelButton 42, 168, 40, 12
OKButton 90, 168, 40, 12
PushButton 140, 168, 40, 12, "&Push Me 1"
PushButton 190, 168, 40, 12, "Push &Me 2"
Language Reference A - Z 79
End Dialog
Dim Dlg1 As DialogName1
Dlg1.joe
= "Def String"
Dlg1.MyList1 = 1
Dlg1.Combo1 = "Kiwi"
Dlg1.DropList1 = 2
Dlg1.grp2 = 1
Dialog returns -1 for OK, 0 for Cancel, button # for
PushButtons
button = Dialog( Dlg1 )
MsgBox "button: " & button uncomment for button return
vale
If button = 0 Then Return
Dim Statement
Dim variablename[(subscripts)][As Type][,name][As Type]]
Allocates storage for and declares the data type of variables and arrays in a module.
The types currently supported are integer, long, single, double and string and variant.
80 Language Reference A - Z
Example:
Sub Main
Dim x As Long
Dim y As Integer
Dim z As single
Dim a As double
Dim s As String
Dim v As Variant This is the same as Dim x or Dim x as
any
End Sub
Dir Function
Dir[(path,attributes)]
Returns a file/directory name that matches the given path and attributes.
Example:
=========================================================
Bitmap sample using the Dir Function
=========================================================
Sub DrawBitmapSample
Dim MyList()
Begin Dialog BitmapDlg 60, 60, 290, 220, "Enable bitmap
sample", .DlgFunc
ListBox 10, 10, 80, 180, MyList(), .List1, 2
Picture 100, 10, 180, 180, "Forest.bmp", 0, .Picture1
CancelButton 42, 198, 40, 12
OKButton 90, 198, 40, 12
End Dialog
Language Reference A - Z 81
DlgFunc = 1
DlgEnable Statement
DlgEnable ControlName, Value
Example:
Function Enable( ControlID$, Action%, SuppValue%)
Begin Dialog UserDialog2 160,160, 260, 188, "3", .Enable
82 Language Reference A - Z
Case 1
DlgEnable "Group", 0
DlgVisible "Chk2", 0
DlgVisible "History", 0
Case 2
If ControlID$ = "Chk1" Then
DlgEnable "Group", On
DlgVisible "Chk2"
DlgVisible "History"
End If
End If
Case Else
End Select
Language Reference A - Z 83
Enable =1
End Function
DlgText Statement
DLGTEXT CONTROLNAME, STRING
The parameter ControlName is the name of the control on the dialog box. The
parameter String is the value to set it to.
Related Topics: DlgEnable, DlgVisible
Example:
If ControlID$ = "Chk2" Then
DlgText "History", "Push to display nested dialog"
End If
DlgVisible Statement
DlgVisible ControlName, Value
This statement is used to hide or make visible a particular control on a dialog box.
The parameter ControlName is the name of the control on the dialog box. The
parameter Value is the value to set it to. 1 = Visible, 0 = Hidden. On is equal to 1. If
the second parameter is omitted the status of the control toggles. The entire example
below can be found in the dialog section of this manual and in the example .bas files
that ship with Cypress Enable.
Related Topics: DlgEnable, DlgText
Example:
If ControlID$ = "Chk1" Then
DlgEnable "Group", On
DlgVisible "Chk2"
84 Language Reference A - Z
DlgVisible "History"
End If
Do...Loop Statement
Do [{While|Until} condition]
[statements]
[Exit Do]
[statements]
Loop
Do
[statements]
[Exit Do]
[statements]
Loop [{While|Until} condition]
Example:
Sub Main ()
Dim Value, Msg
Declare variables.
Do
Value = InputBox("Enter a value from 5 to 10.")
If Value >= 5 And Value <= 10 Then
Exit Do
Exit Do...Loop.
Else
Beep
End If
Loop
End Sub
Language Reference A - Z 85
End Statement
End[{Function | If | Sub}]
Example:
Sub Main()
Var1 = "hello"
MsgBox " Calling Test"
Test Var1
MsgBox Var1
End Sub
wvar1 = "goodbye"
MsgBox "Use of End Statement"
End
End Sub
EOF Function
86 Language Reference A - Z
EOF(Filenumber)
Returns a value during file input that indicates whether the end of a file has been
reached.
Example:
Input Function Example
Sub Main
Open "TESTFILE" For Input As #1
Open file.
MsgBox MyStr
Loop
Close #1
Close file.
End Sub
Erase Statement
Erase arrayname[,arrayname ]
Example:
This example demonstrates some of the
The lower bound
features of arrays.
Option Base 1
Sub Main
Language Reference A - Z 87
Integer array.
Variable-string array.
Fixed-string array.
Variant array.
Dynamic array.
Erase StrVarArray
string ("").
Erase StrFixArray
Erase VarArray
Erase DynamicArray
End Sub
Exit Statement
Exit {Do | For | Function | Sub }
Example:
This sample shows Do ... Loop with Exit Do to get out.
Sub Main ()
Dim Value, Msg
variables.
Declare
Do
Value = InputBox("Enter a value from 5 to 10.")
If Value >= 5 And Value <= 10 Then
Exit Do
Do...Loop.
Check range.
Exit
Else
Beep
not in range.
Beep if
End If
Loop
End Sub
88 Language Reference A - Z
Exp
Exp(num)
Example:
Sub ExpExample ()
Exp(x) is e ^x so Exp(1) is e ^1 or e.
Dim Msg, ValueOfE
Declare variables.
ValueOfE = Exp(1)
Calculate value of e.
FileCopy Function
FileCopy( sourcefile, destinationfile)
Example:
Dim SourceFile, DestinationFile
SourceFile = "SRCFILE"
Language Reference A - Z 89
DestinationFile = "DESTFILE"
FileLen Function
FileLen( filename )
Example:
Sub Main
Dim MySize
MySize = FileLen("C:\TESTFILE")
length (bytes).
Returns file
Print MySize
End Sub
Fix Function
Fix(number )
Example:
Sub Main
Dim MySize
MySize = Fix(4.345)
Print MySize
End Sub
90 Language Reference A - Z
Each
element in group
[statements]
[Exit For]
[statements]
Next [element]
Repeats the group of statments for each element in an array of a collection. For each
Next statements can be nested if each loop element is unique. The For
EachNext statement cannot be used with and array of user defined types.
Example:
Sub Main
dim z(1 to 4) as double
z(1) = 1.11
z(2) = 2.22
z(3) = 3.33
For Each v In z
Print v
Next v
End Sub
For...Next Statement
For counter = expression1 to expression2 [Step increment]
[statements]
Next [counter]
Example:
Sub main ()
Dim x,y,z
For x = 1 to 5
For y = 1 to 5
Language Reference A - Z 91
For z = 1 to 5
Print "Looping" ,z,y,x
Next z
Next y
Next x
End Sub
Format Function
Format (expression [,fmt ] )
Part
Description
Expression
Expression to be
formatted.
Fmt
A string of characters
that specify how the
expression is to
displayed. or the name
of a commonly-used
format that has been
predefined in Enable
Basic. Do not mix
different type format
expressions in a single
fmt parameter.
92 Language Reference A - Z
Description
General
Fixed
Standard
Format
Name
Description
Scientific
True/False
Display False if
number is 0, otherwise
display True.
Meaning
Display the number with no formatting.
Language Reference A - Z 93
Character
Meaning
Description
Percentage
placeholder.
Thousand separator.
E-E+e-e+
Time separator.
94 Language Reference A - Z
Scientific format.
Date separator.
Character
Meaning
-+$()
space
String
Unless the fmt argument contains one of the predefined formats, a format expression
for numbers can have from one to four sections separated by semicolons.
If you use
The result is
Two
Three
Four
Language Reference A - Z 95
The following example has two sections: the first defines the format for positive
values and zeros; the second section defines the format for negative values.
$#,##0; ($#,##0)
If you include semicolons with nothing between them. the missing section is printed
using the format of the positive value. For example, the following format displays
positive and negative values using the format in the first section and displays Zero
if the value is zero.
$#,##0;;\Z\e\r\o
Positive 3
Negative 3
Decimal .3
Null string
-3
0.3
-3
0.00
3.00
-3.00
0.30
#,##0
-3
#,##0.00;;;Nil
3.00
-3.00
0.30
$#,##0;($#,##
0)
$3
($3)
$1
$#,##0.00;($
#,##0.00)
$3.00
($3.00)
$0.30
0%
300%
-300%
Null
Nil
30%
0.00%
300.00%
-300.00%
30.00%
0.00E+00
3.00E+00
-3.00E+00
3.00E-01
0.00E-00
3.00E00
-3.00E00
3.00E-01
Numbers can also be used to represent date and time information. You can format
date and time serial numbers using date and time formats or number formats because
date/time serial numbers are stored as floating-point values.
To format dates and times, you can use either the commonly used format that have
been predefined or create user-defined time formats using standard meaning of each:
The following table shows the predefined data format names you can use and the
meaning of each.
Format
96 Language Reference A - Z
Name
Description
General
Display a date and/or time. for real numbers, display a date and
time.(e.g. 4/3/93 03:34 PM); If there is no fractional part,
display only a date (e.g. 4/3/93); if there is no integer part,
display time only (e.g. 03:34 PM).
Long Date
Medium
Short Date
Long Time
Medium Time
Short Time
This table shows the characters you can use to create user-defined date/time formats.
Character
Meaning
Display the date as dddd and display the time as ttttt. in the
order.
dd
ddd
ddddd
Character
Meaning
ww
mm
mmm
mmmm
yy
yyyy
hh
Language Reference A - Z 97
nn
ss
ttttt
AM/PM
am/pm
Character
Meaning
A/P
a/p
AMPM
Use the 12-hour clock and display the contents of the 11:59
string (s1159) in the WIN.INI file with any hour before noon;
display the contents of the 2359 string (s2359) with any hour
between noon and 11:59 PM. AMPM can be either uppercase
or lowercase, but the case of the string displayed matches the
string as it exists in the WIN.INI file. The default format is
AM/PM.
Display
m/d/yy
2/26/65
d-mmmm-yy
26-February-65
d-mmmm
26 February
mmmm-yy
February 65
hh:nn AM/PM
06:45 PM
h:nn:ss a/p
6:45:15 p
h:nn:ss
18:45:15
m/d/yy/h:nn
2/26/65 18:45
Strings can also be formatted with Format[$]. A format expression for strings can
have one section or two sections separated by a semicolon.
If you use
The result is
Two sections
The following characters can be used to create a format expression for strings:
98 Language Reference A - Z
Character
Meaning
&
<
Force lowercase.
>
Force uppercase.
Example:
Format Function Example
Sub Main
MsgBox Now
MsgBox MyTime
Language Reference A - Z 99
Returns "17:4:23".
Returns "23".
User-defined formats.
MsgBox Format(5459.4, "##,##0.00")
Returns "5,459.40".
Returns "334.90".
Returns "500.00%".
Returns "hello".
End Sub
FreeFile Function
FreeFile
Returns an integer that is the next available file handle to be used by the Open
Statement.
Example:
Sub Main
Dim Mx, FileNumber
For Mx = 1 To 3
FileNumber = FreeFile
Open "c:\e1\TEST" & Mx For Output As #FileNumber
Write #FileNumber, "This is a sample."
Close #FileNumber
Next Mx
Function Statement
Function Fname [(Arguments)] [As type]
[statements]
Functionname = expression
[statements]
Functionname = expression
End Function
Declares and defines a procedure that can receive arguments and return a value of a
specified data type.
When the optional argument list needs to be passed the format is as follows:
([ByVal] variable [As type] [,ByVal] variable [As type] ]])
The optional ByVal parameter specifies that the variable is [passed by value instead
of by reference (see ByRef and ByVal in this manual). The optional As type
parameter is used to specify the data type. Valid types are String, Integer, Double,
Long, and Varaint (see Variable Types in this manual).
Related Topics: Dim, End, Exit, Sub
Example:
Sub Main
Dim I as integer
For I = 1 to 10
Print GetColor2(I)
Next I
End Sub
Function GetColor2( c% ) As Long
GetColor2 = c% * 25
If c% > 2 Then
GetColor2 = 255
0x0000FF - Red
End If
If c% > 5 Then
GetColor2 = 65280
0x00FF00 - Green
End If
If c% > 8 Then
GetColor2 = 16711680
0xFF0000 - Blue
End If
End Function
Get Statement
GetStatement [#] filenmber,[recordnumber], variablename
The GetObject Function has two parameters a filename and a class. The filename is
the name of the file containing the object to retrieve. If filename is an empty string
then class is required. Class is a string containing the class of the object to retrieve.
Global Statement
Global Const constant
The Global Statement must be outside the procedure section of the script. Global
variables are available to all functions and subroutines in your program
Related Topics: Dim, Const and Type Statements
Example:
Global Const Height = 14.4357
Const PI = 3.14159
Sub Main ()
Begin Dialog DialogName1 60, 60, 160,70, "ASC - Hello"
TEXT 10, 10, 100, 20, "Please fill in the radius of circle
x"
TEXT 10, 40, 28, 12, "Radius"
TEXTBOX 42, 40, 28, 12, .Radius
OKBUTTON 42, 54,40, 12
End Dialog
Dim Dlg1 As DialogName1
Dialog Dlg1
CylArea = Height * (Dlg1.Radius * Dlg1.Radius) * PI
MsgBox "The volume of Cylinder x is " & CylArea
End Sub
GoTo Statement
GoTo label
Example:
Sub main ()
Dim x,y,z
For x = 1 to 5
For y = 1 to 5
For z = 1 to 5
Print "Looping" ,z,y,x
If y > 3 Then
GoTo Label1
End If
Next z
Next y
Next x
Label1:
End Sub
Hex
Hex (num)
The parameter num can be any valid number. It is rounded to nearest whole number
before evaluation.
Example:
Sub Main ()
Hour Function
Hour(string )
The Hour Function returns an integer between 0 and 23 that is the hour of the day
indicated in the parameter number.
The parameter string is any number expressed as a string that can represent a date
and time from January 1, 1980 through December 31, 9999.
Example:
This example shows various uses of the Format function to
format values
Sub Main
MsgBox Now
MsgBox MyTime
Returns "17:4:23".
Returns "23".
User-defined formats.
MsgBox Format(5459.4, "##,##0.00")
Returns "5,459.40".
Returns "334.90".
Returns "500.00%".
Returns "hello".
End Sub
HTMLDialog
HTMLDialog (path, number)
Example:
x =HtmlDialog( "c:\enable40\htmlt.htm", 57 )
If...Then...Else Statement
Syntax 1
If condition Then thenpart [Else elsepart]
Syntax 2
If condition Then
[statement(s)]
ElseIf condition Then
[statement(s)]
Else
[statements(s)].
End If
Syntax 2
Example:
Sub IfTest
demo If...Then...Else
Dim msg as String
Dim nl as String
Dim someInt as Integer
nl = Chr(10)
msg = "Less"
someInt = 4
If someInt = 1 Then
msg = "Spring"
ElseIf someInt = 2 Then
msg = "Summer"
ElseIf someInt = 3 Then
msg = "Fall"
ElseIf someInt = 4 Then
msg = "Winter"
Else
msg = "Salt"
End If
MsgBox & msg
End Sub
Input # Statement
Input
# filenumber, variablelist
Input # Statement reads data from a sequential file and assigns that data to variables.
The Input # Statement has two parameters filenumber and variablelist. filenumber is
the number used in the open statement when the file was opened and variablelist is a
Comma-delimited list of the variables that are assigned when read from the file..
Example:
Dim MyString, MyNumber
Open "c:\TESTFILE" For Input As #1
Do While Not EOF(1)
Loop
Close #1
Input Function
Input(n , [ #] filenumber )
The input function has two parameters n and filenumber. n is the number of bytes to
be read from a file and filenumber is the number used in the open statement when
the file was opened.
Example:
Sub Main
Open file.
MsgBox MyStr
Loop
Close #1
Close file.
End Sub
InputBox Function
InputBox(prompt[,[title][,[default][,xpos,ypos]]])
Example:
Sub Main ()
Title$ = "Greetings"
Prompt$ = "What is your name?"
Default$ = ""
X% = 200
Y% = 200
N$ = InputBox$(Prompt$, Title$, Default$, X%, Y%)
End Sub
InStr
InStr(numbegin, string1, string2)
Returns the character position of the first occurrence of string2 within string1.
The numbegin parameter is not optional and sets the starting point of the search.
numbegin must be a valid positive integer no greater than 65,535.
string1 is the string being searched and string2 is the string we are looking for.
Example:
Sub Main ()
B$ = "Good Bye"
A% = InStr(2, B$, "Bye")
C% = Instr(3, B$, "Bye")
End Sub
Int Function
Int(number )
IsArray Function
IsArray(variablename )
Returns a boolean value True or False indicating whether the parameter vaiablename
is an array.
Example:
Sub Main
MCheck = IsArray(MArray)
Print MCheck
End Sub
IsDate
IsDate(variant )
Example:
Sub Main
Dim x As String
MArray1 = CStr(MArray)
MCheck1 = CStr(MCheck)
Print MArray1 & " is a date " & Chr(10) & MCheck
Print x & " is a date" & Chr(10) & MChekk
End Sub
IsEmpty
IsEmpty(variant )
Example:
This sample explores the concept of an empty variant
Sub Main
Dim x
Empty
x = 5
x = Empty
Empty
y = x
Both Empty
IsNull
IsNull(v)
The parameter v can be any variant. IsNull returns a TRUE if v contains NULL. If
isNull returns a FALSE the variant expression is not NULL.
The NULL value is special because it indicates that the v parameter contains no data.
This is different from a null-string, which is a zero length string and an empty string
which has not yet been initialized.
IsNumeric
IsNumeric(v)
The parameter v can be any variant, numeric value, Date or string (if the string can
be interpreted as a numeric).
Example:
Sub Form_Click ()
Dim TestVar Declare variable.
TestVar = InputBox("Please enter a number, letter, or
symbol.")
If IsNumeric(TestVar) Then Evaluate variable.
MsgBox "Entered data is numeric." Message if number.
Else
MsgBox "Entered data is not numeric." ' Message if not.
End If
End Sub
IsObject Function
IsObject(objectname )
Returns a boolean value True or False indicating whether the parameter objectname
is an object.
Example:
Sub Main
Print MyCheck
End Sub
Kill Statement
Kill filename
Kill will only delete files. To remove a directory use the RmDir Statement
Example:
Const NumberOfFiles = 3
Sub Main ()
Dim Msg
Declare variable.
Call MakeFiles()
Next I
End Sub
Sub MakeFiles ()
Dim I, FNum, FName
Declare variables.
For I = 1 To NumberOfFiles
FNum = FreeFile
number.
Write string to
"line";
Next I
Close
Kill FName
End Sub
LBound Function
LBound(array [,dimension] )
Returns the smallest available subscript for the dimension of the indicated array.
Example:
This example demonstrates some of the
The lower bound
features of arrays.
Option Base 1
Sub Main
Dim a(10) As Double
MsgBox "LBound: " & LBound(a) & " UBound: " & UBound(a)
Dim i As Integer
For i = 0 to 3
a(i) = 2 + i * 3.1
Next i
Print a(0),a(1),a(2), a(3)
End Sub
LCase, Function
Lcase[$](string )
Returns a string in which all letters of the string parameter have been converted to
upper case.
Example:
This example uses the LTrim and RTrim functions to strip
leading and
trailing spaces, respectively, from a string variable. It
uses the Trim function alone to strip both types of spaces.
LCase and UCase are also shown in this example as well as the
use
of nested function calls
Sub Main
MyString = "
<-Trim->
TrimString = LTrim(MyString)
".
TrimString = "<-Trim->
TrimString = "
TrimString = "<-
TrimString = "<-
Left
Left(string, num)
Example:
Sub Main ()
Dim LWord, Msg, RWord, SpcPos, UsrInp
variables.
Declare
print UsrInp
SpcPos = InStr(1, UsrInp, " ")
Find space.
If SpcPos Then
LWord = Left(UsrInp, SpcPos - 1)
print "LWord: ";
LWord
Get right
Len
Len(string)
Example:
Sub Main ()
A$ = "Cypress Enable"
StrLen% = Len(A$)
MsgBox StrLen%
End Sub
Let Statement
[Let] variablename = expression
Let is an optional keyword that is rarely used. The Let statement is required in older
versions of BASIC.
Example:
Sub Form_Click ()
Dim Msg, Pi
Let Pi = 4 * Atn(1)
Declare variables.
Calculate Pi.
Display results.
End Sub
The parameter filenumber is used in the open statement to open the file. The
parameter name is the name of a variable used to hold the line of text from the file.
Example:
Line Input # Statement Example:
This example uses the Line Input # statement to read a line
from a
sequential file and assign it to a variable. This example
assumes that
TESTFILE is a text file with a few lines of sample data.
Sub Main
Open "TESTFILE" For Input As #1
Open file.
Print TextLine
Loop
Close #1
Close file.
End Sub
LOF
LOF(filenumber)
Returns a long number for the number of bytes in the open file.
Example:
Sub Main
Dim FileLength
Open "TESTFILE" For Input As #1
FileLength = LOF(1)
Print FileLength
Close #1
End Sub
Log
Log(num)
Example:
Sub Form_Click ( )
Dim I, Msg, NL
NL = Chr(13) & Chr(10)
Msg = Exp(1) & NL
For I = 1 to 3
Msg = Msg & Log(Exp(1) ^ I ) & NL
Next I
MsgBox Msg
End Sub
Mid Function
string = Mid(strgvar,begin,length)
Example:
Sub Main ()
Dim LWord, Msg, RWord, SpcPos, UsrInp
variables.
Declare
print UsrInp
SpcPos = InStr(1, UsrInp, " ")
Find space.
If SpcPos Then
LWord = Left(UsrInp, SpcPos - 1)
print "LWord: ";
LWord
Get right
Print MidTest
End Sub
Minute Function
Minute(string)
Example:
Format Function Example
Sub Main
MsgBox Now
MsgBox MyTime
End Sub
MkDir
MkDir
path
The parameter path is a string expression that must contain fewer than 128
characters.
Example:
Sub Main
Dim DST As String
DST = "t1"
mkdir DST
mkdir "t2"
End Sub
Month Function
Month(number)
Returns an integer between 1 and 12, inclusive, that represents the month of the year.
Example:
Sub Main
MyDate = "03/03/96"
print MyDate
x = Month(MyDate)
print x
End Sub
Displays a message in a dialog box and waits for the user to choose a button.
The first parameter msg is the string displayed in the dialog box as the message. The
second and third parameters are optional and respectively designate the type of
buttons and the title displayed in the dialog box.
MsgBox Function returns a value indicating which button the user has chosen; the
MsgBox statement does not.
Value
Meaning
Group 1
0
Group 2
16
Stop Icon
32
Question Icon
48
Exclamation Icon
64
Information Icon
Group 3
0
256
512
Group 4
768
Application modal
4096
System modal
The first group of values (1-5) describes the number and type of buttons displayed in
the dialog box; the second group (16, 32, 48, 64) describes the icon style; the third
group (0, 256, 512) determines which button is the default; and the fourth group (0,
4096) determines the modality of the message box. When adding numbers to create a
final value for the argument type, use only one number from each group. If omitted,
the default value for type is 0.
title:
String expression displayed in the title bar of the dialog box. If you omit the
argument title, MsgBox has no default title.
The value returned by the MsgBox function indicates which button has been
selected, as shown below:
Value
Meaning
OK button selected.
No button selected.
If the dialog box displays a Cancel button, pressing the Esc key has the same effect
as choosing Cancel.
Example:
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?"
Define message.
Define buttons.
Define
Define title.
Define topic
context.
Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
MyString = "Yes"
Else
MyString = "No"
End If
Name Statement
Name oldname As newname
The parameters oldname and newname are strings that can optionally contain a path.
Now Function
Now
Returns a date that represents the current date and time according to the setting of the
computers system date and time
The Now function returns a Variant data type containing a date and time that are
stored internally as a double. The number is a date and time from January 1, 100
through December 31, 9999, where January 1, 1900 is 2. Numbers to the left of the
decimal point represent the date and numbers to the right represent the time.
Example:
Sub Main ()
Dim Today
Today = Now
End Sub
Oct Function
Oct (num)
Example:
Sub Main ()
Dim Msg, Num
Declare variables.
OKButton
OKBUTTON starting x position, starting y position, width, Height
Example:
Sub Main ()
Begin Dialog DialogName1 60, 60, 160, 70, "ASC - Hello"
TEXT 10, 10, 28, 12, "Name:"
TEXTBOX 42, 10, 108, 12, .nameStr
TEXTBOX 42, 24, 108, 12, .descStr
CHECKBOX 42, 38, 48, 12, "&CHECKME", .checkInt
OKBUTTON 42, 54, 40, 12
End Dialog
Dim Dlg1 As DialogName1
Dialog Dlg1
MsgBox Dlg1.nameStr
MsgBox Dlg1.descStr
MsgBox Dlg1.checkInt
End Sub
On Error
On Error { GoTo line | Resume Next | GoTo 0 }
Enables error-handling routine and specifies the line label of the error-handling
routine.
The line parameter refers to a label. That label must be present in the code or an
error is generated.
Example:
Sub Main
On Error GoTo dude
Dim x as object
x.draw
jpe
print 1/0
Division by zero
Err.Raise 6
MsgBox "Back"
MsgBox "Jack"
Exit Sub
dude:
MsgBox "HELLO"
Print Err.Number, Err.Description
Resume Next
MsgBox "Should not get here!"
MsgBox "What?"
End Sub
5:
6:
"Overflow";
7:
"Out of memory";
9:
Open Statement
Open filename$ [For mode] [Access access] As [#]filenumber
You must open a file before any I/O operation can be performed on it.
Description
file
mode
Access
filenumber
If file doesnt exist, it is created when a file is opened for Append, Binary or Output
modes.
The argument mode is a reserved word that specifies one of the following file modes.
Mode
Description
Input
Output.
Append Sequential output mode. Append sets the file pointer to the end of the file. A
Print # or Write # statement then extends (appends to) the file.
The argument access is a reserved word that specifies the operations that can be
performed on the opened file. If the file is already opened by another process and the
specified type of access is not allowed, the Open operation fails and a Permission
denied error occurs. The Access clause works only if you are using a version of MSDOS that supports networking (MS-DOS version 3.1 or later). If you use the Access
clause with a version of MS-DOS that doesnt support networking, a feature
unavailable error occurs. The argument access can be one of the following reserved
words.
Access type
Description
Read
Write
Read Write
The following example writes data to a test file and reads it back.
Example:
Sub Main ()
Construct message.
Loop
Close #2
Display message.
End Sub
The Option Base statement is never required. If used, it can appear only once in a
module, it can occur only in the Declarations section, and must be used before you
declare the dimensions of any arrays.
The value of number must be either 0 or 1. The default base is 0.
The To clause in the Dim, Global, and Static statements provides a more flexible
way to control the range of an arrays subscripts. However, if you dont explicitly set
the lower bound with a To clause, you can use Option Base to change the default
lower bound to 1.
The example uses the Option Base statement to override the default base array
subscript value of 0.
Example:
Option Base 1
Sub Main
Dim A(), Msg, NL
Declare variables.
NL = Chr(10)
Define newline.
The Option explicit statement is used outside of the script in the declarations section.
This statement can be contained in a declare file or outside of any script in a file or
buffer. If this statement is contained in the middle of a file the rest of the compile
buffer will be affected.
Example:
Option Explicit
Sub Main
Print y
because y is not explicitly dimmed an error
will occur.
End Sub
Print Method
Print [expr, expr...]
Example:
Sub PrintExample ()
Dim Msg, Pi
Let Pi = 4 * _Atn(1)
Print # Statement
Print # filenumber, [ [{Spc(n) | Tab(n)}][ expressionlist] [{;
| ,}] ]
filenumber:
Number used in an Open statement to open
a sequential file. It can be any
number of an open file. Note that the
number sign (#) preceding filenumber is not optional.
Spc(n):
Name of the Basic function optionally used to insert n spaces into the printed
output. Multiple use is permitted.
Tab(n):
Name of the Basic function optionally used to tab to the nth column before printing
expressionlist. Multiple use is permitted.
expressionlist :
Numeric and/or string expressions to be written to the file.
{;|,}
Character that determines the position of the next character printed. A semicolon
means the next character is printed immediately after the last character; a comma
means the next character is printed at the start of the next print zone. Print zones
begin every 14 columns. If neither character is specified, the next character is printed
on the next line.
If you omit expressionlist, the Print # statement prints a blank line in the file, but you
must include the comma. Because Print # writes an image of the data to the file, you
must delimit the data so it is printed correctly. If you use commas as delimiters, Print
# also writes the blanks between print fields to the file.
The Print # statement usually writes Variant data to a file the same way it writes any
other data type. However, there are some exceptions:
If the data being written is a Variant of VarType 0 (Empty), Print # writes nothing to
the file for that data item.
If the data being written is a Variant of VarType 1 (Null), Print # writes the literal
#NULL# to the file.
If the data being written is a Variant of VarType 7 (Date), Print # writes the date to
the file using the Short Date format defined in the WIN.INI file. When either the date
or the time component is missing or zero, Print # writes only the part provided to the
file.
Example:
Sub Main
Dim I, FNum, FName Declare variables.
For I = 1 To 3
FNum = FreeFile
Write string to
"line";
Next I
Close
End Sub
Sub Main ()
Dim FileData, Msg, NL
NL = Chr(10)
Declare variables.
Define newline.
Close
Open "TESTFILE" for Input As #2
Construct message.
MsgBox Msg
Loop
Close
Display message.
End Sub
Randomize Statement
Randomize[number]
The Randomize statement has one optional parameter number. This parameter can be
any valid number and is used to initialize the random number generator. If you omit
the parameter then the value returned by the Timer function is used as the default
parameter to seed the rando number generator.
Example:
Sub Main
Dim MValue
Randomize
End Sub
ReDim Statement
ReDim varname(subscripts)[As Type][,varname(subscripts)]
The ReDim statement is used to size or resize a dynamic array that has already been
declared using the Dim statement with empty parentheses. You can use the ReDim
statement to repeatedly change the number of elements in and array but not to
change the number of dimensions in an array or the type of the elements in the array.
Example:
Sub Main
End Sub
Rem Statement
Rem remark remark
Example:
Rem This is a remark
Sub Main()
' Declare
Do
Answer = InputBox("Enter a value from 1 to 3.")
Answer = 2
If Answer >= 1 And Answer <= 3 Then
Exit Do
Do...Loop.
Else
Beep
not in range.
' Beep if
End If
Loop
MsgBox "You entered a value in the proper range."
End Sub
Right Function
Right (stringexpression, n )
Example:
The example uses the Right function to return the first of
two words
input by the user.
Sub Main ()
Dim LWord, Msg, RWord, SpcPos, UsrInp
variables.
Declare
print UsrInp
SpcPos = InStr(1, UsrInp, " ")
Find space.
If SpcPos Then
LWord = Left(UsrInp, SpcPos - 1)
print "LWord: ";
LWord
Get right
RmDir Statement
RmDir path
Example:
This sample shows the functions mkdir (Make Directory)
and rmdir (Remove Directory)
Sub Main
Dim dirName As String
dirName = "t1"
mkdir dirName
mkdir "t2"
MsgBox "Directories: t1 and t2 created. Press OK to remove
them"
rmdir "t1"
rmdir "t2"
End Sub
Rnd Function
Rnd (number)
Example:
Rnd Function Example
Sub Main ()
Declare variables.
Second Function
Second (number)
Returns an integer that is the second portion of the minute in the time parameter.
Example:
Format Function Example
Sub Main
MsgBox Now
MsgBox MyTime
Returns "17:4:23".
Returns "23".
User-defined formats.
MsgBox Format(5459.4, "##,##0.00")
MsgBox Format(334.9, "###0.00")
Returns "334.90".
Returns "500.00%".
Returns "5,459.40".
Returns "hello".
End Sub
Seek Function
Seek (filenumber)
The parameter filenumber is used in the open statement and must be a valid numeric
expression.
Seek returns a number that represents the byte position where the next operation is to
take place. The first byte in the file is at position 1.
Example:
Sub Main
Open "TESTFILE" For Input As #1
Print Seek(1)
Loop
Close #1
Close file.
End Sub
Seek Statement
Seek filenumber, position
The parameter filenumber is used in the open statement and must be a valid numeric
expression, the parameter position is the number that indicates where the next read or
write is to occur. In Cypress Enable Basic position is the byte position relative to the
beginning of the file.
Seek statement sets the position in a file for the next read or write
Example:
Sub Main
Open "TESTFILE" For Input As #1
For i = 1 To 24 Step 3
Seek #1, i
Print MyChar
Next i
Close #1
Close file.
End Sub
The syntax supported by the Select statement includes the To keyword, a coma
delimited list and a constant or variable.
End Select
Example:
This rather tedious test shows nested select statements and
if uncommented,
the exit for statement
Sub Test ()
For x = 1 to 5
print x
Select Case x
Case 2
Print "Outer Case Two"
Case 3
Print "Outer Case Three"
Exit For
Select Case x
Case 2
Print "Inner Case Two"
Case 3
Print "Inner Case Three"
Exit For
Case Else Must be something else.
Print "Inner Case Else:", x
End Select
SendKeys Function
SendKeys (Keys, [wait])
Sends one or more keystrokes to the active window as if they had been entered at the
keyboard
The SendKeys statement has two parameters. The first parameter keys is a string and
is sent to the active window. The second parameter wait is optional and if omitted is
assumed to be false. If wait is true the keystrokes must be processed before control is
returned to the calling procedure.
Example:
Sub Main ()
Dim I, X, Msg
Declare variables.
X = Shell("Calc.exe", 1)
For I = 1 To 5
Shell Calculator.
Send keystrokes to
AppActivate "Calculator"
End Sub
Set Statement
Set Object = {[New] objectexpression | Nothing}
Example:
Sub Main
Dim visio As Object
Set visio = CreateObject( "visio.application" )
Dim draw As Object
Set draw = visio.Documents
draw.Open "c:\visio\drawings\Sample1.vsd"
MsgBox "Open docs: " & draw.Count
Dim page As Object
Set page = visio.ActivePage
Dim red As Object
Set red = page.DrawRectangle (1, 9, 7.5, 4.5)
red.FillStyle = "Red fill"
visio.Quit
End Sub
Shell Function
Shell ( app [, style])
The shell function has two parameters. The first one, app is the name of the program
to be executed. The name of the program in app must include a .PIF, .COM, .BAT,
or .EXE file extension or an error will occur. The second argument, style is the
number corresponding to the style of the window . It is also optional and if omitted
the program is opened minimized with focus.
Window styles:
Normal with focus 1,5,9
Minimized with focus (default) 2
Maximized with focus 3
normal without focus 4,8
minimized without focus 6,7
Example:
This example uses Shell to leave the current application and
run the
Calculator program included with Microsoft Windows; it then
uses the SendKeys statement to send keystrokes to add some
numbers.
Sub Main ()
Dim I, X, Msg
Declare variables.
X = Shell("Calc.exe", 1)
For I = 1 To 5
Shell Calculator.
Send keystrokes to
AppActivate "Calculator"
End Sub
Sin Function
Sin (rad)
Example:
Sub Main ()
pi = 4 * Atn(1)
rad = 90 * (pi/180)
x = Sin(rad)
print x
End Sub
Space Function
Space[$] (number )
Example:
This sample shows the space function
Sub Main
End Sub
Sqr Function
Sqr(num)
The parameter num must be a valid number greater than or equal to zero.
Example:
Sub Form_Click ()
Dim Msg, Number
Declare variables.
End Sub
Static Statement
Static variable
Used to declare variables and allocate storage space. These variables will retain their
value through the program run
Example:
This example shows how to use the static keyword to retain
the value of
the variable i in sub Joe. If Dim is used instead of Static
then i
is empty when printed on the second call as well as the
first.
Sub Main
For i = 1 to 2
Joe 2
Next i
End Sub
Static i
print i
i = i + 5
print i
End Sub
Stop Statement
Stop
Example:
Sub main ()
Dim x,y,z
For x = 1 to 5
For y = 1 to 5
For z = 1 to 5
Print "Looping" ,z,y,x
Next z
Next y
Stop
Next x
End Sub
Str Function
Str(numericexpr)
Example:
Sub main ()
Dim msg
a = -1
msgBox "Num = " & Str(a)
MsgBox "Abs(Num) =" & Str(Abs(a))
End Sub
StrComp Function
StrComp( nstring1,string2, [compare]
Example:
Sub Main
Define variables.
Returns -1.
print MComp
MComp = StrComp(MStr1, MStr2)
Returns -1.
print MComp
MComp = StrComp(MStr2, MStr1)
Returns 1.
print MComp
End Sub
String Function
String ( numeric, charcode )
Example:
Sub Main
Dim MString
MString = String(5, "*")
Returns "*****".
Returns "44444".
Returns "TTTTTTTTTT".
Print MString
End Sub
Sub Statement
Sub SubName [(arguments)]
Dim [variable(s)]
[statementblock]
[Exit Function]
End Sub
The optional ByVal parameter specifies that the variable is [passed by value instead
of by reference (see ByRef and ByVal in this manual). The optional As type
parameter is used to specify the data type. Valid types are String, Integer, Double,
Long, and Varaint (see Variable Types in this manual).
Example:
Sub Main
Dim DST As String
DST = "t1"
mkdir DST
mkdir "t2"
End Sub
Tan Function
Tan(angle)
Example:
This sample program show the use of the Tan function
Sub Main ()
Dim Msg, Pi
Declare variables.
Pi = 4 * Atn(1)
Calculate Pi.
Display results.
x = Tan(Pi/4)
MsgBox
End Sub
Text Statement
Text Starting X position, Starting Y position, Width, Height,
Label
Example:
Sub Main ()
Begin Dialog DialogName1 60, 60, 160, 70, "ASC - Hello"
TEXT 10, 10, 28, 12, "Name:"
TEXTBOX 42, 10, 108, 12, .nameStr
TEXTBOX 42, 24, 108, 12, .descStr
CHECKBOX 42, 38, 48, 12, "&CHECKME", .checkInt
OKBUTTON 42, 54, 40, 12
End Dialog
Dim Dlg1 As DialogName1
Dialog Dlg1
MsgBox Dlg1.nameStr
MsgBox Dlg1.descStr
MsgBox Dlg1.checkInt
End Sub
TextBox Statement
TextBox Starting X position, Starting Y position, Width,
Height, Default String
Example:
Sub Main ()
Begin Dialog DialogName1 60, 60, 160, 70, "ASC - Hello"
TEXT 10, 10, 28, 12, "Name:"
TEXTBOX 42, 10, 108, 12, .nameStr
TEXTBOX 42, 24, 108, 12, .descStr
CHECKBOX 42, 38, 48, 12, "&CHECKME", .checkInt
OKBUTTON 42, 54, 40, 12
End Dialog
Dim Dlg1 As DialogName1
Dialog Dlg1
MsgBox Dlg1.nameStr
MsgBox Dlg1.descStr
MsgBox Dlg1.checkInt
End Sub
Time Function
Time[()]
Example:
Sub Main
x = Time$(Now)
Print x
End Sub
Timer Event
Timer
Example:
Sub Main
Dim TS As Single
Dim TE As Single
Dim TEL As Single
TS = Timer
TE = Timer
TT = TE - TS
Print TT
End Sub
TimeSerial - Function
TimeSerial ( hour, minute, second
Returns the time serial for the supplied parameters hour, minute, second.
Example:
Sub Main
Dim MTime
MTime = TimeSerial(12, 25, 27)
Print MTime
End Sub
TimeValue - Function
TimeValue ( TimeString
Returns a double precision serial number based of the supplied string parameter.
Midnight = TimeValue(23:59:59)
Example:
Sub Main
Dim MTime
MTime = TimeValue("12:25:27 PM")
Print MTime
End Sub
Ltrim, Rtrim and Trim all Return a copy of a string with leading, trailing or both
leading and trailing spaces removed.
Example:
This example uses the LTrim and RTrim functions to strip
leading and
trailing spaces, respectively, from a string variable. It
uses the Trim function alone to strip both types of spaces.
LCase and UCase are also shown in this example as well as the
use
of nested function calls
Sub Main
MyString = "
<-Trim->
TrimString = LTrim(MyString)
".
TrimString = "<-Trim->
TrimString = "
TrimString = "<-
TrimString = "<-
Type Statement
Type usertype
elementname As typename
[ elementname As typename]
. . .
End Type
Part
Description
Type
usertype
elementname
subscripts
typename
Once you have declared a user-defined type using the Type statement, you can
declare a variable of that type anywhere in your script. Use Dim or Static to declare a
variable of a user-defined type. Line numbers and line labels arent allowed in
Type...End Type blocks.
User-defined types are often used with data records because data records frequently
consist of a number of related elements of different data types. Arrays cannot be an
element of a user defined type in Enable.
Example:
This sample shows some of the features of user defined types
Type type1
a As Integer
d As Double
s As String
End Type
Type type2
a As String
o As type1
End Type
Type type3
b As Integer
c As type2
End Type
Sub Form_Click ()
a = 5
type1a.a = 7472
type1a.d = 23.1415
type1a.s = "YES"
type2a.a = "43 - forty three"
type2a.o.s = "Yaba Daba Doo"
type3a.c.o.s = "COS"
type2b.a = "943 - nine hundred and forty three"
type2b.o.s = "Yogi"
MsgBox type1a.a
MsgBox type1a.d
MsgBox type1a.s
MsgBox type2a.a
MsgBox type2a.o.s
MsgBox type2b.a
MsgBox type2b.o.s
MsgBox type3a.c.o.s
MsgBox a
End Sub
UBound Function
Ubound(arrayname[,dimension])
Returns the value of the largest usable subscript for the specified dimension of an
array.
Example:
This example demonstrates some of the
The lower bound
features of arrays.
Option Base 1
Sub Main
Dim a(10) As Double
MsgBox "LBound: " & LBound(a) & " UBound: " & UBound(a)
Dim i As Integer
For i = 1 to 3
a(i) = 2 + i
Next i
Print a(1),a(1),a(2), a(3)
End Sub
UCase Function
Ucase (String )
Returns a copy of String in which all lowercase characters have been converted to
uppercase.
Example:
This example uses the LTrim and RTrim functions to strip
leading and
trailing spaces, respectively, from a string variable. It
uses the Trim function alone to strip both types of spaces.
LCase and UCase are also shown in this example as well as the
use
of nested function calls
Sub Main
MyString = "
<-Trim->
TrimString = LTrim(MyString)
".
TrimString = "<-Trim->
TrimString = "
TrimString = "<-
TrimString = "<-
Val
Val(string)
Example:
Sub main
Dim Msg
Dim YourVal As Double
YourVal = Val(InputBox$("Enter a number"))
Msg = "The number you enered is: " & YourVal
MsgBox Msg
End Sub
VarType
VarType(varname)
Returns a value that indicates how the parameter varname is stored internally.
return values:
Empty
Null
Integer
Long
Single
Double
Currency
Date/Time
String
Example:
If VarType(x) = 5 Then Print "Vartype is Double"
variable type
Display
Weekday Function
Weekday(date,firstdayof week)
Returns a integer containing the whole number for the weekday it is representing.
Example:
Sub Main
x = Weekday(#5/29/1959#)
Print x
End Sub
While...Wend Statement
While condition
.
.
.
[StatementBlock]
.
.
.
Wend
While begins the while...Wend flow of control structure. Condition is any numeric or
expression that evaluates to true or false. If the condition is true the statements are
executed. The statements can be any number of valid Enable Basic statements. Wend
ends the While...Wend flow of control structure.
Example:
Sub Main
Const Max = 5
Dim A(5) As String
A(1) = "Programmer"
A(2) = "Engineer"
A(3) = "President"
A(4) = "Tech Support"
A(5) = "Sales"
Exchange = True
While Exchange
Exchange = False
For I = 1 To Max
MsgBox A(I)
Next
Wend
With Statement
With object
[STATEMENTS]
End With
Example:
This sample shows some of the features of user defined types
and the with
statement
Type type1
a As Integer
d As Double
s As String
End Type
Type type2
a As String
o As type1
End Type
Sub Main ()
With type1a
.a = 65
.d = 3.14
End With
With type2a
.a = "Hello, world"
With .o
.s = "Goodbye"
End With
End With
type1a.s = "YES"
MsgBox type1a.a
MsgBox type1a.d
MsgBox type1a.s
MsgBox type2a.a
MsgBox type2a.o.s
End Sub
Write # - Statement
Write #filenumber [,parameterlist ]
Writes and formats data to a sequential file that must be opened in output or append
mode.
A comma delimited list of the supplied parameters is written to the indicated file. If
no parameters are present, the newline character is all that will be written to the file.
Example:
Sub Main ()
Construct message.
Loop
Close #2
Display message.
End Sub
Year Function
Year(serial# )
Returns an integer representing a year between 1930 and 2029, inclusive. The
returned integer represents the year of the serial parameter.
The parameter serial# is a string that represents a date.
If serial is a Null, this function returns a Null.
Related Topics: Date, Date$ Function/Statement, Day, Hour, Month, Minute, Now,
Second.
Example:
Sub Main
MyDate = "11/11/94"
x = Year(MyDate)
print x
End Sub
PC-DMIS
Automation
Introduction
This section contains a detailed list of methods and properties for PC-DMIS
Automation Objects. The various objects are listed in alphabetical order.
A bold item is the default property or method for this object.
Note: For information on when to use or ommit parentheses, please refer to your
Basic Language documentation.
ActiveTip.TipID
STRING value representing the ID of the tip to be made active.
Read/Write String
Methods:
ActiveTip.GetShankVector
Syntax:
Automation 171
expression.GetOrigin (I, J, K)
Return Value: Boolean value representing whether the call successfully retrieved the
values or not.
expression: Required expression that evaluates to a PC-DMIS ActiveTip object.
I: Required Long variable that receives the I component of the shank vector.
J: Required Long variable that receives the J component of the shank vector.
K: Required Long variable that receives the K component of the shank vector.
ActiveTip.SetShankVector
Syntax:
expression.SetOrigin (I, J, K)
Return Value: Boolean value representing whether the call successfully set the
shank vector values.
expression: Required expression that evaluates to a PC-DMIS ActiveTip object.
I: Required Long used to set the I component of the shank vector.
J: Required Long used to set the J component of the shank vector.
K: Required Long used to set the K component of the shank vector.
AlignCommand Members
Properties:
AlignCommand.Angle
Represents the offset angles of a 3D or 2D alignment. Read/write PointData. If used
on an object other than a 3D or 2D alignment, setting this variable will do nothing,
and getting this variable will return Nothing.
AlignCommand.AboutAxis
Represents the axis about which the alignment object rotates. Read/write Long.
Remarks
This function only works for objects of type ROTATE_ALIGN,
ROTATE_CIRCLE_ALIGN, and ROTATEOFF_ALIGN. For other object types,
trying to set this property does nothing, and trying to get this property always returns
PCD_ZPLUS.
Valid Settings to set this property to are as follows:
PCD_XPLUS
PCD_XMINUS
PCD_YPLUS
172 Automation
PCD_YMINUS
PCD_ZPLUS
PCD_ZMINUS
AlignCommand.AverageError
Represents whether or not error averaging is used during the iterative alignment.
Read/write Boolean.
Remarks
This property is only valid for objects of type ITER_ALIGN. For other objects,
getting this property always returns FALSE, and setting it does nothing.
AlignCommand.Axis
Represents the axis that the alignment object uses. Read/write Long.
Remarks
This function only works for objects of type ROTATE_ALIGN,
ROTATE_CIRCLE_ALIGN, TRANS_ALIGN, and TRANSOFF_ALIGN. For other
object types, trying to set this property does nothing, and trying to get this property
always returns PCD_ZPLUS.
Valid Settings to set this property to are as follows:
PCD_XPLUS
PCD_XMINUS
PCD_YPLUS
PCD_YMINUS
PCD_ZPLUS
PCD_ZMINUS
AlignCommand.BFOffset
Represents the offsets of a 3D or 2D alignment. Read/write PointData. If used on an
object other than a 3D or 2D alignment, setting this variable will do nothing, and
getting this variable will return Nothing.
AlignCommand.CadToPartMatrix
Represents the matrix used to transform points between the cad and part alignment
systems. Read only DmisMatrix.
If used on an object other than a start alignment or a recall alignment, the identity
matrix will be returned.
AlignCommand.ExternalID
Represents the external ID. Read/write String.
Remarks
This function only works for objects of type RECALL_ALIGN and SAVE_ALIGN.
If used on an object other than a RECALL_ALIGN or SAVE_ALIGN, setting this
variable will do nothing, and getting this variable will return the empty string.
AlignCommand.FeatID
Represents the first (or only) feature ID used by this alignment object. Read/write
String.
Remarks
Automation 173
AlignCommand.FeatID2
Represents the second feature ID used by this alignment object. Read/write String.
Remarks
This function only works for objects of type ROTATE_CIRCLE_ALIGN and
EQUATE_ALIGN. If used on any other object type, setting this variable will do
nothing, and getting this variable will return the empty string.
AlignCommand.FindCad
Represents the Find Cad property status of this best fit alignment object. Read/write
Boolean.
Remarks
This function only works for objects of type BF2D_ALIGN and BF3D_ALIGN. If
used on any other object type, setting this variable will do nothing, and getting this
variable will return FALSE.
AlignCommand.ID
Represents the ID of this alignment object. Read/write String.
Remarks
This function only works for objects of type START_ALIGN and
RECALL_ALIGN. If used on any other object type, setting this variable will do
nothing, and getting this variable will return the empty string.
AlignCommand.InitID
Represents the intial ID of this alignment object. The intial ID is the ID of the
alignment to recall before modifying it with this alignment. Read/write String.
Remarks
This function only works for objects of type START_ALIGN and
RECALL_ALIGN. If used on any other object type, setting this variable will do
nothing, and getting this variable will return the empty string.
AlignCommand.MachineToPartMatrix
Represents the matrix used to transform points between the machine and part
alignment systems. Read only DmisMatrix.
If used on an object other than a start alignment or a recall alignment, the identity
matrix will be returned.
AlignCommand.MeasAllFeat
Represents the Measure All Features property of this iterative alignment object.
Read/write Boolean.
Remarks
174 Automation
This function only works for objects of type ITER_ALIGN. If used on any other
object type, setting this variable will do nothing, and getting this variable will return
FALSE.
AlignCommand.NumInputs
Returns the number of inputs to this alignment object. Read-only Long.
Remarks
This function only works for objects of type ITER_ALIGN, BF2D_ALIGN, and
BF3D_ALIGN. If used on any other object type, setting this variable will do nothing,
and getting this variable will return zero.
AlignCommand.Offset
Represents the offset property of this offset alignment object. For objects of type
TRANSOFF_ALIGN, it is the number of MM or inches to offset the alignment. For
objects of type ROTATEOFF_ALIGN, it is the number of radians to offset the
alignment. Read/write Double.
Remarks
This function only works for objects of type TRANSOFF_ALIGN and
ROTATEOFF_ALIGN. If used on any other object type, setting this variable will do
nothing, and getting this variable will return zero.
AlignCommand.Parent
Returns the parent Command object. Read-only.
Remarks
The parent of an AlignCommand object is the same underlying PC-DMIS object as
the AlignCommand object itself. Getting the parent allows you to access the generic
Command properties and methods of a given object.
AlignCommand.PointTolerance
Represents the Point Tolerance property of this alignment object. Read/write
Double.
Remarks
This function only works for objects of type ITER_ALIGN, BF2D_ALIGN, and
BF3D_ALIGN. If used on any other object type, setting this variable will do nothing,
and getting this variable will return zero.
AlignCommand.RepierceCad
Represents whether or not to repierce the cad model during the execution of this
iterative alignment object. Read/write Boolean.
Remarks
This function only works for objects of type ITER_ALIGN. If used on any other
object type, setting this variable will do nothing, and getting this variable will return
FALSE.
AlignCommand.UseBodyAxis
Represents whether or not to use the Body Axis method during the calculation of
this iterative alignment object. Read/write Boolean.
Automation 175
Remarks
This function only works for objects of type ITER_ALIGN. If used on any other
object type, setting this variable will do nothing, and getting this variable will return
FALSE.
AlignCommand.Workplane
Represents the workplane of this alignment object. It can take the values
PCD_XPLUS, PCD_XMINUS, PCD_YPLUS, PCD_YMINUS, PCD_ZPLUS, and
PCD_ZMINUS.Read/write Long.
Remarks
This function only works for objects of type ITER_ALIGN. If used on any other
object type, setting this variable will do nothing, and getting this variable will return
PCD_ZPLUS.
Methods:
AlignCommand.AddBestFitFeat
Syntax
Return Value=expression.AddBestFitFeat(ID, tolerance)
expression: Required expression that evaluates to a PC-DMIS AlignCommand
object.
ID: Required String that is the ID of the feature to add to the level set.
tolerance: Required Double that is the tolerance to associate with ID.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Remarks
This function only has an effect on objects of type BF2D_ALIGN and
BF3D_ALIGN. On objects of these types, it adds the feature with the ID ID to the
set of best fit features with tolerance tolerance. On objects of other types, it does
nothing.
AlignCommand.AddLevelFeat
Syntax
Return Value=expression.AddLevelFeat(ID)
expression: Required expression that evaluates to a PC-DMIS AlignCommand
object.
ID: Required String that is the ID of the feature to add to the level set.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Remarks
This function only has an effect on objects of type ITER_ALIGN. On objects of this
type, it adds the feature with the ID ID to the set of level features. On objects of
other types, it does nothing.
176 Automation
AlignCommand.AddOriginFeat
Syntax
Return Value=expression.AddOriginFeat(ID)
expression: Required expression that evaluates to a PC-DMIS AlignCommand
object.
ID: Required String that is the ID of the feature to add to the origin set.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Remarks
This function only has an effect on objects of type ITER_ALIGN. On objects of this
type, it adds the feature with the ID ID to the set of origin features. On objects of
other types, it does nothing.
AlignCommand.AddRotateFeat
Syntax
Return Value=expression.AddRotateFeat(ID)
expression: Required expression that evaluates to a PC-DMIS AlignCommand
object.
ID: Required String that is the ID of the feature to add to the Rotate set.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Remarks
This function only has an effect on objects of type ITER_ALIGN. On objects of this
type, it adds the feature with the ID ID to the set of rotate features. On objects of
other types, it does nothing.
Application members
Properties:
Application.ActivePartProgram
Represents the currently active part program. Read/Write PartProgram.
Automation 177
Application.Caption
The text in the title bar of the application. Read/Write String.
Application.DefaultFilePath
The directory in which the File Open dialog starts. Read/Write String.
Application.DefaultProbeFile
The name of the last chosen probe file used when creating a new part program. Read
Only String
Application.DefaultMachineName
The name of the next available machine for attaching to a part program. Read Only
String
Application.FullName
The fully qualified path name of the PC-DMIS executable. Read-only String.
Example: If the PC-DMIS executable is C:\PCDMISW\PCDLRN.EXE, the
FullName property is C:\PCDMISW\PCDLRN.EXE.
Application.Height
The height of the PC-DMIS window in screen pixels. Read/Write Long.
Application.Left
The left edge of the PC-DMIS window, measured from the left edge of the Windows
Desktop. Read/Write Long.
Remarks
The Left property is measured in screen pixels.
Application.Machines
Returns the read-only Machines collection object.
Application.Name
The file name of the PC-DMIS executable. Read-only String.
Remarks
The Name property is the default property for the Application object. If the PCDMIS executable is C:\PCDMISW\PCDLRN.EXE, the FullName property is
PCDLRN.EXE.
Application.OperatorMode
Represents whether or not you are in operator mode. TRUE when in operator mode,
FALSE otherwise. Read/Write Boolean.
Remarks
Changing into or out of operator mode makes significant changes to the appearance
and utility of PC-DMIS.
178 Automation
Application.PartPrograms
Returns the collection of part programs currently active in PC-DMIS. Read-only
PartPrograms collection.
Application.Path
Returns the directory in which the PC-DMIS executable resides. Read-only String.
Remarks
If the PC-DMIS executable is C:\PCDMISW\PCDLRN.EXE, the FullName property
is C:\PCDMISW\.
Application.StatusBar
The text on the status bar of the main PC-DMIS window. Read/Write String.
Application.Top
The top edge of the PC-DMIS window, measured from the top edge of the Windows
Desktop. Read/Write Long.
Remarks
The Top property is measured in screen pixels.
Application.UserExit
TRUE if the PC-DMIS automation engine is will shut down when the user exits PCDMIS, otherwise FALSE. Read/Write Boolean.
Application.Visible
TRUE if PC-DMIS is visible, otherwise FALSE. Read/Write Boolean.
Application.Width
The width of the PC-DMIS window in screen pixels. Read/Write Long.
Methods:
Application.Help
Syntax:
expression.Help HelpFile, HelpContext, HelpString
expression: Required expression that evaluates to a PC-DMIS Application object.
HelpFile: Required String parameter that indicates what help file to open.
HelpContext: Optional Long parameter that indicates which Context ID number in
HelpFile to open.
HelpString: Optional String parameter that indicates a string to match among
HelpFiles topics.
Remarks
If both the HelpContext and HelpString are provided, the HelpString will be ignored.
If neither is provided, the first help page is shown.
Automation 179
Application.Minimize
Syntax:
expression.Minimize
The Minimize subroutine reduces the PC-DMIS window to the taskbar.
expression: Required expression that evaluates to a PC-DMIS Application object.
Application.Maximize
Syntax:
expression.Maximize
The Maximize Subroutine expands the PC-DMIS window to full-screen size.
expression: Required expression that evaluates to a PC-DMIS Application object.
Application.Post
Syntax:
Return Value=expression.Post(Source, Destination)
expression: Required expression that evaluates to a PC-DMIS Application object.
Source: Required String that indicates the file from which to import or export.
Destination: Required String that indicates the file into which to import or export.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
The Post function tells PC-DMIS to import or export Source into Destination. It
returns TRUE if the import or export process is successful, FALSE otherwise.
Exactly one of Source and Destination must be a PC-DMIS .prg or .cad file. If it is
Source, then PC-DMIS will export based on the name of the Destination file. If the
Destination file is a PC-DMIS .prg or .cad file, then PC-DMIS will import based on
the name of the Source file.
The Source file must already exist, but the Destination file need not already exist.
Application.Quit
Syntax:
expression.Quit
The Quit function tells PC-DMIS to close. It always returns TRUE.
expression: Required expression that evaluates to a PC-DMIS Application object.
Application.Restore
Syntax:
expression.Restore
The Restore subroutine makes the PC-DMIS window open and neither maximized
nor minimized.
expression: Required expression that evaluates to a PC-DMIS Application object.
180 Automation
Application.SetActive
Syntax:
Return Value=expression.SetActive
expression: Required expression that evaluates to a PC-DMIS Application object.
Brings PC-DMIS to the foreground, making it the active application.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
ArrayIndex.GetLowerBound
Syntax:
expression.GetLowerBound (Index)
Return Value: Long representing the lower bound of the specified index set.
expression: Required expression that evaluates to a PC-DMIS ArrayIndex object.
Index: Required Long parameter that specifies which index set to use in retrieving
the lower bound.
Remarks
Retrieves the lower bound of the specified index set.
Automation 181
ArrayIndex.GetUpperBound
Syntax:
expression.GetUpperBound (Index)
Return Value: Long representing the upper bound of the specified index set.
expression: Required expression that evaluates to a PC-DMIS ArrayIndex object.
Index: Required Long parameter that specifies which index set to use in retrieving
the upper bound.
Remarks
Retrieves the upper bound of the specified index set.
ArrayIndex.RemoveIndexSet
Syntax:
expression.RemoveIndexSet (Index)
expression: Required expression that evaluates to a PC-DMIS ArrayIndex object.
Index: Required Long parameter that specifies which index set to remove.
Remarks
Removes the index set specified by index from the array index object.
ArrayIndex.SetLowerBound
Syntax:
expression.SetLowerBound (Index)
expression: Required expression that evaluates to a PC-DMIS ArrayIndex object.
Index: Required Long parameter that specifies which index set to use in setting the
lower bound.
Remarks
Sets the lower bound of the specified index set.
ArrayIndex.SetUpperBound
Syntax:
expression.SetUpperBound (Index)
expression: Required expression that evaluates to a PC-DMIS ArrayIndex object.
Index: Required Long parameter that specifies which index set to use in setting the
upper bound.
Remarks
Setting the upper bound of the specified index set.
182 Automation
Attach Members
Properties:
Attach.AttachedAlign
ID associated with an alignment in the attached program that corresponds with an
alignment in the attaching program. Read/Write String
Attach.Execute
BOOLEAN value that determines whether or not the attached part program should
be executed when PC-DMIS encounters the attached program.
Read/Write Boolean
Attach.ID
ID associated with the attached part program. This ID identies items in the attached
part program. For example, if the ID for the attach statement is PART2, then
feature F1 in the attached program can be referred to as F1:PART2.
Read/Write String
Attach.LocalAlign
ID associated with an alignment in the attaching program that corresponds to an
alignment in the attached program. Read/Write String
Attach.PartName
File name of the attached part program.
Read/Write String
Automation 183
BasicScanCommand Members
Properties
BasicScan.AutoClearPlane
Determines whether auto clearance planes mode is on or off. Read/Write
BOOLEAN.
BasicScan.BoundaryCondition
Represents the boundary condition type. Read/write of enumeration
BSBOUNDCOND_ENUM.
The allowable values have the following meaning:
BSBOUNDCOND_SPHENTRY: Represents a Spherical Boundary Condition. This
Boundary condition requires the following parameters to be set by you using
Automation Properties and/or Automation Methods : BoundaryConditionCenter,
BoundaryConditionEndApproach, Diameter, number of Crossings.
BSBOUNDCOND_PLANECROSS: Represents a Planar Boundary Condition. This
Boundary condition requires the following parameters to be set by you using
Automation Properties and/or Automation Methods : BoundaryConditionCenter,
BoundaryConditionEndApproach, BoundaryConditionPlaneV, number of Crossings.
BSBOUNDCOND_CYLINDER: Represents a Cylindrical Boundary Condition.
This Boundary condition requires the following parameters to be set by you using
Automation Properties and/or Automation Methods : BoundaryConditionCenter,
BoundaryConditionEndApproach, BoundaryConditionAxisV, Diameter, number of
Crossings.
BSBOUNDCOND_CONE: Represents a Conical Boundary Condition. This
Boundary condition requires the following parameters to be set you user using
Automation Properties and/or Automation Methods : BoundaryConditionCenter,
BoundaryConditionEndApproach, BoundaryConditionAxisV, HalfAngle, number of
Crossings.
The SetBoundaryConditionParams method should be used to set the values for:
HalfAngle
Number of Crossings
Diameter
BasicScan.BoundaryConditionAxisV
Represents the boundary condition axis vector. Read/write PointData object. This
vector is used as the axis of the Cylindrical and Conical BoundaryConditions.
BasicScan.BoundaryConditionCenter
Represents the boundary condition center. Read/write PointData object.
This Point is used by all Boundary Conditions and is the location of the Boundary
Condition.
184 Automation
BasicScan.BoundaryConditionEndApproach
Represents the boundary condition end approach vector. Read/write PointData
object.
This vector is used by all Boundary Conditions and is the Approach Vector of the
Probe as it crosses the Boundary condition.
BasicScan.BoundaryConditionPlaneV
Represents the boundary condition plane vector. Read/write PointData object.
This vector is the normal vector of the Plane used by the Plane and OldStyle
Boundary Conditions.
Boundary
Condition
Properties Required
Plane
BoundaryConditionCenter
BoundaryConditionEndApproach
BoundaryConditionPlaneV
BoundaryConditionCenter
BoundaryConditionEndApproach
BoundaryConditionAxisV
BoundaryConditionCenter
BoundaryConditionEndApproach
BoundaryConditionAxisV
BoundaryConditionCenter
BoundaryConditionEndApproach
Cone
Cylinder
Sphere
BasicScan.BoundaryPointCount
Indicates the number of boundary points to used in a patch scan. Read/Write LONG.
Individual boundary points can be set or retrieved via the
"BasicScan.GetBoundaryPoint" and "BasicScan.SetBoundaryPoint" methods on
page 194.
BasicScan.DisplayHits
Determines whether hits of the scan are displayed in the Edit window or not.
Read/Write BOOLEAN.
BasicScan.Filter
Represents the filter type. Read/write of enumeration BSF_ENUM.
The allowable values have the following meaning:
BSF_DISTANCE: PC-DMIS determines each hit based on the set increment and the
last two measured hits. The approach of the probe is perpendicular to the line
between the last two measured hits. The probe will stay on the cut plane. PC-DMIS
will start at the first boundary point and continue taking hits at the set increment,
stopping when it satisfies the Boundary Condition. In the case of a continous scan,
PC-DMIS would filter the data from the CMM and keep only the hits that are apart
by at least the increment. Both DCC and Manual scans can use this filter.
Automation 185
PC-DMIS will again measure the angle between the newest hit and the two previous
hits. It will continue to erase the last hit and drop the increment value to one quarter
of the increment until the measured angle is within the range defined, or the
minimum value of the increment is reached.
If the measured angle is less than the minimum angle, PC-DMIS will double the
increment for the next hit. (If this is greater than the maximum increment value it
will take the hit at the maximum increment.) PC-DMIS will again measure the angle
between the newest hit and the two previous hits. It will continue to double the
increment value until the measured angle is within the range defined, or the
maximum increment is reached. Only DCC scans should use this filter.
BasicScan.HitType
Represents the type of hit to use. Read/write of enumeration BSCANHIT_ENUM.
The allowable values have the following meaning:
BSCANHIT_VECTOR use vector hits for this scan
BSCANHIT_SURFACE use surface hits for this scan
BSCANHIT_EDGE use edge hits for this scan.
BSCANHIT_BASIC use basic hits for this scan. Only Manual scans use this hit
type. Currently there are no Manual BasicScans.
Remarks
Not every hit type can be used with every method and filter combination.
Method
EdgeHit
Vector
Hit
Surface
Hit
Basic
Hit
Linear
Edge
Circle
186 Automation
Cylinder
Str Line
Center
BasicScan.Method
Represents the method type for this scan. Read/write of enumeration
BSMETHOD_ENUM.
The allowable values have the following meaning:
BSCANMETH_LINEAR: This method will scan the surface along a line. This
procedure uses the starting and ending point for the line, and also includes a direction
point. The probe will always remain within the cut plane while doing the scan.
BSCANMETH_EDGE: This method will scan the Edge of the Surface in a Touch
Trigger mode.
BSCANMETH_CIRCLE: This method will scan around a Circle in High Speed,
Continous contact mode.
BSCANMETH_CYLINDER: This method will scan around a Cylinder in High
Speed, Continous contact mode.
BSCANMETH_STRAIGHTLINE: This method will scan a straight line in a plane in
High Speed , Continous contact mode.
BSCANMETH_CENTER: This method will find a Low Point on a surface.
Remarks
The Method type defines the geometry of the feature to be scanned and has
parameters that need to be set properly before scanning. The parameters can be set
using the SetMethodParams method.
BasicScan.MethodCutPlane
Represents the methods cut plane vector. Read/write PointData object.
BasicScan.MethodEnd
Represents the scans end point. Read/write PointData object.
BasicScan.MethodEndTouch
Represents the methods end touch vector. Read/write PointData object.
BasicScan.MethodInitDir
Represents the methods initial direction vector. Read/write PointData object.
BasicScan.MethodInitTopSurf
Represents the initial Surface Vector for the Edge method. Read/write PointData
object.
BasicScan.MethodInitTouch
Represents the methods initial touch vector. Read/write PointData object.
Automation 187
BasicScan.MethodStart
Represents the scans start point. Read/write PointData object.
Method
Method
Start
Method
End
Method
CutPlane
Method
InitDir
Method
InitTouch
Method
InitTopSurf
Method
EndTouch
Linear
Edge
Circle
Cylinder
Y
Y
Y
Y
Y
Y
-
Y
Y
Y
Y
Y
-
Y
Y
Y
Y
Y
-
Y
Y
-
Str Line
Center
BasicScan.NominalMode
Represents how to determine the nominals for this scan. Read/write of enumeration
BSCANNMODE_ENUM.
The allowable values have the following meaning:
BSCANNMODE_FINDCADNOMINAL: This mode would find the Nominal data
from CAD after scanning. This mode is useful only when CAD surface data is
available.
SCANNMODE_MASTERDATA: This mode keeps the data scanned the first time
as Master data.
BasicScan.OperationMode
Represents mode of operation of the scan . Read/write of enumeration
BSOPMODE_ENUM.
The allowable values have the following meaning:
BSCANOPMODE_REGULARLEARN: When this mode is used, PC-DMIS will
execute the scan as though it is learning it. All learned measured data will replace the
new measured data. The nominal will be re-calculated depending on the Nominals
mode.
BSCANOPMODE_DEFINEPATHFROMHITS: This mode is available only when
using analog probe heads that can do continuous contact scanning. When this option
is selected, PC-DMIS allows the controller to define a scan. PC-DMIS gathers all
hit locations from the editor and passes them onto the controller for scanning. The
controller will then adjust the path allowing the probe to pass through all the points.
The data is then reduced according to the increment provided and the new data will
replace any old measured data. Currently, this value cannot be used through
Automation since there is no method provided to define a path.
BSCANOPMODE_HIGHSPEEDFEATUREBASED: This execute mode is
available only for Analog Probe Heads. When this is selected, PC-DMIS uses the
built-in High Speed scanning capability of the controller to execute a scan.
Example: If you selected a Circle scan, PC-DMIS would use a corresponding
Circle scanning command in the controller and pass on the parameters to the
controller to execute. In this case, PC-DMIS does not control execution of the scans.
188 Automation
Regular
Learn
Defined
Path
Linear
Edge
Circle
Cylinder
Feature
Based
Normal
Str Line
Center
BasicScan.SinglePoint
Determines whether single point mode is on or off. Read/Write BOOLEAN.
When on, each point will be considered as a single measured point.
Methods:
BasicScan.GetBoundaryConditionParams
Syntax
Return Value=expression. GetBoundaryConditionParams (nCrossings,
dRadius, dHalfAngle)
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
nCrossing: Required Long variable that gets the number of crossings for this
boundary condition. The scan would stop after the probe crosses (breaks) the
Boundary Condition like a Sphere, Cylinder, Cone, or a Plane the given number of
times.
dRadius: Required Double variable that gets the radius of the boundary condition.
This is used by the Spherical and Cylindrical Boundary Conditions.
dHalfAngle: Required Double variable that gets the half-angle of the cone-type
boundary condition, or gets zero if the boundary condition is not of cone type.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Remarks
BasicScan.GetBoundaryPoint
Syntax
Return Value=expression. GetBoundaryPoint (Index, X,Y, Z)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Automation 189
BasicScan.GetFilterParams
Syntax
Return Value=expression. GetFilterParams (dCutAxisLocation, nAxis,
dMaxIncrement, dMinIncrement, dMaxAngle, dMinAngle)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
dCutAxisLocation: Not used.
nAxis: Required Long variable that gets the cut axis. Returns non-zero only for axis
filters. For axis filters, 0 means the X axis, 1 means the Y-axis, and 2 means the Zaxis.
dMaxIncrement: Required Double variable that gets the maximum increment. For
fixed-length filters, this is simply the fixed increment for Variable Distance Filters.
dMinIncrement: Required Double variable that gets the minimum increment.
dMaxAngle: Required Double variable that gets the maximum angle used in
Variable Distance Filters.
dMinAngle: Required Double variable that gets the minimum angle
used in Variable Distance Filters.
Remarks
Filter
GetFilterParams (dCutAxisLocation,
nAxis, dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle)
Distance
BodyAxisDistance
VariableDistance
,,dMaxIncrement
,nAxis, dMaxIncrement
,,dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle
BasicScan.GetHitParams
Syntax
Return Value=expression. GetHitParams (nInitSamples, nPermSamples,
dSpacer, dIndent, dDepth)
190 Automation
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
nInitSamples: Required Long variable that gets the number of initial sample hits for
the hits in this scan. It always returns zero for basic hits and vector hits.
nPermSamples: Required Long variable that gets the number of permanent sample
hits for the hits in this scan. It always returns zero for basic hits and vector hits.
dSpacer: Required Double variable that gets the spacing of the sample hits from the
hit center. It always returns zero for basic hits and vector hits.
dIndent: Required Double variable that gets the indent of the sample hits from the hit
center. It always returns zero for basic hits, vector hits, and surface.
dDepth: Required Double variable that gets the depth of the sample hits from the hit
center. It always returns zero for basic hits, vector hits, and surface.
BasicScan.GetMethodParams
Syntax
Return Value=expression. GetMethodParams (bIn, bCenteringType,
nCenteringDirection, dDiameter, dArcAngle, dDepth, dPitch)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
bIn: Required variable that gets 0 for Inside scans, 1 for Outside scans, and 2 for
Plane Circle scans.
bCenteringType: Required Variable for Centering Scans that gets 0 for Axis
Centering and 1 for Plane centering.
nCenteringDirection: Required Long variable that takes a +1 for measurement with
the direction of the probe and 1 for against the direction of probe.
dDiameter: Required Double variable that gets the diameter of the circle or cylinder
scan, and zero otherwise.
dArcAngle: Required Double variable that gets arc angle for circle and cylinder
scans.
dDepth: Required Double variable that gets the depth for cylinder scans, and zero
otherwise.
dPitch: Required Double variable that gets a Pitch for Cylinder scans.
Remarks
Automation 191
Method
Linear
Edge
Circle
Cylinder
Str Line
Center
None
None
bIn, , , dDiameter, dArcAngle, dDepth
bIn, , , dDiameter, dArcAngle, dDepth, dPitch
None
, bCenteringType, nCenteringDirection
BasicScan.GetMethodPointData
Syntax
Return Value=expression. GetMethodPointData (MethodStart,
MethodEnd, MethodInitTouch, MethodEndTouch, MethodInitDir,
MethodCutPlane)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
MethodStart: Required PointData object that gets the MethodStart property.
MethodEnd: Required PointData object that gets the MethodEnd property.
MethodInitTouch: Required PointData object that gets the MethodInitTouch
property.
MethodEndTouch: Required PointData object that gets the MethodEndTouch
property.
MethodInitDir: Required PointData object that gets the MethodInitDir property.
MethodCutPlane: Required PointData object that gets the MethodCutPlane
property.
Remarks
If scan is a BasicScanCommand object, and MS, ME, MIT, MET, MID,and MCP
are all Dimensioned as Object, the following are equivalent:
scan.GetMethodParams MS,ME,MIT,MET,MID,MCP
set
set
set
set
set
set
MS = scan.MethodStart
ME = scan.MethodEnd
MIT = scan.MethodInitTouch
MET = scan.MethodEndTouch
MID = scan.MethodInitDir
MCP = scan.MethodCutPlane
This method is provided as a shortcut to getting these commonly used properties all
at once.
BasicScan.GetNomsParams
Syntax
Return Value=expression. GetNomsParams (dFindNomsTolerance,
dSurfaceThickness, dEdgeThickness)
192 Automation
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
dFindNomsTolerance: Required Double variable that gets the Find Noms tolerance
and is used only when the NominalMode property is
BSCANNMODE_FINDCADNOMINAL.
dSurfaceThickness: Required Double variable that gets the surface thickness and is
used only when the NominalMode property is
BSCANNMODE_FINDCADNOMINAL.
dEdgeThickness: Required Double variable that gets the edge thickness and is used
only when the NominalMode property is BSCANNMODE_FINDCADNOMINAL
and when the Method property is BSCANMETH_EDGE.
BasicScan.GetParams
Syntax
Return Value=expression. GetParams (Method, Filter,
OperationMode, HitType, NominalMode, BoundaryCondition)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
Method: Required Long variable that gets the Method property.
Filter: Required Long variable that gets the Filter property.
OperationMode: Required Long variable that gets the OperationMode property.
HitType: Required Long variable that gets the HitType property.
NominalMode: Required Long variable that gets the NominalMode property.
BoundaryCondition: Required Long variable that gets the BoundaryCondition
property.
Remarks
If scan is a BasicScanCommand object, and M, F, O, H, N,and B are all
Dimensioned as Object, the following are equivalent:
scan.GetParams M, F, O, H, N, B
M
F
O
H
N
B
=
=
=
=
=
=
scan.Method
scan.Filter
scan.OperationMode
scan.HitType
scan.NominalMode
scan.BoundaryCondition
This method is provided as a shortcut to getting these commonly used properties all
at once.
BasicScan.SetBoundaryConditionParams
Syntax
Return Value=expression.SetBoundaryConditionParams (nCrossings,
dRadius, dHalfAngle)
Automation 193
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
nCrossing: Required Long that sets the number of crossings for this boundary
condition.
dRadius: Required Double that sets the radius of the boundary condition.
dHalfAngle: Required Double that sets the half-angle of the cone-type boundary
condition, or is ignored if the boundary condition is not of cone type.
Remarks
BasicScan.SetBoundaryPoint
Syntax
Return Value=expression.SetBoundaryPoint (Index, X,Y, Z)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
Index: Required Long which indicates which boundary point to set.
X: Required Long that indicates the X value of the bounday point.
Y: Required Long that indicates the Y value of the bounday point.
Z: Required Long that indicates the Z value of the bounday point.
Remarks
This function works with patch scans. Use the boundarypointcount property to set
the number of boundary points.
BasicScan.SetFilterParams
Syntax
Return Value=expression.SetFilterParams (dCutAxisLocation, nAxis,
dMaxIncrement, dMinIncrement, dMaxAngle, dMinAngle)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
dCutAxisLocation: Not used
nAxis: Required Long that sets the cut axis. It is used only for axis filters. For axis
filters, 0 means the X axis, 1 means the Y-axis, and 2 means the Z-axis.
dMaxIncrement: Required Double that sets the maximum increment. For fixedlength filters, this is simply the fixed increment
dMinIncrement:. Required Double that sets the minimum increment.
dMaxAngle: . Required Double that sets the maximum angle.
194 Automation
SetFilterParams (dCutAxisLocation,
nAxis, dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle)
Distance
BodyAxisDistance
VariableDistance
,,dMaxIncrement
,nAxis, dMaxIncrement
,,dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle
BasicScan.SetHitParams
Syntax
Return Value=expression.SetHitParams (nInitSamples, nPermSamples,
dSpacer, dIndent, dDepth)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
nInitSamples: Required Long that sets the number of initial sample hits for the hits
in this scan. It is ignored for basic hits and vector hits.
nPermSamples: Required Long that sets the number of permanent sample hits for the
hits in this scan. It is ignored for basic hits and vector hits.
dSpacer: Required Double that sets the spacing of the sample hits from the hit
center. It is ignored for basic hits and vector hits.
dIndent: Required Double that sets the indent of the sample hits from the hit center.
It is ignored for basic hits, vector hits, and surface.
dDepth: Required Double that sets the depth of the sample hits from the hit center. It
is ignored for basic hits, vector hits, and surface.
BasicScan.SetMethodParams
Syntax
Return Value=expression.SetMethodParams (bIn, bCenteringType,
nCenteringDirection, dDiameter, dArcAngle, dDepth, dPitch)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
bIn: Required variable that sets 0 for Inside scans, 1 for Outside scans, nd 2 for Plane
Circle scans.
bCenteringType: Required Variable for Centering Scans that sets 0 for Axis
Centering and 1 for Plane centering.
nCenteringDirection: Required Long variable that sets +1 for measurement with the
direction of the probe and 1 for against the direction of probe.
Automation 195
dDiameter: Required Double variable that sets the diameter of the circle or cylinder
scan, and zero otherwise.
dArcAngle: Required Double variable that sets arc angle for circle and cylinder
scans.
dDepth: Required Double variable that sets the depth for circle and cylinder scans,
and zero otherwise.
dPitch: Required Double variable that sets Pitch for Cylinder scans.
Remarks
Method
Linear
Edge
Circle
Cylinder
Str Line
Center
None
None
bIn, , , dDiameter, dArcAngle, dDepth
bIn, , , dDiameter, dArcAngle, dDepth, dPitch
None
, bCenteringType, nCenteringDirection
BasicScan.SetMethodPointData
Syntax
Return Value=expression.SetMethodPointData (MethodStart, MethodEnd,
MethodInitTouch, MethodEndTouch, MethodInitDir, MethodCutPlane)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
MethodStart: Required PointData object that sets the MethodStart property.
MethodEnd: Required PointData object that sets the MethodEnd property.
MethodInitTouch: Required PointData object that sets the MethodInitTouch
property.
MethodEndTouch: Required PointData object that sets the MethodEndTouch
property.
MethodInitDir: Required PointData object that sets the MethodInitDir property.
MethodCutPlane: Required PointData object that sets the MethodCutPlane property.
Remarks
If scan is a BasicScanCommand object, and MS, ME, MIT, MET, MID,and MCP
are all Dimensioned as Object, the following are equivalent:
scan.SetMethodParams MS,ME,MIT,MET,MID,MCP
set
set
set
set
set
set
196 Automation
scan.MethodStart = MS
scan.MethodEnd = ME
scan.MethodInitTouch = MIT
scan.MethodEndTouch = MET
scan.MethodInitDir = MID
scan.MethodCutPlane = MCP
This method is provided as a shortcut to setting these commonly used properties all
at once.
BasicScan.SetNomsParams
Syntax
Return Value=expression.SetNomsParams (dFindNomsTolerance,
dSurfaceThickness, dEdgeThickness)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
dFindNomsTolerance: Required Double that sets the Find Noms tolerance.
dSurfaceThickness: Required Double that sets the surface thickness.
dEdgeThickness: Required Double that sets the edge thickness.
Remarks
BasicScan.SetParams
Syntax
Return Value=expression.SetParams (Method, Filter, OperationMode,
HitType, NominalMode, BoundaryCondition)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS BasicScanCommand
object.
Method: Required Long that sets the Method property.
Filter: Required Long that sets the Filter property.
OperationMode: Required Long that sets the OperationMode property.
HitType: Required Long that sets the HitType property.
NominalMode: Required Long that sets the NominalMode property.
BoundaryCondition: Required Long that sets the BoundaryCondition property.
Remarks
If scan is a BasicScanCommand object, and M, F, O, H, N,and B are all
Dimensioned as Object, the following are equivalent:
scan.SetParams M, F, O, H, N, B
scan.Method = M
scan.Filter = F
scan.OperationMode = O
scan.HitType = H
scan.NominalMode = N
scan.BoundaryCondition = B
This method is provided as a shortcut to setting these commonly used properties all
at once.
Automation 197
Table 1
Method
Filters
BSCANMETH_LINEAR
BSF_DISTANCE
BSF_BODYAXISDISTANCE
BSF_VARIABLEDISTANCE
BSF_DISTANCE
BSF_VARIABLEDISTANCE
BSCANMETH_EDGE
BSCANMETH_CIRCLE
BSF_DISTANCE
BSCANMETH_CYLINDER
BSF_DISTANCE
BSCANMETH_STRAIGHTLINE
BSF_DISTANCE
BSCANMETH_CENTER
BSF_DISTANCE
Table 2
Method
NominalMode
BSCANMETH_LINEAR
BSCANNMODE_FINDCADNOMINAL
BSCANNMODE_MASTERDATA
BSCANNMODE_FINDCADNOMINAL
BSCANNMODE_MASTERDATA
BSCANNMODE_FINDCADNOMINAL
BSCANNMODE_MASTERDATA
BSCANNMODE_FINDCADNOMINAL
BSCANNMODE_MASTERDATA
BSCANNMODE_FINDCADNOMINAL
BSCANNMODE_MASTERDATA
BSCANNMODE_FINDCADNOMINAL
BSCANNMODE_MASTERDATA
BSCANMETH_EDGE
BSCANMETH_CIRCLE
BSCANMETH_CYLINDER
BSCANMETH_STRAIGHTLINE
BSCANMETH_CENTER
198 Automation
Table 3
Method
OperationMode
BSCANMETH_LINEAR
BSCANOPMODE_REGULARLEARN
BSCANOPMODE_DEFINEPATHFROMHITS
BSCANOPMODE_NORMALEXECUTION
BSCANOPMODE_REGULARLEARN
BSCANOPMODE_NORMALEXECUTION
BSCANMETH_EDGE
BSCANMETH_CIRCLE
BSCANOPMODE_HIGHSPEEDFEATUREBASED
BSCANOPMODE_NORMALEXECUTION
BSCANMETH_CYLINDER
BSCANOPMODE_HIGHSPEEDFEATUREBASED
BSCANOPMODE_NORMALEXECUTION
BSCANMETH_STRAIGHTLINE
BSCANOPMODE_HIGHSPEEDFEATUREBASED
BSCANOPMODE_NORMALEXECUTION
BSCANMETH_CENTER
BSCANOPMODE_REGULARLEARN
BSCANOPMODE_NORMALEXECUTION
Table 4
Method
BSCANMETH_LINEAR
BSCANMETH_EDGE
BSCANHIT_VECTOR
BSCANHIT_SURFACE
BSCANHIT_EDGE
BSCANMETH_CIRCLE
BSCANHIT_VECTOR
BSCANMETH_CYLINDER
BSCANHIT_VECTOR
BSCANMETH_STRAIGHTLINE
BSCANHIT_VECTOR
BSCANMETH_CENTER
HitType
BSCANHIT_VECTOR
Automation 199
Table 5
Method
BoundaryCondition
BSCANMETH_LINEAR
BSCANMETH_CIRCLE
BSBOUNDCOND_SPHENTRY
BSBOUNDCOND_PLANECROSS
BSBOUNDCOND_CYLINDER
BSBOUNDCOND_CONE
BSBOUNDCOND_SPHENTRY
BSBOUNDCOND_PLANECROSS
BSBOUNDCOND_CYLINDER
BSBOUNDCOND_CONE
None
BSCANMETH_CYLINDER
None
BSCANMETH_STRAIGHTLINE
None
BSCANMETH_CENTER
None
BSCANMETH_EDGE
CadWindow Members
Properties:
CadWindow.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
CadWindow.Height
The height of the Cad window in screen pixels. Read/Write Long.
CadWindow.Left
The left edge of the Cad window, measured from the left edge of the Windows
Desktop. Read/Write Long.
Remarks
The Left property is measured in screen pixels.
200 Automation
CadWindow.Parent
Returns the parent CadWindows object. Read-only.
CadWindow.Top
The top edge of the Cad window, measured from the top edge of the Windows
Desktop. Read/Write Long.
Remarks
The Top property is measured in screen pixels.
CadWindow.Visible
This property is TRUE if the Cad window is visible, FALSE otherwise. Read/write
Boolean.
If you make the Cad window invisible, the only way to make it visible again is to set
this property to TRUE.
CadWindow.Width
The width of the Cad window in screen pixels. Read/Write Long.
Methods:
CadWindow.Print
Syntax
Return Value=expression.Print(long Option, BOOL DrawRuler)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to CadWindow object.
Option: Required Long that indicates the type of printing to occur. Options include
Scale to Fit on Single Page, Print Visible Screen Area, Print Complete Views, and
Print Complete View w/ Current Scale. Print Visible Screen Area is only available
one of the views are zoomed. Print Complete Views is only available when multiple
views exist.
DrawRuler: Required BOOL that indicates whether rulers should be included on the
printout. This option is only available if rulers are currently turned on in the cad
drawing.
Prints the Cad window
Automation 201
CadWindows Members
Properties:
CadWindows.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
CadWindows.Count
Returns the number of CadWindow objects active in this part program. Read-only
Long.
Currently, this property always returns one.
CadWindows.Parent
Represents the parent PartProgram object. Read-only.
Methods:
CadWindows.Item
Syntax
Return Value=expression.Item(Item)
Return Value: This method returns the CadWindow object from the parent
CadWindows object. Read-only.
expression: Required expression that evaluates to FlowControlCommand object.
Item: Required Variant that denotes which CadWindow object to return.
Since there is only and exactly one CadWindow object, it does not matter what you
pass into the Item argument. For the sake of future compatibility, you should pass 1.
Calibration Members
Properties:
Calibration.Moved
BOOLEAN value that represents whether the sphere used as the calibration tool has
moved since the last tip calibration.
202 Automation
If this value is false, then the current tool calibration data is used to
calibrate the active tip.
Read/Write Boolean
Calibration.SphereID
ID of a sphere command that occurs prior to the calibration commmand. The sphere
should have identical characteristics with the tool identified by ToolID.
Read/Write String
Calibration.ToolID
ID of a previously defined calibration tool that is similar to the sphere identified by
SphereID. The tool data is used in the tip calibration or reset depending on the value
of the moved data member.
Command Members
The Command object represents a single command in PC-DMIS. Examples of
single commands in PC-DMIS are the start of a feature, a hit, the end of a feature, a
single X dimension line, an auto feature, etc.
It is also a collection object representing the collection of executions of this object so
far in the current execution or the collection of executions of this object in the
previous execution.
Properties:
Command.ActiveTipCommand
Returns an ActiveTip Command object if Command is of Type SET_ACTIVE_TIP.
Command.AlignmentCommand
Returns this Command object as an AlignCommand object if it can, Nothing
otherwise.
The Commands that have the following Type can become AlignCommand objects
are as follows:
START_ALIGN
LEVEL_ALIGN
ROTATE_ALIGN
Automation 203
TRANS_ALIGN
TRANSOFF_ALIGN
ROTATEOFF_ALIGN
SAVE_ALIGN
RECALL_ALIGN
EQUATE_ALIGN
ITER_ALIGN
BF2D_ALIGN
ROTATE_CIRCLE_ALIGN
BF3D_ALIGN
Command.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Command.ArrayIndexCommand
Returns an ArrayIndex Command object if Command is of Type ARRAY_INDEX.
Command.AttachCommand
Returns an Attach Command object if Command is of Type ATTACH_PROGRAM.
Command.BasicScanCommand
Returns this Command object as an BasicScanCommand object if it can, Nothing
otherwise. Read-only.
Only Command objects of type BASIC_SCAN_OBJECT can become
BasicScanCommand objects.
Command.CalibrationCommand
Returns a Calibration Command object if Command is of Type CALIB_SPHERE.
Command.Count
Represents the number of copies of this Command are available. If the part program
is currently being executed, it is the number of times it has been executed so far. If
the part program is not currently being executed, it is the number of times it was
executed during the previous execution cycle. If Command has never been
executed, Count has the value one. Read-only Long.
Command.DimensionCommand
Returns this Command object as an DimensionCommand object if it can, Nothing
otherwise. Read-only.
The Command objects that have the following Type can become
DimensionCommand objects:
DIMENSION_START_LOCATION
DIMENSION_X_LOCATION
DIMENSION_Y_LOCATION
DIMENSION_Z_LOCATION
DIMENSION_D_LOCATION
DIMENSION_R_LOCATION
DIMENSION_A_LOCATION
DIMENSION_T_LOCATION
DIMENSION_V_LOCATION
DIMENSION_L_LOCATION
DIMENSION_H_LOCATION
204 Automation
DIMENSION_PR_LOCATION
DIMENSION_PA_LOCATION
DIMENSION_PD_LOCATION
DIMENSION_RT_LOCATION
DIMENSION_S_LOCATION
DIMENSION_RS_LOCATION
DIMENSION_STRAIGHTNESS
DIMENSION_ROUNDNESS
DIMENSION_FLATNESS
DIMENSION_PERPENDICULARITY
DIMENSION_PARALLELISM
DIMENSION_PROFILE
DIMENSION_3D_DISTANCE
DIMENSION_2D_DISTANCE
DIMENSION_3D_ANGLE
DIMENSION_2D_ANGLE
DIMENSION_RUNOUT
DIMENSION_CONCENTRICITY
DIMENSION_ANGULARITY
DIMENSION_KEYIN
DIMENSION_TRUE_START_POSITION
DIMENSION_TRUE_X_LOCATION
DIMENSION_TRUE_Y_LOCATION
DIMENSION_TRUE_Z_LOCATION
DIMENSION_TRUE_DD_LOCATION
DIMENSION_TRUE_DF_LOCATION
DIMENSION_TRUE_PR_LOCATION
DIMENSION_TRUE_PA_LOCATION
DIMENSION_TRUE_DIAM_LOCATION
Command.DimFormatCommand
Returns a DimFormat Command object if Command is of Type
DIMENSION_FORMAT.
Command.DimInfoCommand
Returns a DimInfo Command object if Command is of Type
DIMENSION_INFORMATION.
Command.DisplayMetaFileCommand
Returns a DispMetaFile Command object if Command is of Type
DISPLAY_METAFILE.
Command.ExternalCommand
Returns an ExternalCommand Command object if Command is of Type
EXTERNAL_COMMAND.
Command.Feature
Represents the kind of feature that this Command object is. If it is not a feature it
will return zero. Otherwise it will return a value from the following list. Read-only
Long.
Type of Feature
Return Value
POINT
CIRCLE
Automation 205
SPHERE
LINE
CONE
CYLINDER
PLANE
CURVE
SLOT
SET
10
ELLIPSE
11
SURFACE
12
Command.FeatureCommand
Returns this Command object as an FeatureCommand object if it can, Nothing
otherwise. Read-only.
The Commands that have the following Type can become FeatureCommand
objects are as follows:
ANGLE_HIT
AUTO_ANGLE_FEATURE
AUTO_CIRCLE
AUTO_CORNER_FEATURE
AUTO_CYLINDER
AUTO_EDGE_FEATURE
AUTO_ELLIPSE
AUTO_HIGH_FEATURE
AUTO_NOTCH
AUTO_ROUND_SLOT
AUTO_SPHERE
AUTO_SQUARE_SLOT
AUTO_SURFACE_FEATURE
AUTO_VECTOR_FEATURE
BASIC_HIT
CONST_ALN_LINE
CONST_ALN_PLANE
CONST_BF_CIRCLE
CONST_BF_CONE
CONST_BF_CYLINDER
CONST_BF_LINE
CONST_BF_PLANE
CONST_BF_SPHERE
CONST_BFRE_CIRCLE
CONST_BFRE_CONE
CONST_BFRE_CYLINDER
CONST_BFRE_LINE
CONST_BFRE_PLANE
CONST_BFRE_SPHERE
CONST_CAST_CIRCLE
CONST_CAST_CONE
CONST_CAST_CYLINDER
CONST_CAST_LINE
CONST_CAST_PLANE
CONST_CAST_POINT
CONST_CAST_SPHERE
CONST_CONE_CIRCLE
CONST_CORNER_POINT
CONST_DROP_POINT
CONST_HIPNT_PLANE
CONST_INT_CIRCLE
CONST_INT_LINE
206 Automation
CONST_INT_POINT
CONST_MID_LINE
CONST_MID_PLANE
CONST_MID_POINT
CONST_OFF_LINE
CONST_OFF_PLANE
CONST_OFF_POINT
CONST_ORIG_POINT
CONST_PIERCE_POINT
CONST_PLTO_LINE
CONST_PLTO_PLANE
CONST_PROJ_CIRCLE
CONST_PROJ_CONE
CONST_PROJ_CYLINDER
CONST_PROJ_LINE
CONST_PROJ_POINT
CONST_PROJ_SPHERE
CONST_PRTO_LINE
CONST_PRTO_PLANE
CONST_REV_CIRCLE
CONST_REV_CONE
CONST_REV_CYLINDER
CONST_REV_LINE
CONST_REV_PLANE
CONST_REV_SPHERE
CONST_ROUND_SLOT
CONST_SET
CORNER_HIT
EDGE_HIT
GENERIC_CONSTRUCTION
MEASURED_CIRCLE
MEASURED_CONE
MEASURED_CYLINDER
MEASURED_LINE
MEASURED_PLANE
MEASURED_POINT
MEASURED_SET
MEASURED_SPHERE
SURFACE_HIT
VECTOR_HIT
Command.FileIOCommand
Returns a FileIO Command object if Command is of Type FILE_IO_OBJECT.
Command.FlowControlCommand
Returns this Command object as an FlowControlCommand object if it can,
Nothing otherwise. Read-only.
The Commands that have the following Type can become FlowControlCommand
objects are as follows:
LOOP_START
START_SUBROUTINE
CALL_SUBROUTINE
LABEL
GOTO
IF_GOTO_COMMAND
BASIC_SCRIPT
ONERROR
WHILE_COMMAND
ENDWHILE_COMMAND
IF_BLOCK_COMMAND
END_IF_COMMAND
IF_ELSE_COMMAND
END_IF_ELSE_COMMAND,
END_ELSE_COMMAND
DO_COMMAND
UNTIL_COMMAND
Automation 207
CASE_COMMAND
END_CASE_COMMAND
DEFAULT_CASE_COMMAND
END_DEFAULT_CASE_COMMAND
SELECT_COMMAND
END_SELECT_COMMAND
Command.ID
Represents the ID of the command. Read/write String.
Remarks
Only objects that have ID strings can be set. If a object does not have a string, this
property is the zero-length string .
Command.IsAlignment
Returns TRUE if the command is an alignment command type. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve an
Alignment Command object using the AlignmentCommand Property.
Command.IsActiveTip
Returns TRUE if the command is an ActiveTip command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve an ActiveTip
Command object using the ActiveTipCommand Property.
Command.IsAttach
Returns TRUE if the command is an Attach command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve an Attach
Command object using the AttachCommand Property.
Command.IsArrayIndex
Returns TRUE if the command is an ArrayIndex command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve an
ArrayIndex Command object using the ArrayIndexCommand Property.
Command.IsBasicScan
Returns TRUE if the command is a basic scan command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Basic Scan
Command object using the BasicScanCommand Property.
Command.IsCalibration
Returns TRUE if the command is a Calibration command. Read only BOOL.
Remarks
208 Automation
Commands that return TRUE for this property can successfully retrieve a Calibration
Command object using the CalibrationCommand Property.
Command.IsComment
Returns TRUE if the command is a Comment command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Comment
Command object using the CommentCommand Property.
Command.IsConstructedFeature
Returns TRUE if the command is a constructed feature. Read only BOOL.
Command.IsDCCFeature
Returns TRUE if the command is a DCC (Auto) Feature. Read only BOOL.
Command.IsDimension
Returns TRUE if the command is a dimension command type. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Dimension
Command object using the DimensionCommand Property.
Command.IsDimFormat
Returns TRUE if the command is a DimFormat command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a
DimFormat Command object using the DimFormatCommand Property.
Command.IsDimInfo
Returns TRUE if the command is a DimInfo command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a DimInfo
Command object using the DimInfoCommand Property.
Command.IsDisplayMetaFile
Returns TRUE if the command is a DispMetaFile command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a
DispMetaFile Command object using the DisplayMetaFileCommand Property.
Command.IsExternalCommand
Returns TRUE if the command is an externalcommand command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve an External
Command object using the ExternalCommand Property.
Automation 209
Command.IsFileIOCommand
Returns TRUE if the command is a FileIO command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a FileIO
command object using the FileIOCommand Property.
Command.IsFeature
Returns TRUE if the command is a feature command type. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Feature
Command object using the FeatureCommand Property.
Command.IsFlowControl
Returns TRUE if the command is a flow control command type. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Flow
Control Command object using the FlowContorlCommand Property.
Command.IsHit
Returns TRUE if the command is a one of the hit command types. Read only BOOL.
Command.IsLeitzMotion
Returns TRUE if the command is a LeitzMotion command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a
LetizMotion Command object using the LeitzMotionCommand Property.
Command.IsLoadMachine
Returns TRUE if the command is a LoadMachine command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a
LoadMachine Command object using the LoadProbeCommand Property.
Command.IsLoadProbe
Returns TRUE if the command is a LoadProbe command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a LoadProbe
Command object using the LoadProbeCommand Property.
Command.IsModal
Returns TRUE if the command is a modal command type. Read only BOOL.
Remarks
210 Automation
Commands that return TRUE for this property can successfully retrieve a Modal
Command object using the ModalCommand Property.
Command.IsMeasuredFeature
Returns TRUE if the command is a measured feature command. Read only BOOL.
Command.IsMove
Returns TRUE if the command is a move command type. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Move
Command object using the MoveCommand Property.
Command.IsOptMotion
Returns TRUE if the command is an OptMotion command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve an
OptMotion Command object using the OptMotionCommand Property.
Command.IsStatistic
Returns TRUE if the command is a Statistics command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Statistics
Command object using the StatisticCommand Property.
Command.IsScan
Returns TRUE if the command is a Scan command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a Scan
Command object using the ScanCommand Property.
Command.IsTempComp
Returns TRUE if the command is a TempComp command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a
TempComp Command object using the TempCompCommand Property.
Command.IsTraceField
Returns TRUE if the command is a TraceField command. Read only BOOL.
Remarks
Commands that return TRUE for this property can successfully retrieve a TraceField
Command object using the TraceFieldCommand Property.
Command.LeitzMotionCommand
Returns a LietzMotion Command object if Command is of Type OPTIONPROBE.
Automation 211
Command.LoadMachineCommand
Returns a LoadMachine Command object if Command is of Type
GET_MACHINE_DATA.
Command.LoadProbeCommand
Returns a LoadProbe Command object if Command is of Type
GET_PROBE_DATA.
Command.ModalCommand
Returns this Command object as a ModalCommand object if it can, Nothing
otherwise. Read-only.
The Command objects that have the following Type can become ModalCommand
objects are as follows:
CLAMP
PREHIT
RETRACT
CHECK
MOVE_SPEED
TOUCH_SPEED
SCAN_SPEED
CLEARANCE_PLANES
MAN_DCC_MODE
DISPLAYPRECISION
PROBE_COMPENSATION
POLARVECTORCOMP
SET_WORKPLANE
RMEAS_MODE
GAP_ONLY
RETROLINEAR_ONLY
FLY_MODE
COLUMN132
Command.MoveCommand
Returns this Command object as a MoveCommand object if it can, Nothing
otherwise. Read-only.
The Command objects that have the following Type can become MoveCommand
objects are as follows:
MOVE_POINT = 150,
MOVE_ROTAB = 153,
MOVE_INCREMENT = 154,
MOVE_CIRCULAR = 155,
MOVE_PH9_OFFSET = 156,
Command.OptMotionCommand
Returns an OptMotion Command object if Command is of Type OPTIONMOTION.
Command.Parent
Returns the parent Commands collection object. Read-only.
Command.ScanCommand
Returns a Scan Command object if Command is of Type DCCSCAN_OBJECT or
Type MANSCAN_OBJECT.
212 Automation
Command.ShowIDOnCad
Property used to indicate/set whether the command ID should be displayed in the
CAD window. Read/Write Boolean
Command.SlaveArm
Property used to indicate/set whether command is a slave arm object. Read/Write
Boolean
Command.StatisticCommand
Returns a Statistics Command object if Command is of Type STATISTICS.
Command.TempCompCommand
Returns a TempComp Command object if Command is of Type TEMP_COMP.
Command.TraceFieldCommand
Returns a TraceField Command object if Command is of Type TRACEFIELD.
Command.Type
Returns the type of the Command. Read-only OBTYPE.
Remarks
The returned type is the same as the type argument to Commands.Add.
Methods:
Command.Execute
Syntax
Return Value=expression.Execute
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Command object.
Executes the command if the command is immediately executable.
Command.Dialog
Syntax
Return Value=expression.Dialog
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Command object.
Opens the PC-DMIS dialog for the corresponding command.
Command.Dialog2
Syntax
Return Value=expression.Dialog2(Object *Dialog)
Automation 213
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Command object.
Object: Dmis dialog command object returned if the dialog is a modeless dialog.
Opens the PC-DMIS dialog for for the corresponding command.
Command.GetExpression
Syntax
expression.GetExpression(FieldType, TypeIndex)
Return Value: String which is the expression on the given field if it has an
expression. Otherwise, the string will be empty.
expression: Required expression that evaluates to a PC-DMIS Command object.
FieldType: Used to indicate which field the expression is being set for. Type
ENUM_FIELD_TYPES enumeration.
TypeIndex: Long value used to indicate which instance of the supplied field type to
use when an object has more than one instance of a field type.
Gets the expression of the indicated field of the command.
Remarks
Use this command to get expressions for different object fields. The
ENUM_FIELD_TYPES enumeration is a large enumeration. Documentation for
which field types go with which objects is not given here. You can find this
information by creating the desired object in PC-DMIS, inserting the desired
expression in the desired field, and exporting (posting out) the containing part
program to BASIC.
Command.Item
Syntax 1
Return value=expression.Item(Num)
Return Value: The Item function returns a Command object.
expression: Required expression that evaluates to a Machines object.
Num: Required Long that indicates which Command object to return. It is the index
number of the execution in the current or previous execution
Command.Mark
Syntax
expression.Mark SameAlign
expression: Required expression that evaluates to a PC-DMIS Command object.
SameAlign: Required Boolean. If SameAlign is FALSE, the features that are a part of
the alignment for this Command will be marked. Otherwise, they will not be
marked.
Marks the current object and all objects that depend on it. Optionally the features of
the current alignment are also marked.
Remarks
214 Automation
If the object is a measured feature, its hits are marked. If the object is a constructed
feature, the features on which it depends are marked. If the object is a dimension, the
dimension feature(s) being dimensioned are marked.
Command.Next
Syntax
Return Value=expression.Next
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Command object.
Sets expression to the next command in the parent Commands list. If expression is
the last command, it remains unchanged. This function returns FALSE if expression
is the last command in the parent Commands list, TRUE otherwise.
Command.Prev
Syntax
Return Value=expression.Prev
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Command object.
Sets expression to the previous command in the parent Commands list. If expression
is the first command, it remains unchanged. This function returns FALSE if
expression is the first command in the parent Commands list, TRUE otherwise.
Command.Remove
Syntax
expression.Remove
expression: Required expression that evaluates to a PC-DMIS Command object.
Removes expression from the part Commands list.
Remarks
If there are other objects which depend on expression, they are also removed. For
example, if expression is a measured feature, its hits are removed as well.
Automation 215
Commands Members
Properties:
Commands.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Commands.Count
Represents the number of Command objects in the parent PartProgram object.
Read-only Long.
Commands.Parent
Returns the parent PartProgram object. Read-only.
Methods:
Commands.Add
Syntax
Return Value=expression.Add(Type, AutoPosition)
Return Value: This function returns the Command object added.
expression: Required expression that evaluates to a PC-DMIS Commands object.
Type: Required LONG in the OBTYPE enumeration that denotes what type of
object to create.
AutoPosition: Required Boolean that determines what should happen when the new
Command object is being inserted in an inappropriate place in the part program. If
AutoPosition is FALSE, it will not be inserted at all. If it is TRUE, the new
Command will be inserted at the new appropriate position.
Commands.ClearMarked
Syntax
Return Value=expression.ClearMarked
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Commands object.
Clears all marked Command objects in this part program. ClearMarked always
returns TRUE.
Commands.InsertionPointAfter
Syntax
Return Value=expression.InsertionPointAfter(Cmd)
216 Automation
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Commands object.
Cmd: Required Command object that indicates which command after which to set
the insertion point.
This function returns TRUE if the insertion point was successfully set, FALSE
otherwise.
Commands.Item
Syntax 1
Return Value=expression.Item(NameOrNum)
Syntax 2
expression(NameOrNum)
Return Value: The Item function returns a Command object.
expression: Required expression that evaluates to a Commands object.
Identifier: Required Long that indicates which Command object to return. It is the
index number of the desired Command in the Commands collection denoted by
expression.
Commands.MarkAll
Syntax
Return Value=expression.MarkAll(MarkManual)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Commands object.
MarkManual: Required Boolean that indicates whether or not to mark manual
alignment features.
This function always returns TRUE
Comment Members
Properties:
Comment.Comment
STRING value representing the comment text. Since comments in PC-DMIS can be
multi-line comments, this property represents the full text of all the lines. Each line is
separated by ASCII character 13 and ASCII character 10 in that order. This is a read
Automation 217
only property. To set individual lines of the comment use the SetLine method. To get
individual lines of the comment use the GetLine method.
Read Only String
Comment.CommentType
ENUM_PCD_COMMENT_TYPES enumeration type value representing the type of
comment. The following enumeration values are available:
PCD_COMMENT_OPER = 0
PCD_COMMENT_REPORT = 1
PCD_COMMENT_INPUT = 2
PCD_COMMENT_DOCUMENTATION = 3
PCD_COMMENT_YESNO = 4
Comment.ID
STRING value representing the ID of the comment. The ID is only used for
comments of type INPUT and type YESNO.
Read/Write String
Comment.Input
STRING value representing the text input by the user for comments of type INPUT
or YESNO.
Read/Write String
Methods:
Comment.AddLine
Syntax:
expression.AddLine (Text)
Return Value: Boolean value indicating success or failure of call to method.
expression: Required expression that evaluates to a PC-DMIS Comment object.
Text: Required String representing the line of text to be added to the comment.
Comment.GetLine
Syntax:
expression.GetLine (Line)
Return Value: String text of the line of the comment specified by the line paramter.
If Line is greater than the number of current lines in the comment, the string will be
empty.
expression: Required expression that evaluates to a PC-DMIS Comment object.
Line: Required Long representing the line of text to be retrieved.
Comment Object Overview
218 Automation
Comment.RemoveLine
Syntax:
expression.RemoveLine (Line)
Return Value: Boolean value indicating success or failure of call to remove a line of
text from the comment. If Line is greater than the number of current lines in the
comment, the call will fail.
expression: Required expression that evaluates to a PC-DMIS Comment object.
Line: Required Long representing the line of text to be removed.
Comment.SetLine
Syntax:
expression.SetLine (Line, Text)
Return Value: Boolean value indicating success or failure of call to set the line of
text. If Line is greater than the number of current lines in the comment, the call will
fail.
expression: Required expression that evaluates to a PC-DMIS Comment object.
Line: Required Long representing the line of text to be set.
Text: Required String which is the text to be used to set the text for the line of the
comment.
Automation 219
DimData Members
Properties
DimData.Bonus
Represents the Bonus member of this object. Read/write Double.
DimData.Dev
Represents the Dev member of this object. Read/write Double.
Remarks
The Dev member is the default property.
DimData.DevAngle
Represents the DevAngle member of this object. Read/write Double.
DimData.Max
Represents the Max member of this object. Read/write Double.
DimData.Meas
Represents the Meas member of this object. Read/write Double.
DimData.Min
Represents the Min member of this object. Read/write Double.
DimData.Minus
Represents the Minus member of this object. Read/write Double.
DimData.Out
Represents the Out member of this object. Read/write Double.
DimData.Nom
Represents the Nom member of this object. Read/write Double.
DimData.Plus
Represents the Plus member of this object. Read/write Double.
220 Automation
DimensionCommand Members
Properties:
DimensionCommand.Angle
Represents the theoretical angle of a DIMENSION_ANGULARITY dimension.
Read/Write Double.
Remarks
This function only works for objects of type DIMENSION_ANGULARITY. If used
on any other object type, setting this variable will do nothing, and getting this
variable will return zero.
DimensionCommand.ArrowMultiplier
Multiplier for display arrows of dimension. Read/Write Double.
DimensionCommand.Axis
Axis used with dimension. Possible values include the following:
DIMAXIS_NONE
DIMAXIS_XAXIS
DIMAXIS_YAXIS
DIMAXIS_ZAXIS
DimensionCommand.AxisLetter
Axis letter used to describe the axis or type of the dimension. Read only String.
DimensionCommand.Bonus
Returns the bonus tolerance of a true position dimension. Read-only Double.
Remarks
This function only works for single true position objects, i.e.,
DIMENSION_TRUE_Z_LOCATION, but not
DIMENSION_TRUE_START_POSITION or
DIMENSION_TRUE_END_POSITION. If used on any other object type, getting
this variable will return zero.
DimensionCommand.Deviation
Returns the deviation of a dimension. Read/Write Double.
DimensionCommand.DevAngle
Returns the deviation angle of a dimension. Read/Write Double.
Automation 221
DimensionCommand.GraphicalAnalysis
Flag indicating whether graphical analysis is ON for the dimension. Read/Write
Boolean.
DimensionCommand.ID
Returns the ID of a dimension. Read/Write String.
Remarks
For location and true position dimensions, only the start object has an id. For single
location or true position object, i.e., DIMENSION_TRUE_Z_LOCATION or
DIMENSION_Y_LOCATION, setting the ID property has no afffect and getting it
returns the empty string.
DimensionCommand.Feat1
Returns the ID of the first feature associated with a dimension. Read/Write String.
Remarks
For location and true position dimensions, only the start object has an associated
feature. For single location or true position object, i.e.,
DIMENSION_TRUE_Z_LOCATION or DIMENSION_Y_LOCATION, setting the
Feat1 property has no afffect and getting it returns the empty string. Also, objects of
type DIMENSION_KEYIN have no associated features.
DimensionCommand.Feat2
Returns the ID of the second feature associated with a dimension. Read/Write
String.
Remarks
Not every dimension type has two features associated with it. Trying to set the Feat2
property of one of these types has no effect, and getting it returns the empty string.
DimensionCommand.Feat3
Returns the ID of the second feature associated with a dimension. Read/Write
String.
Remarks
Not every dimension type has three features associated with it. Trying to set the
Feat3 property of one of these types has no effect, and getting it returns the empty
string.
DimensionCommand.Length
Returns the length associated with a dimension. Read/Write Double.
Remarks
Only object of type DIMENSION_ANGULARITY, DIMENSION_ANGULARITY,
DIMENSION_PERPENDICULARITY, and DIMENSION_PROFILE have a useful
length property. For all other types, setting the property has no effect, and getting it
always returns zero.
DimensionCommand.Nominal
Returns the nominal associated with a dimension. Read/Write Double.
222 Automation
Remarks
Only object of type DIMENSION_START_LOCATION,
DIMENSION_TRUE_START_POSITION do not have a useful nominal property.
For these types, setting the property has no effect, and getting it always returns zero.
DimensionCommand.Max
Returns the maximum value of a dimension. Read-only Double.
DimensionCommand.Measured
Returns the measured value of a dimension. Read-only Double.
DimensionCommand.Min
Returns the minimum value of a dimension. Read-only Double.
DimensionCommand.Minus
Represents the negative tolerance of a dimension. Read/write Double.
DimensionCommand.OutputMode
Output mode of the dimension. Possible values include the following:
DIMOUTPUT_STATS
DIMOUTPUT_REPORT
DIMOUTPUT_BOTH
DimensionCommand.OutTol
Returns the out-of-tolerance value of a dimension. Read-only Double.
DimensionCommand.ParallelPerpindicular
Indicates whether calculations are performed parallel or perpindicular to input for 2D dimensions. Possible values include the following:
DIM_PERPINDICULAR
DIM_PARALLEL
DimensionCommand.Profile
Enumeration value indicating what type of profile should be used. Possible values
include the following:
DIM_PROF_FORM_ONLY
DIM_PROF_FORM_AND_LOCATION
DimensionCommand.Plus
Returns the positive tolerance of a dimension. Read-only Double.
Automation 223
DimensionCommand.Parent
Returns the parent Command object. Read-only.
Remarks
The parent of a DimensionCommand object is the same underlying PC-DMIS
object as the DimensionCommand object itself. Getting the parent allows you to
access the generic Command properties and methods of a given object.
DimensionCommand.RadiusType
Radius calculation type used with true position dimensions. Possible values include
the following:
DIM_NO_RADIUS
DIM_ADD_RADIUS
DIM_SUB_RADIUS
DimensionCommand.TextualAnalysis
Flag indicating whether textual analysis is ON for the dimension. Read/Write
Boolean.
DimensionCommand.TruePositionModifier
Enumeration value indicating material conditions that should be used to calculate
possible bonus tolerances. Possible values include the following:
DIM_RFS_RFS
DIM_RFS_MMC
DIM_RFS_LMC
DIM_MMC_RFS
DIM_MMC_MMC
DIM_MMC_LMC
DIM_LMC_RFS
DIM_LMC_MMC
DIM_LMC_LMC
DimensionCommand.TruePosUseAxis
Enumeration value indicating axis type to use with true position dimension. Possible
values include the following:
DIM_AXIS_AVERAGE
DIM_AXIS_START_POINT
DIM_AXIS_END_POINT
DimensionCommand.UnitType
Unit type in use by dimension. Possible values include the following:
INCH
224 Automation
MM (for millimeters)
DimFormat.ShowDimensionText
BOOLEAN value indicating whether the top two lines of the dimension command
should appear or not.
Read/Write Boolean
DimFormat.ShowDimensionTextOptions
BOOLEAN value indicating whether various dimension such as arrow multiplier,
graphical analysis, and textual analysis should appear in the dimension text or not.
Read/Write Boolean
DimFormat.ShowHeadings
BOOLEAN value indicating whether the dimension headings such as NOM, MAX,
MIN, DEV, OUTTOL, etc. should appear in the dimension text or not.
Read/Write Boolean
Dimension Format Object Overview
DimFormat.ShowStdDev
BOOLEAN value indicating whether the standard deviation value should appear or
not.
Read/Write Boolean
Methods:
DimFormat.GetHeadingType
Syntax:
Automation 225
expression.GetHeadingType (Index)
Return Value: DimFormatType Enumeration value indicating the dimension
information type of the position indicated by the index parameter.
Possible values include the following:
PCD_NOT_USED = 0
PCD_NOM = 1
PCD_TOL = 2
PCD_MEAS = 3
PCD_MAXMIN = 4
PCD_DEV = 5
PCD_OUTTOL = 6
DimFormat.SetHeadingType
Syntax:
expression.SetHeadingType (Index, HeadingType)
Return Value: Boolean indicating success or failure in setting the heading type.
expression: Required expression that evaluates to a PC-DMIS Dim Format object.
Index: Required long indicating the index position that is being set.
HeadingType: Required DimFormatType Enumeration representing the type of
value to be used at the given index position.
Possible values include the following:
PCD_NOT_USED = 0
PCD_NOM = 1
PCD_TOL = 2
PCD_MEAS = 3
PCD_MAXMIN = 4
PCD_DEV = 5
PCD_OUTTOL = 6
226 Automation
DimInfo.ShowDimensionID
BOOLEAN value indicating whether the Dimension ID should be shown in the
dimension information object.
Read/Write Boolean
DimInfo.ShowFeatID
BOOLEAN value indicating whether to display the feature id of the feature
belonging to the dimension used in the dimension information command.
Read/Write Boolean
Methods:
DimInfo.GetFieldFormat
Syntax:
expression.GetFieldFormat (Index)
Return Value: Enum_Dinfo_Field_Types Enumeration value indicating the
dimension information type of the position indicated by the index parameter.
Possible values include the following:
DINFO_NOT_USED = 0
DINFO_MEAS = 1
DINFO_NOM = 2
DINFO_TOL = 3
DINFO_DEV = 4
DINFO_MAXMIN = 5
DINFO_OUTTOL = 6
DINFO_MEAN = 7
DINFO_STDDEV = 8
DINFO_NUMPOINTS = 9
DimInfo.GetLocationAxis
Syntax:
Automation 227
expression.GetLocationAxis (Index)
Return Value: Enum_Dinfo_Loc_Axes Enumeration value indicating the dimension
location axis order used at the position indicated by the index parameter. This
function only works if the dimension being referenced in the command is an axis
location dimension.
Possible values include the following:
DINFO_LOC_USE_DIM_AXES = -2
DINFO_LOC_WORST = -1
DINFO_LOC_NOT_USED = 0
DINFO_LOC_X = 1
DINFO_LOC_Y = 2
DINFO_LOC_Z = 3
DINFO_LOC_D = 4
DINFO_LOC_R = 5
DINFO_LOC_V = 6
DINFO_LOC_A = 7
DINFO_LOC_L = 8
DINFO_LOC_H = 9
DINFO_LOC_PR = 10
DINFO_LOC_PA = 11
DINFO_LOC_T = 12
DINFO_LOC_RT = 13
DINFO_LOC_S = 14
DINFO_LOC_RS = 15
DINFO_LOC_PD = 16
DimInfo.GetTruePosAxis
Syntax:
expression.GetTruePosAxis (Index)
Return Value: Enum_Dinfo_TP_Axes Enumeration value indicating the dimension
true position axis order used at the position indicated by the index parameter. This
command only works with dimension information commands that are referencing
true position dimensions.
Possible values include the following:
DINFO_TP_USE_DIM_AXES = -2
DINFO_TP_WORST = -1
DINFO_TP_NOT_USED = 0
DINFO_TP_X = 1
DINFO_TP_Y = 2
DINFO_TP_Z = 3
DINFO_TP_PR = 4
228 Automation
DINFO_TP_PA = 5
DINFO_TP_DD = 6
DINFO_TP_LD = 7
DINFO_TP_WD = 8
DINFO_TP_DF = 9
DINFO_TP_LF = 10
DINFO_TP_WF = 11
DINFO_TP_TP = 12
DimInfo.SetFieldFormat
Syntax:
expression.SetFieldFormat (Index, FieldType)
Return Value: Boolean indicating success or failure in setting the field type.
expression: Required expression that evaluates to a PC-DMIS Dim Information
object.
Index: Required long indicating the index position that is being set.
FieldType: Required Enum_Dinfo_Field_Types Enumeration representing the
type of value used at the given index position.
Possible values include the following:
DINFO_NOT_USED = 0
DINFO_MEAS = 1
DINFO_NOM = 2
DINFO_TOL = 3
DINFO_DEV = 4
DINFO_MAXMIN = 5
DINFO_OUTTOL = 6
DINFO_MEAN = 7
DINFO_STDDEV = 8
DINFO_NUMPOINTS = 9
DimInfo.SetLocationAxis
Syntax:
expression.SetFieldFormat (Index, Axis)
Return Value: Boolean indicating success or failure in setting the field type.
Dimension needs to be a location dimension in order for this command to succeed.
expression: Required expression that evaluates to a PC-DMIS Dim Information
object.
Index: Required long indicating the index position that is being set.
Axis: Required Enum_Dinfo_Loc_Axes Enumeration representing the type the
axis used at the given index position.
Automation 229
DimInfo.SetTruePosAxis
Syntax:
expression.SetTruePosAxis (Index, Axis)
Return Value: Boolean indicating success or failure in setting the field type.
Dimension needs to be a true position dimension in order for this command to
succeed.
expression: Required expression that evaluates to a PC-DMIS Dim Information
object.
Index: Required long indicating the index position that is being set.
Axis: Required Enum_Dinfo_TP_Axes Enumeration representing the type the axis
used at the given index position.
Possible values include the following:
DINFO_TP_USE_DIM_AXES = -2
DINFO_TP_WORST = -1
DINFO_TP_NOT_USED = 0
DINFO_TP_X = 1
DINFO_TP_Y = 2
DINFO_TP_Z = 3
DINFO_TP_PR = 4
DINFO_TP_PA = 5
DINFO_TP_DD = 6
DINFO_TP_LD = 7
DINFO_TP_WD = 8
230 Automation
DINFO_TP_DF = 9
DINFO_TP_LF = 10
DINFO_TP_WF = 11
DINFO_TP_TP = 12
DmisDialog Members
Properties:
DmisDialog.Visible
Indicates whether the dialog is still visible to the user.
Read Only: Boolean
Automation 231
of three doubles represent the Y axis. The fourth set of three doubles represent the Z
axis.
DmisMatrix Members
Properties:
DmisMatrix.Copy
Returns a copy of the matrix.
Read Only: DmisMatrix
DmisMatrix.Inverse
Returns an inverse matrix of the current matrix.
Read Only: DmisMatrix
DmisMatrix.IsIdentity
BOOLEAN property set to true if the matrix is the identity matrix.
Read Only: Boolean
DmisMatrix.OffsetAxis
The first set of three doubles in the matrix representing the translation offset of the
matrix.
Read/Write: PointData
DmisMatrix.XAxis
The second set of three doubles in the matrix representing the XAxis.
Read/Write PointData
DmisMatrix.YAxis
The third set of three doubles in the matrix representing the YAxis.
Read/Write PointData
DmisMatrix.ZAxis
The fourth set of three doubles in the matrix representing the ZAxis.
Read/Write PointData
Methods:
DmisMatrix.Item
Syntax:
expression.Item (Num)
232 Automation
Num: Required parameter of type long between 1 and 12 inclusive from which the
matrix data is copied.
Return Value:
Data item of matrix of type double.
DmisMatrix.Multiply
Syntax:
expression.Multiply (SecondMatrix)
DmisMatrix.Normalize
Syntax:
expression.Normalize ()
DmisMatrix.Reset
Syntax:
expression.Reset ()
DmisMatrix.RotateByAngle
Syntax:
expression.RotateByAngle (Angle, Workplane)
DmisMatrix.RotateToPoint
Syntax:
expression.RotateToPoint (X, Y, Workplane)
Automation 233
DmisMatrix.RotateToVector
Syntax:
expression.RotateToVector (Vector, Workplane)
DmisMatrix.SetMatrix
Syntax:
expression.SetMatrix (Vector, Point, Workplane)
DmisMatrix.TransformDataBack
Syntax:
expression.TransformDataBack (PointData,
TransformationType, Workplane)
234 Automation
MAJOR_MINOR_THIRD_ROT_AND_TRANS = 2
MAJOR_MINOR_THIRD_ROTATE_ONLY = 3
DmisMatrix.TransformDataForward
Syntax:
expression.TransformDataForward (PointData,
TransformationType, Workplane)
EditWindow.Height
The height of the edit window in screen pixels. Read/Write Long.
Automation 235
EditWindow.Left
The left edge of the edit window, measured from the left edge of the Windows
Desktop. Read/Write Long.
Remarks
The Left property is measured in screen pixels.
EditWindow.Parent
Returns the parent PartProgram of this object. Read-only PartProgram.
EditWindow.ShowAlignments
This property is TRUE if alignments are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
EditWindow.ShowComments
This property is TRUE if comments are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
EditWindow.ShowDimensions
This property is TRUE if dimensions are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
EditWindow.ShowFeatures
This property is TRUE if features are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
EditWindow.ShowHeaderFooter
This property is TRUE if headers and footers are being shown in the edit window,
FALSE otherwise. Read/Write Boolean.
EditWindow.ShowHits
This property is TRUE if hits are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
EditWindow.ShowMoves
This property is TRUE if moves are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
EditWindow.ShowOutTolOnly
This property is TRUE if only out-of-tolerance dimensions are being shown in the
edit window, FALSE otherwise. If ShowDimensions is FALSE, this property is
ignored. Read/Write Boolean.
EditWindow.ShowTips
This property is TRUE if tips are being shown in the edit window, FALSE
otherwise. Read/Write Boolean.
236 Automation
EditWindow.StatusBar
This property represents the text in the edit windows status bar. Read-Write String.
EditWindow.Top
The top edge of the edit window, measured from the top edge of the Windows
Desktop. Read/Write Long.
Remarks
The Top property is measured in screen pixels.
EditWindow.Visible
This property is TRUE if the edit window is visible, FALSE otherwise. Read/write
Boolean.
EditWindow.Width
The width of the edit window in screen pixels. Read/Write Long.
Methods:
EditWindow.CommandMode
Syntax
expression.CommandMode
expression: Required expression that evaluates to a PC-DMIS EditWindow object.
This function puts the Edit window into command mode.
EditWindow.Print
Syntax
expression.Print
expression: Required expression that evaluates to a PC-DMIS EditWindow object.
This function prints the contents of the Edit window.
EditWindow.ReportMode
Syntax
expression.ReportMode
expression: Required expression that evaluates to a PC-DMIS EditWindow object.
This function puts the Edit window into report mode.
EditWindow.SetPrintOptions
Syntax
expression.SetPrintOptions long Location, long Draft, long FileMode, long
ExtNum
expression: Required expression that evaluates to a PC-DMIS EditWindow object.
Location: Destination of printed data. Options include Off, File, or Printer
Automation 237
Draft: When destination is printer, specifies if printer should print in draft mode or
not. Options include On and Off.
FileMode: When destination is file, specifies file naming and writing parameters.
Options include: Append, New File, Overwrite, and Auto. Auto mode automatically
increments a numeric extension for the output file.
ExtNum: Number to be used for the file extension of the output file.
This function puts the Edit window into report mode.
ExternalCommand Members
Properties:
ExtCommand.Command
String value which is the command to be executed. This string should be in the same
format as a string entered into Windows Run Dialog box (i.e. The string should
include full pathname and executable name of the external command to be executed).
Read/Write String
FeatCommand Members
Properties:
FeatCommand.AlignWorkPlane
Workplane value for constructed alignment planes and lines. Possible values include
the following:
ALIGN_ZPLUS = 0
ALIGN_ZMINUS = 1
ALIGN_XPLUS = 2
ALIGN_XMINUS = 3
ALIGN_YPLUS = 4
ALIGN_YMINUS = 5
238 Automation
ALIGN_CURRENT_WORKPLANE = 6
FeatCommand.AutoCircularMove
Flag indicating whether circular moves should be used between hits. Boolean
Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an auto circular move
field.
FeatCommand.AutoClearPlane
Flag indicating whether clearance planes should automatically be used with the
feature. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an auto clearplane field.
FeatCommand.AutoMove
Auto Move Flag. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an auto move field.
FeatCommand.AutoMoveDistance
Distance used in calculating auto move. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an auto move distance
field.
FeatCommand.AutoPH9
Flag indicating if selected tip should be automatically adjusted during measurement
of feature. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an AutoPH9 field.
FeatCommand.AutoReadPos
Auto Read Position Flag. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an auto read pos field.
FeatCommand.BestFitMathType
Value representing the best fit math algorithm to be used in calculating the measured
feature values based on the measured hits. Possible values include the following.
Automation 239
BF_MATH_LEAST_SQUARES
= 0
BF_MATH_MIN_SEPARATION = 1
BF_MATH_MAX_INSCRIBED = 2
BF_MATH_MIN_CIRCUMSCRIBED = 3
BF_MATH_FIXED_RADIUS
= 4
FeatCommand.Bound
Flag indicating whether or not feature is bound. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a bound/unbound field.
FeatCommand.BoxWidth
Box width value for auto high point. Double Read/Write.
Remarks
This property is only applicable for the PC-DMIS auto high point command.
FeatCommand.BoxLength
Box length value for auto high point. Double Read/Write.
Remarks
This property is only applicable for the PC-DMIS auto high point command.
FeatCommand.CircularRadiusIn
Inside circular radius value for auto high point. Double Read/Write.
Remarks
This property is only applicable for the PC-DMIS auto high point command.
FeatCommand.CircularRadiusOut
Outside circular radius value for auto high point. Double Read/Write.
Remarks
This property is only applicable for the PC-DMIS auto high point command.
FeatCommand.CornerRadius
Corner radius value for auto square slot and auto notch objects. Double Read/Write.
Remarks
This property is only applicable for the PC-DMIS auto square slot and auto notch
commands.
240 Automation
FeatCommand.DCCFindNomsMode
Boolean read/write value that indicates if the measurement mode for an auto feature
should be done in find nominals mode or not.
Remarks
This property applies only to PC-DMIS auto features with a find nominals
measurement field.
FeatCommand.DCCMeasureInMasterMode
Boolean read/write value that indicates if the measurement mode for an auto feature
should be done in master mode or not.
Remarks
This property applies only to PC-DMIS auto features with a master mode
measurement field.
FeatCommand.Depth
Depth value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a depth field.
FeatCommand.Deviation
Auto sphere deviation value. Double Read/Write.
Remarks
This property applies only to the PC-DMIS auto sphere command.
FeatCommand.DisplayConeAngle
Flag indicating whether or not to display the angle of the cone. If this value is false,
then the cone length is displayed. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS cone commands that have a display option
on angle vs. length.
FeatCommand.EdgeMeasureOrder
Measure order for edge points. Possible values include the following.
EDGE_SURFACE_FIRST = 0
EDGE_EDGE_FIRST = 1
EDGE_BOTH =2
Remarks
This property applies only to PC-DMIS edge commands.
FeatCommand.EdgeThickness
Thickness value for edge points. Double Read/Write.
Automation 241
Remarks
This property is only applicable for PC-DMIS edge commands.
FeatCommand.EndAngle
End Angle value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an end angle field.
FeatCommand.EndAngle2
Second End Angle value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a second end angle
field.
FeatCommand.FilterType
Filter object filter type. Possible values include the following:
FILTER_LINEAR = 0
FILTER_POLAR = 1
FeatCommand.GenericAlignMode
Generic alignment mode. Possible values include the following:
GENERIC_ALIGN_DEPENDENT =0
GENERIC_ALIGN_INDEPENDENT =1
FeatCommand.GenericDisplayMode
Generic display mode. Possible values include the following:
GENERIC_DISPLAY_RADIUS = 0
GENERIC_DISPLAY_DIAMETER = 1
FeatCommand.GenericType
Generic feature type. Possible values include the following:
GENERIC_POINT = 0
GENERIC_PLANE = 1
242 Automation
GENERIC_LINE = 2
GENERIC_CIRCLE = 3
GENERIC_SPHERE = 4
GENERIC_CYLINDER = 5
GENERIC_ROUND_SLOT = 6
GENERIC_SQUARE_SLOT = 7
GENERIC_CONE = 8
GENERIC_NONE = 9
FeatCommand.HighPointSearchMode
Search mode for auto high point. Possible values include the following:
SEARCH_MODE_BOX = 0
SEARCH_MODE_CIRCULAR = 1
FeatCommand.ID
Represents the ID of the feature. Read/Write String.
Remarks
The IDs of the various objects in a part program should be unique.
FeatCommand.Increment
Increment value for auto high point. Double Read/Write.
Remarks
This property is only applicable for the PC-DMIS auto high point command.
FeatCommand.Indent
Indent distance (used with sample hits). Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an indent field.
FeatCommand.Indent2
Second indent distance (used with sample hits). Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a second indent field.
FeatCommand.Indent3
Third indent distance (used with sample hits). Double Read/Write.
Automation 243
Remarks
This property applies only to PC-DMIS commands that have a third indent field.
FeatCommand.InitHits
Number of intitial sample hits. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an init hits field.
FeatCommand.Inner
Boolean read/write value that indicates whether the feature is a hole (inner) or a stud
(outer).
Remarks
This property applies only to PC-DMIS commands that can be either inside or
outside features.
FeatCommand.InteriorHit
Flag used to indicate type of hit for objects that can have interior/exterior hits.
Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an interior/exterior hit
field.
FeatCommand.Line3D
Boolean read/write value that indicates whether the feature is a three dimensional
line or a two dimensional line. A value of false indicates a two dimensional line.
Remarks
This property applies only to PC-DMIS lines features with and 2D/3D field.
FeatCommand.MeasAngle
Measured angle value. Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have an angle field.
FeatCommand.MeasDiam
Measured diameter value. Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have a diameter field.
FeatCommand.MeasHeight
Measured height value. Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have a height field.
244 Automation
FeatCommand.MeasMajorAxis
Measured major axis length value (ellipse). Double Read only.
Remarks
This property applies only to PC-DMIS commands that have a major axis field.
FeatCommand.MeasMinorAxis
Measured minor axis length value (ellipse). Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have a minor axis field.
FeatCommand.MeasLength
Measured length value. Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have a length field.
FeatCommand.MeasPinDiam
Measured pin diameter value. Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have a pin diameter field.
FeatCommand.MeasSmallLength
Measured shorter length value. Double Read Only.
Remarks
This property applies only to PC-DMIS commands that have a small length field.
FeatCommand.MeasureSlotWidth
Flag indicating whether the slot width should be measured. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a measure slot width
flag.
FeatCommand.NumHits
Represents the number of inputs in the feature. Read/Write Long.
Remarks
If this feature is constructed, it reports the number of input features.
FeatCommand.NumHitsPerRow
Represents the number of hits on each row of the feature. Read/Write Long.
Remarks
You can use this variable only with features that have rows (such as spheres and
cylinders).
Automation 245
FeatCommand.NumRows
Represents the number of rows in the feature. Read/Write Long.
Remarks
You can use this variable only with features that have rows (such as spheres and
cylinders).
FeatCommand.Parent
Returns the parent Command object. Read-only.
Remarks
The parent of a FeatCommand object is the same underlying PC-DMIS object as
the FeatCommand object itself. Getting the parent allows you to access the generic
Command properties and methods of a given object.
FeatCommand.PermHits
Number of permanent sample hits. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a permanent hits field.
FeatCommand.Polar
Flag indicating whether polar coordinates are used on the feature. Usually defaults to
false. Boolean Read/Write.
Remarks
This property applies only to PC-DMIS commands that have support for polar
coordinates.
FeatCommand.ReferenceType
Reference type used with measured circles and measured lines.
ENUM_FEATREF_TYPES Enumeration Read/Write.
Remarks
This property applies only to PC-DMIS measured line and measured circle
commands. Possible value include the following:
FEATREF_FEATURE
feature)
FEATREF_3D = -2,
FEATREF_CURRENT_WORKPLANE = -1,
FEATREF_ZPLUS = 0,
FEATREF_XPLUS = 1,
FEATREF_YPLUS = 2,
FEATREF_ZMINUS = 3,
FEATREF_XMINUS = 4,
FEATREF_YMINUS = 5
246 Automation
FeatCommand.ReferenceID
ID of the feature to be used when the "ReferenceType" property is set to
FEATREF_FEATURE. This property is used with measured lines or measured
circles. String Read/Write.
Remarks
This property applies only to measured lines and circles that have the projection
reference type set to feature.
FeatCommand.RMeasFeature
ID of the feature to be used for relative measurement. String Read/Write.
Remarks
This property applies only to PC-DMIS commands that support relative
measurement
FeatCommand.Spacer
Spacer distance (Usually used with sample hits). Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a spacer field.
FeatCommand.StartAngle
Start Angle value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a start angle field.
FeatCommand.StartAngle2
Second Start Angle value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a second start angle
field.
FeatCommand.TheoAngle
Theoretical angle value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have an angle field.
FeatCommand.TheoDiam
Theoretical diameter value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a diameter field.
FeatCommand.TheoHeight
Theoretical height value. Double Read/Write.
Remarks
Automation 247
This property applies only to PC-DMIS commands that have a height field.
FeatCommand.TheoLength
Theoretical length value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a length field.
FeatCommand.TheoMajorAxis
Theoretical major axis length value (ellipse). Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a major axis field.
FeatCommand.TheoMinorAxis
Theoretical minor axis length value (ellipse). Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a minor axis field.
FeatCommand.TheoPinDiam
Theoretical pin diameter value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a pin diameter field.
FeatCommand.TheoSmallLength
Theoretical shorter length value. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a small length field.
FeatCommand.Thickness
Sheet metal (material) thickness. Double Read/Write.
Remarks
This property applies only to PC-DMIS commands that have a thickness field.
FeatCommand.Tolerance
Tolerance value for auto high point. Double Read/Write.
Remarks
This property applies only to the PC-DMIS auto high point command.
FeatCommand.UsePin
Boolean read/write value indicating whether pin information should be used during
measurement.
Remarks
This property applies only to PC-DMIS commands that have a use pin field.
248 Automation
Methods:
FeatCommand.AddInputFeat
Syntax
Return Value=expression.AddInputFeat(ID)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS FeatCommand object
that represents a constructed feature.
ID: Required String that is the ID of the feature to add to the set of input features.
This function returns TRUE if the feature was successfully added to set of input
features of expression, FALSE otherwise.
Remarks
This function only tries to add ID to expression if the two features exist and ID
precedes expression in the command list. If expression is not a constructed feature,
this function will fail.
FeatCommand.GenerateHits
Syntax
Return Value=expression.GenerateHits
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS FeatCommand object
that represents a measured feature.
This function returns TRUE if the hits were successfully added to expression,
FALSE otherwise.
Remarks
This function tries to add evenly spaced hits to expression. If expression is not a
measured feature, this function will fail.
FeatCommand.GetData
Syntax
Return Value=expression.GetData(PointData, DataType, TheoMeas,
CoordSystem, AlignID, Workplane)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
PointData: Required PointData object into which the data is stored.
DataType: Optional Long that is one of the following values: FDATA_CENTROID,
FDATA_VECTOR, FDATA_DIAMETER, FDATA_STARTPOINT, FDATA_MIDPOINT,
FDATA_ENDPOINT, FDATA_LENGTH, FDATA_MINOR_AXIS, FDATA_ANGLE,
FDATA_SURFACE_VECTOR, FDATA_THICKNESS, FDATA_SPACER, FDATA_INDENT,
FDATA_AUTO_MOVE_DISTANCE, FDATA_DEPTH, FDATA_ANGLE_VECTOR,
FDATA_PUNCH_VECTOR, FDATA_PIN_VECTOR, FDATA_PIN_DIAMETER,
FDATA_REPORT_VECTOR, FDATA_REPORT_SURF_VECTOR, FDATA_HEIGHT,
Automation 249
FeatCommand.GetInputFeat
Syntax
Return Value=expression.GetInputFeat(Index)
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
Index: Required Long between one and expression.NumHits
Return Value: If successful, this function returns the String ID of the input feature at
the specified index.
Remarks
When successful, this returns the ID of the input feature, otherwise it returns an
empty string.
FeatCommand.GetInputOffset
Syntax
Return Value=expression.GetInputOffset(Index)
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
250 Automation
FeatCommand.GetHit
Syntax
Return Value=expression.GetHit(Index, DataType, TheoMeas,
CoordSystem, AlignID, Workplane)
Return Value: This method returns a Point Data object with the values of the hit.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
Index: The index number of the desired hit object to retrieve.
DataType: Optional Long that is one of the following values: FHITDATA_CENTROID,
FHITDATA_VECTOR, FHITDATA_BALLCENTER
FeatCommand.GetPoint
Syntax
Return Value=expression.GetPoint(PointType, TheoMeas, X, Y, Z)
Return Value: This method returns a boolean value indicating success or failure of
the call.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
Automation 251
Return Value: This method returns a boolean value indicating success or failure of
the call.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
TheoMeas: Long that is one of FDATA_THEO or FDATA_MEAS
I1: Variable of type double that will hold the I component of the first vector.
J1: Variable of type double that will hold the J component of the first vector.
K1: Variable of type double that will hold the K component of the first vector.
I2: Variable of type double that will hold the I component of the second vector.
J2: Variable of type double that will hold the J component of the second vector.
K2: Variable of type double that will hold the K component of the second vector.
Remarks
Use this function to get the surface vectors of an angle hit
function.FeatCommand.GetVector
Syntax
Return Value=expression.GetVector(VectorType, TheoMeas, I, J,
K)
Return Value: This method returns a boolean value indicating success or failure of
the call.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
VectorType: FVECTOR_TYPES enumeration. Possible values include the
following:
FVECTOR_VECTOR,
252 Automation
FVECTOR_SURFACE_VECTOR
FVECTOR_ANGLE_VECTOR
FVECTOR_PUNCH_VECTOR
FVECTOR_PIN_VECTOR
FVECTOR_REPORT_VECTOR
FVECTOR_REPORT_SURF_VECTOR
FVECTOR_MEASURE_VECTOR
FVECTOR_UPDATE_VECTOR
FVECTOR_ORG_HIT_VECTOR
FVECTOR_CORNER_VECTOR2
FVECTOR_CORNER_VECTOR3
FVECTOR_SLOT_VECTOR
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
Data: Required PointData object into from which the data is taken to set values in
the corresponding object.
DataType: Optional Long that is one of the following values:
FDATA_CENTROID, FDATA_VECTOR, FDATA_DIAMETER,
FDATA_STARTPOINT, FDATA_MIDPOINT, FDATA_ENDPOINT,
FDATA_LENGTH, FDATA_MINOR_AXIS, FDATA_ANGLE,
FDATA_SURFACE_VECTOR, FDATA_THICKNESS, FDATA_SPACER,
FDATA_INDENT, FDATA_AUTO_MOVE_DISTANCE, FDATA_DEPTH,
FDATA_ANGLE_VECTOR, FDATA_PUNCH_VECTOR, FDATA_PIN_VECTOR,
FDATA_PIN_DIAMETER, FDATA_REPORT_VECTOR,
FDATA_REPORT_SURF_VECTOR, FDATA_HEIGHT,
FDATA_MEASURE_VECTOR, FDATA_UPDATE_VECTOR,
FDATA_SNAP_CENTROID, FDATA_ANALOG_DEVIATIONS,
FDATA_CORNER_RADIUS, FDATA_AB_ANGLES, FDATA_ORG_HIT_VECTOR,
FDATA_ANGLE2, FDATA_WIDTH, FDATA_MAJOR_AXIS, or
FDATA_SLOT_VECTOR
Automation 253
CoordSystem: Optional Long that denotes the coordinate system in which to report.
Values include FDATA_POLAR, FDATA_CAD, FDATA_PARTMM3,
FDATA_MACHINE, and FDATA_PART.If no value is supplied, the default value
is FDATA_PART.
AlignID: Optional String that denotes what alignment to use. You can pass the
empty string to denote the current alignment.
If no value is supplied, the default value is an empty string which causes the current
alignment to be used.
Workplane: Optional Long. Used for the PARTMM3 and POLAR coordinate
system to denote the workplane to be used. Possible values include PCD_TOP,
PCD_BOTTOM, PCD_LEFT, PCD_RIGHT, PCD_FRONT, PCD_BACK.
If no value is supplied, the default value is PCD_TOP.
This function returns TRUE if the data was successfully retrieved from expression,
FALSE otherwise.
Remarks
Not every data type can be used with every feature type. Some data types take a
single value, some data types take multiple values. Some data types take one or more
depending on the feature. For example, a cone can take two diameters in the first and
second data fields of the point object while the circle object only takes one diamter.
Use the FDATA_THEO flag if you want theoretical data, FDATA_MEAS if you
want measured data.
FeatCommand.PutPoint
Syntax
Return Value=expression.PutPoint(PointType, TheoMeas, X, Y, Z)
Return Value: This method returns a boolean value indicating success or failure of
the call.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
VectorType: FPOINT_TYPES enumeration. Possible values include the following:
FPOINT_CENTROID
FPOINT_STARTPOINT
FPOINT_MIDPOINT
FPOINT_ENDPOINT
FPOINT_BALLCENTER
FPOINT_SNAP_CENTROID
254 Automation
Syntax
Return Value=expression.PutSurfaceVectors(TheoMeas, I1, J1, K1,
I2, J2, K2)
Return Value: This method returns a boolean value indicating success or failure of
the call.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
TheoMeas: Long that is one of FDATA_THEO or FDATA_MEAS
I1: Double representing the I component of the first vector.
J1: Double representing the J component of the first vector.
K1: Double representing the K component of the first vector.
I2: Double representing the I component of the second vector.
J2: Double representing the J component of the second vector.
K2: Double representing the K component of the second vector.
Remarks
Use this function to set the surface vectors for an angle hit
object.FeatCommand.PutVector
Syntax
Return Value=expression.PutVector(VectorType, TheoMeas, I, J,
K)
Return Value: This method returns a boolean value indicating success or failure of
the call.
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
VectorType: FVECTOR_TYPES enumeration. Possible values include the
following:
FVECTOR_VECTOR
FVECTOR_SURFACE_VECTOR
FVECTOR_ANGLE_VECTOR
FVECTOR_PUNCH_VECTOR
FVECTOR_PIN_VECTOR
FVECTOR_REPORT_VECTOR
FVECTOR_REPORT_SURF_VECTOR
FVECTOR_MEASURE_VECTOR
FVECTOR_UPDATE_VECTOR
FVECTOR_ORG_HIT_VECTOR
FVECTOR_CORNER_VECTOR2
FVECTOR_CORNER_VECTOR3
FVECTOR_SLOT_VECTOR
Automation 255
FeatCommand.SetInputFeat
Syntax
Return Value=expression.SetInputFeat(ID, Index)
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
ID: Required String that is the ID of a feature.
Index: Required Long between one and expression.NumHits
Return Value: This function returns TRUE if expression is a constructed feature and
ID is the ID of a valid input feature, and Index is the index of a input feature, FALSE
otherwise.
Remarks
When successful, this function replaces the input feature at position Index in
expressions list of input features with ID.
FeatCommand.SetInputOffset
Syntax
Return Value=expression.SetInputOffset(Index, Offset)
expression: Required expression that evaluates to a PC-DMIS FeatCommand
object.
Index: Required Long between one and expression.NumHits
Offset: Required Double which specifies the offset value
Return Value: If successful, this function returns the Boolean set to true.
Remarks
Use this function with constructed features to set the offset values for input features.
256 Automation
FeatData Members
Properties
FeatData.X
Represents the X member of this object. Read/write Double.
FeatData.Y
Represents the Y member of this object. Read/write Double.
FeatData.Z
Represents the Z member of this object. Read/write Double.
FeatData.I
Represents the I member of this object. Read/write Double.
FeatData.J
Represents the J member of this object. Read/write Double.
Automation 257
FeatData.K
Represents the K member of this object. Read/write Double.
FeatData.DIAM
Represents the DIAM member of this object. Read/write Double.
FeatData.LENGTH
Represents the LENGTH member of this object. Read/write Double.
FeatData.ANGLE
Represents the ANGLE member of this object. Read/write Double.
FeatData.SmallDiam
Represents the SmallDiam member of this object. Read/write Double.
FeatData.StartAngle
FeatData.EndAngle
Represents the EndAngle member of this object. Read/write Double.
FeatData.StartAngle2
Represents the StartAngle2 member of this object. Read/write Double.
FeatData.EndAngle2
Represents the EndAngle2 member of this object. Read/write Double.
FeatData.F
Represents the F member of this object. Read/write Double.
FeatData.TP
Represents the TP member of this object. Read/write Double.
FeatData.P1
Represents the P1 member of this object. Read/write Double.
Remarks
The P1 member is never set or used by PC-DMIS. It is available for the programmer
to use as he wishes.
FeatData.P2
Represents the P2 member of this object. Read/write Double.
Remarks
The P2 member is never set or used by PC-DMIS. It is available for the programmer
to use as he wishes.
258 Automation
FeatData.ID
Represents the ID member of this object. Read/write String.
Remarks
The ID member is the default property.
The ID member is the default
File IO Members
Properties:
FileIO.BufferSize
LONG value representing the buffer size used with the Read Block File I/O
command.
Read/Write Long
FileIO.Expression
STRING value representing the text to be used in reading from or writing to the
opened file.
Read/Write String
FileIO.FailIfExists
BOOLEAN value indicating whether a file copy operation should fail or not if the
destination file already exists.
Read/Write Boolean
FileIO.FileIOType
Value of ENUM_FILE_IO_TYPES enumeration type which specifies the type of
File I/O operation the object will perform. Possible values include the following:
PCD_FILE_OPEN = 0
PCD_FILE_CLOSE = 1
PCD_FILE_WRITELINE = 2
PCD_FILE_READLINE = 3
PCD_FILE_WRITECHARACTER = 4
PCD_FILE_READCHARACTER = 5
PCD_FILE_WRITEBLOCK = 6
PCD_FILE_READBLOCK = 7
Automation 259
PCD_FILE_REWIND = 8
PCD_FILE_SAVEPOSITION = 9
PCD_FILE_RECALLPOSITION = 10
PCD_FILE_COPY = 11
PCD_FILE_MOVE = 12
PCD_FILE_DELETE = 13
PCD_FILE_EXISTS = 14
PCD_FILE_DIALOG = 15
FileIO.FileName1
STRING value representing the file name to be used in the File I/O operation. This
parameter is used with the File Open, File Copy, File Move, File Delete, and File
Exists File I/O types.
Read/Write String
FileIO.FileName2
STRING value representing the second filename to be used in the File I/O operation.
This parameter is used as the destination file in the File Copy and File Move File I/O
commands.
Read/Write String
FileIO.FileOpenType
Value of ENUM_FILE_OPEN_TYPES enumeration type which specifies the file
open mode used in opening a file. Possible values include the following:
PCD_FILE_WRITE = 1
PCD_FILE_READ = 2
PCD_FILE_APPEND = 3
FileIO.FilePointerID
STRING value representing the file pointer Id to be used in the File I/O operation.
The file pointer ID is established and linked to a specific file in the File Open
command.
Read/Write String
FileIO.VariableID
STRING value representing the name of the variable to be used to hold the results of
the File I/O operation of the File I/O command.
Read/Write String
260 Automation
FlowControlCommand Members
Properties:
FlowControlCommand.AngleOffset
Represents the angular offset of a LOOP_START object. Read/write Double.
Remarks
This property only affects objects of type LOOP_START. For other objects, setting
the property has no effect, and getting it always returns zero.
FlowControlCommand.GetEndNum
Represents the end value of a LOOP_START object. Read/write Long.
Remarks
This property only affects objects of type LOOP_START. For other objects, setting
the property has no effect, and getting it always returns zero.
FlowControlCommand.ErrorMode
Represents the error mode of a ONERROR object. Read/write Long.
Remarks
This property only affects objects of type ONERROR. For other objects, setting the
property has no effect, and getting it always returns zero.
The valid values for ErrorMode: 0 for off, 1 for jump to label, and 2 for set a
variable.
FlowControlCommand.ErrorType
Represents the error mode of a ONERROR object. Read/write Long.
Remarks
This property only affects objects of type ONERROR. For other objects, setting the
property has no effect, and getting it always returns zero.
The valid values for ErrorMode: 0 for off, 1 for jump to label, and 2 for set a
variable.
FlowControlCommand.Expression
Represents the test expression of an IF_COMMAND object. Read/write String.
Remarks
This property only affects objects of type IF_COMMAND. For other objects, setting
the property has no effect, and getting it always returns the empty string.
FlowControlCommand.FileName
Represents the file name of an external subroutine in a CALL_SUBROUTINE
object. Read/write String.
Remarks
Automation 261
This property only affects objects of type CALL_SUBROUTINE. For other objects,
setting the property has no effect, and getting it always returns the empty string.
This property only returns the name of the file, not its full path. The path is
determined by the settings in PCDMISs Search Directory dialog.
FlowControlCommand.ID
Represents the id of a CALL_SUBROUTINE object. Read/write String.
Remarks
This property only affects objects of type CALL_SUBROUTINE. For other objects,
setting the property has no effect, and getting it always returns the empty string.
FlowControlCommand.Label
Represents the label associated with an object. Read/write String.
Remarks
This property only affects objects of type GOTO, IF_COMMAND, ONERROR, and
LABEL. For other objects, setting the property has no effect, and getting it always
returns the empty string.
For objects of type LABEL, this property is the id of the object. For the other valid
types, this property is the label to which execution is redirected when the appropriate
conditions are met. For GOTO, redirection always occurs. For IF_COMMAND, the
redirection occurs only when the expression is TRUE. For ONERROR, the
redirection happens when the error condition is met.
FlowControlCommand.NumArguments
Returns the number of arguments in a START_SUBROUTINE or
CALL_SUBROUTINE object. Read-only Long.
Remarks
This property only affects objects of type START_SUBROUTINE and
CALL_SUBROUTINE. For other objects it always returns zero.
FlowControlCommand.SkipCount
Returns the number of skipped numbers in a LOOP_START object. Read-only
Long.
Remarks
This property only affects objects of type LOOP_START. For other objects it always
returns zero.
FlowControlCommand.StartNum
Represents the start number of a LOOP_START object. Read/write Long.
Remarks
This property only affects objects of type LOOP_START. For other objects, setting
the property has no effect, and getting it always returns zero.
FlowControlCommand.SubName
Represents the subroutine name of a START_SUBROUTINE and
CALL_SUBROUTINE object. Read/write String.
262 Automation
Remarks
This property only affects objects of type START_SUBROUTINE and
CALL_SUBROUTINE. For other objects, setting the property has no effect, and
getting it always returns the empty string.
For the START_SUBROUTINE object, it is the name of the subroutine. For the
CALL_SUBROUTINE, it is the name of the called subroutine.
FlowControlCommand.XAxisOffset
Represents the X-axis offset of a LOOP_START object. Read/write Long.
Remarks
This property only affects objects of type LOOP_START. For other objects, setting
the property has no effect, and getting it always returns zero.
FlowControlCommand.YAxisOffset
Represents the Y-axis offset of a LOOP_START object. Read/write Long.
Remarks
This property only affects objects of type LOOP_START. For other objects, setting
the property has no effect, and getting it always returns zero.
FlowControlCommand.ZAxisOffset
Represents the Z-axis offset of a LOOP_START object. Read/write Long.
Remarks
This property only affects objects of type LOOP_START. For other objects, setting
the property has no effect, and getting it always returns zero.
Methods:
FlowControlCommand.AddArgument
Syntax
Return Value=expression.AddArgument(Position, Name, Description,
DefaultValue)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to FlowControlCommand object.
Position: Required Long that indicates the index of the argument to add in the list of
arguments.
Name: Required String that indicates the name of the argument to be added.
Description: Required String that is the description of the argument to be added.
DefaultValue: Required String that indicates the default value of the argument to be
added.
The AddArgument adds or replaces an argument in objects of type
CALL_SUBROUTINE and START_SUBROUTINE. When used with objects of
other types, it has no effect.
Automation 263
This function returns TRUE if the argument was added successfully, FALSE
otherwise.
When used with objects of type CALL_SUBROUTINE, the Name and Description
fields are ignored, and the DefaultValue field is used to set the value.
If Position is equal to 1 + expression.NumArguments, an argument is added to the
tail of the list of arguments . If Position is between 1 and
expression.NumArguments, the current argument is replaced. To completely remove
an argument, use DimensionCommand.RemoveArgument.
FlowControlCommand.AddSkipNum
Syntax
Return Value=expression.AddSkipNum(Number)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to FlowControlCommand object.
Number: Required Long that indicates the number to skip.
The AddSkipNum function adds a number to be skipped to an object of type
LOOP_START. For objects of other types, it does nothing.
This function returns TRUE if Number was successfully added to the LOOP_START
objects skip list, FALSE otherwise.
FlowControlCommand.GetArgumentDescription
Syntax
Return Value=expression.GetArgumentDescription(Position)
Return Value: This function returns a string value.
expression: Required expression that evaluates to FlowControlCommand object.
Position: Required Long that indicates the number of the argument from which to
obtain the description..
The GetArgumentDescription function returns the description of an argument to an
object of type START_SUBROUTINE. For objects of other types, it returns the
empty string.
FlowControlCommand.GetArgumentExpression
Syntax
Return Value=expr.GetArgumentExpression(Expression)
Return Value: This function returns a string value.
expr: Required expression that evaluates to FlowControlCommand object.
Expression: Required Long that indicates the number of the argument from which to
obtain the value.
The GetArgumentDescription function returns the value or default value of an
argument to an object of type CALL_SUBROUTINE or START_SUBROUTINE,
respectively. For objects of other types, it returns the empty string.
264 Automation
FlowControlCommand.GetArgumentName
Syntax
Return Value=expression.GetArgumentName(Position)
Return Value: This function returns a string value.
expression: Required expression that evaluates to FlowControlCommand object.
Number: Required Long that indicates the number of the argument from which to
obtain the name..
The GetArgumentName function returns the Name of an argument to an object of
type START_SUBROUTINE. For objects of other types, it returns the empty string.
FlowControlCommand.GetSkipNum
Syntax
Return Value=expression.GetSkipNum(Index)
Return Value: This function returns an integer. The integer is the nth skip number
where n is indicated by the value of index.
expression: Required expression that evaluates to FlowControlCommand object.
Index: Required Long that indicates which skip number of the set of skip numbers to
retrieve.
FlowControlCommand.IsExpressionValid
Syntax
Return Value=expr.IsExpressionValid(Expression)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expr: Required expression that evaluates to FlowControlCommand object.
Expression: Required String that is the expression to evaluate for validity.
This function returns TRUE if the expression is valid, and FALSE otherwise.
FlowControlCommand.IsValidLeftHandValue
Syntax
Return Value=expr.IsValidLeftHandValue(Expression)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expr: Required expression that evaluates to FlowControlCommand object.
Expression: Required String that is the expression to evaluate for validity.
This function returns TRUE if the expression can be used as a valid left hand value
(i.e. can be used on the left-hand side of an assigment statement), and FALSE
otherwise.
FlowControlCommand.IsValidSubroutineArgumentName
Syntax
Return Value=expr.IsValidSuborutineArgumentName(Expression)
Automation 265
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expr: Required expression that evaluates to FlowControlCommand object.
Expression: Required String that is the argument name to evaluate for validity.
This function returns TRUE if the expression can be used as a valid suroutine
argument name, and FALSE otherwise.
FlowControlCommand.RemoveArgument
Syntax
Return Value=expression.RemoveArgument(Position)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to FlowControlCommand object.
Position: Required Long that indicates which argument to remove.
This function removes an argument from an object of type CALL_SUBROUTINE or
START_SUBROUTINE. It returns TRUE if an argument is removed successfully,
FALSE otherwise.
This function has an effect only on objects of type CALL_SUBROUTINE and
START_SUBROUTINE. It has no effect on objects of other types. If used on other
types it returns FALSE even if nothing is being done.
The Position argument should be between one and expression.NumArguments.
FlowControlCommand.RemoveSkipNum
Syntax
expression.RemoveSkipNum(Index)
expression: Required expression that evaluates to FlowControlCommand object.
Index: Required Long that indicates which argument to remove.
This function removes one of the skip numbers for the Loop Start object from the list
of skip numbers. The number removed is determined by the index parameter.
The Index argument should be between one and expression.SkipCount.
FlowControlCommand.SetArgumentDescription
Syntax
Return Value=expression.SetArgumentDescription(Position, Description)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to FlowControlCommand object.
Number: Required Long that indicates the number of the argument description to set.
Description: Required String that is the text of the description to set.
This function sets the description of an argument of an object of type
START_SUBROUTINE. It does nothing and returns FALSE if the object is not of
this type.
266 Automation
The function returns TRUE if the description was set successfully, FALSE
otherwise.
FlowControlCommand.SetArgumentExpression
Syntax
Return Value=expr.GetArgumentExpression(Position, Expression)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expr: Required expression that evaluates to FlowControlCommand object.
Position: Required Long that indicates the number of the argument value to set.
Expression: Required String that indicates the argument value to set.
This function sets the value or default value of an argument of an object of type
CALL_SUBROUTINE or START_SUBROUTINE, respectively. It does nothing
and returns FALSE if the object is not one of these types.
The function returns TRUE if the value was set successfully, FALSE otherwise.
FlowControlCommand.SetArgumentName
Syntax
Return Value=expr.GetArgumentExpression(Position, Expression)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expr: Required expression that evaluates to FlowControlCommand object.
Position: Required Long that indicates the number of the argument value to set.
Name: Required String that indicates the argument name to set.
This function sets the name of an argument of an object of type
START_SUBROUTINE. It does nothing and returns FALSE if the object is not of
this type.
The function returns TRUE if the value was set successfully, FALSE otherwise.
FlowControlCommand.SetLeftSideOfAssignment
Syntax
expr.SetLeftSideOfAssignmentExpression
expr: Required expression that evaluates to FlowControlCommand object.
Expression: Required String that indicates the expression to be used for the left side
of the assigment.
The function sets the left-hand side of the Assign statement to the expression passed
in. Use the function IsValidLeftHandValue to determine validity of expression for a
left-hand side before using this function.
FlowControlCommand.SetRightSideOfAssignment
Syntax
expr.SetRightSideOfAssignmentExpression
expr: Required expression that evaluates to FlowControlCommand object.
Automation 267
Expression: Required String that indicates the expression to be used for the right
side of the assigment.
The function sets the right-hand side of the Assign statement to the expression
passed in. Use the function IsExpressionValid to determine validity of expression
before using this function.
LeitzMot.MaxForce
Double value used to set or get the max force setting for the probe.
Read/Write Double
LeitzMot.PositionalAccuracy
Double value used to set or get the positional accuracy setting.
Read/Write Double
LeitzMot.ProbeAccuracy
Double value used to set or get the probe accuracy setting.
Read/Write Double
LeitzMot.ReturnData
Double value used to set or get the return data setting.
Read/Write Double
LeitzMot.ReturnSpeed
Double value used to set or get the return speed.
Read/Write Double
LeitzMot.ScanPointDensity
Double value used to set or get the scan point density.
268 Automation
Read/Write Double
LeitzMot.TriggerForce
Double value used to set or get the trigger force setting for the probe.
Read/Write Double
LeitzMot.UpperForce
Double value used to set or get the upper force setting for the probe.
Read/Write Double
Automation 269
Events differ from methods and properties in that PC-DMIS is the source of the
action, instead of the destination. To take advantage of events, the automation
controller application must support events. Visual Basic supports events. Handling
events involves declaring an object of type Machine and then adding handling
functions for the different events.
Machine.Name
Returns the name of the Machine object. Read-only String.
Machine.Parent
Returns the read-only Machines collection object to which the machine belongs.
Events:
Command(Long code)
This function is called when a command button is pressed on the
CMM controller. The code can be used to determine which button
was pressed.
270 Automation
vice versa. Use Machines(index) where index is the index number or on-line
machines name to return a single Machine object.
Remarks
There may be multiple machines named OFFLINE, one for each open off-line part
program. To distinguish between them, use the index number, or use the machines
Parent member.
Machines.Count
Represents the number of Machine objects currently active in PC-DMIS. Read-only
Integer.
Machines.Parent
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Methods:
Machines.Item
Syntax 1
Return Value=expression.Item(NameOrNum)
Syntax 2
expression(NameOrNum)
Return Value=The Item function returns a Machine object.
expression: Required expression that evaluates to a Machines object identified by
the NameOrNum parameter.
NameOrNum: Required Variant that indicates which Machine object to return. It
can be either a Long or a String. If it is a Long, it is the index number of the
Machine object in the Machines collection. If it is a String, it is the ID of the
Machine object.
Remarks
There may be several machines named OFFLINE. To avoid possible confusion
with off-line machines, use the index number with these machines.
Since the Item method is the default, the function name can be omitted as in Syntax
2.
Automation 271
ModalCommand Members
Properties:
ModalCommand.ClearPlane
Represents the clearance plane of a CLEARANCE_PLANES type object.
Read/Write Long.
Remarks
This property is only useful for objects of type CLEARANCE_PLANES. For objects
of other types, setting this property does nothing and getting it always returns
PCD_ZPLUS.
Allowable values for this property are PCD_XPLUS, PCD_XMINUS,
PCD_YPLUS, PCD_YMINUS, PCD_ZPLUS, and PCD_ZMINUS.
ModalCommand.Digits
Represents the number of digits of a DISPLAYPRECISION type object. Read/write
Long.
Remarks
This property is only useful for objects of type DISPLAYPRECISION. For objects
of other types, setting this property does nothing and getting it always returns zero.
ModalCommand.Distance
Represents the distance to move for this object. Read/write Double.
Remarks
This property is only useful for objects of type PREHIT, CLAMP, RETRACT,
CHECK, and CLEARANCE_PLANES. For objects of other types, setting this
property does nothing and getting it always returns zero.
For objects of type PREHIT, CLAMP, RETRACT, and CHECK, the Distance
property is the distance to move during that operation. For CLEARANCE_PLANES
objects, it is the distance from the axes plane to move. For example, if the clearance
plane is LEFT, and the Distance is 2.0, the clearance plane will move to the X=2.0
plane.
ModalCommand.Distance2
Represents the pass-through distance to move for this CLEARANCE_PLANES
object. Read/write Double.
Remarks
This property is only useful for objects of type CLEARANCE_PLANES. For objects
of other types, setting this property does nothing and getting it always returns zero.
272 Automation
ModalCommand.Mode
Represents the mode of this object. Read/write Long.
Remarks
This property is only useful for objects of type MAN_DCC_MODE and
RMEAS_MODE. For objects of other types, setting this property does nothing and
getting it always returns zero.
For objects of type MAN_DCC_MODE, the mode can take values 0 for DCC mode
and 1 for manual mode. For objects of type RMEAS_MODE, the mode can take
values 0 for NORMAL, and 1 for ABSOLUTE.
ModalCommand.Name
Returns the name of this GET_PROBE_DATA object. Read-only String.
Remarks
This property is only useful for objects of type GET_PROBE_DATA (LoadProbe).
For objects of other types, it always returns the empty string.
ModalCommand.On
Represents the on/off state of this object. Read/write Boolean.
Remarks
This property is only useful for objects of types PROBE_COMPENSATION,
POLARVECTORCOMP, GAP_ONLY, RETROLINEAR_ONLY, FLY_MODE,
and COLUMN132. For objects of other types, setting this property does nothing and
getting it always returns FALSE.
ModalCommand.Parent
Returns the parent Command object. Read-only.
Remarks
The parent of a ModalCommand object is the same underlying PC-DMIS object as
the ModalCommand object itself. Getting the parent allows you to access the
generic Command properties and methods of a given object.
ModalCommand.PassPlane
Represents the pass-through plane to move for this CLEARANCE_PLANES object.
Read/write Long.
Remarks
This property is only useful for objects of type CLEARANCE_PLANES. For objects
of other types, setting this property does nothing and getting it always returns
PCD_ZPLUS.
Allowable values for this property are PCD_XPLUS, PCD_XMINUS,
PCD_YPLUS, PCD_YMINUS, PCD_ZPLUS, and PCD_ZMINUS.
ModalCommand.Speed
Represents the speed for this object. Read/write Double.
Remarks
Automation 273
ModalCommand.WorkPlane
Represents the workplane to move for this SET_WORKPLANE object. Read/write
Long.
Remarks
This property is only useful for objects of type SET_WORKPLANE. For objects of
other types, setting this property does nothing and getting it always returns
PCD_ZPLUS.
Allowable values for this property are PCD_XPLUS, PCD_XMINUS,
PCD_YPLUS, PCD_YMINUS, PCD_ZPLUS, and PCD_ZMINUS.
MoveCommand Members
Properties:
MoveCommand.Angle
Represents the rotation angle of this MOVE_ROTAB object. Read/Write Double.
Remarks
This property is only useful for objects of type MOVE_ROTAB. For objects of other
types, setting this property does nothing and getting it always returns zero.
MoveCommand.Direction
Represents the rotation direction of this MOVE_ROTAB object. Read/Write
Double.
Remarks
This property is only useful for objects of type MOVE_ROTAB. For objects of other
types, setting this property does nothing and getting it always returns zero.
For objects of type MOVE_ROTAB, the allowable values of this property are
PCD_CLOCKWISE, PCD_COUNTERCLOCKWISE, and PCD_SHORTEST.
MoveCommand.NewTip
Represents the new tip position of this MOVE_PH9_OFFSET object. Read/Write
String.
Remarks
274 Automation
This property is only useful for objects of type MOVE_PH9_OFFSET. For objects
of other types, setting this property does nothing and getting it always returns the
empty string.
For objects of type MOVE_PH9_OFFSET, this property should have the value of the
ID of any tip in this part program.
MoveCommand.OldTip
Represents the new tip position of this MOVE_PH9_OFFSET object. Read/Write
String.
Remarks
This property is only useful for objects of type MOVE_PH9_OFFSET. For objects
of other types, setting this property does nothing and getting it always returns the
empty string.
For objects of type MOVE_PH9_OFFSET, this property should have the value of the
ID of any tip in this part program.
MoveCommand.Parent
Returns the parent Command object. Read-only.
Remarks
The parent of a MoveCommand object is the same underlying PC-DMIS object as
the MoveCommand object itself. Getting the parent allows you to access the generic
Command properties and methods of a given object.
MoveCommand.XYZ
A PointData object that represents the location to which to move, or in the case of
MOVE_INCREMENT, the location offset. Read/Write.
Remarks
This property is only useful for objects of type MOVE_POINT,
MOVE_INCREMENT, and MOVE_CIRCULAR. For objects of other types, setting
this property does nothing and getting it always returns Nothing.
Automation 275
OptMotion.MaxTSpeed
Double value used to set or get the maximum speed in T setting.
Read/Write Double
OptMotion.MaxXAcceleration
Double value used to set or get the maximum acceleration in X setting.
Read/Write Double
OptMotion.MaxYAcceleration
Double value used to set or get the maximum acceleration in Y setting.
Read/Write Double
OptMotion.MaxZAcceleration
Double value used to set or get the maximum acceleration in Z setting.
Read/Write Double
OptMotion.MovePositionalAccuracy
Double value used to set or get the move positional accuracy setting.
Read/Write Double
PartProgram Members
Properties:
PartProgram.ActiveMachine
Returns the Machine object associated with this part program. Read-only.
276 Automation
PartProgram.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
PartProgram.Commands
Returns the Commands collection object of this part program. Read-only.
PartProgram.EditWindow
Returns the Editwindow object associated with this part program. Read-only.
PartProgram.FullName
Returns the part programs full file path and name. Read-only String. If the file
name of the part program is C:\PCDMISW\PARTS\1.PRG, the FullName returns
C:\PCDMISW\PARTS\1.PRG.
PartProgram.Name
Returns the part programs file name. Read/Write String. If the file name of the part
program is C:\PCDMISW\PARTS\1.PRG, the FullName returns 1.PRG.
PartProgram.OldBasic
Returns this part programs OldBasic object. Read-only.
The OldBasic object contains all of the methods from the old basic command set
used in previous versions of PC-DMIS.
PartProgram.Parent
Returns the PartPrograms collection object to which this part program belongs.
Read-only.
PartProgram.PartName
Represents the part name of the part program. Read/Write String.
Remarks
The part name is not the same as the file name. You can view and set the part name
in the Properties of the file containing the part program, as well as at the top of the
edit window within PC-DMIS.
PartProgram.Path
Returns the part programs file path. Read/Write String. If the file name of the part
program is C:\PCDMISW\PARTS\1.PRG, the FullName returns
C:\PCDMISW\PARTS\.
PartProgram.Probes
The Probes property returns this part programs Probes collection object. Readonly.
PartProgram.RevisionNumber
Represents the part programs revision number. Read/Write String.
Automation 277
Remarks
You can view and set the revision number in the Properties of the file containing the
part program, as well as at the top of the edit window within PC-DMIS.
PartProgram.SerialNumber
Represents the part programs serial number. Read/Write String.
Remarks
You can view and set the serial number in the Properties of the file containing the
part program, as well as at the top of the edit window within PC-DMIS.
PartProgram.Tools
The Tools property returns this part programs Tools collection object. Read-only.
PartProgram.Visible
Represents the part programs visibility status. Read/Write Boolean.
Methods:
PartProgram.Close
Syntax
expression.Close
expression: Required expression that evaluates to a PartProgram object.
This subroutine saves, closes, and deactivates the part program.
PartProgram.Export
Syntax
Return Value=expression.Export(FileName)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PartProgram object.
FileName: Required String that denotes the file name to which to export.
Remarks
This function exports CAD or part data from the part program to the indicated file.
The export format is determined by the file name extension of FileName.
PartProgram.Import
Syntax
Return Value=expression.Import(FileName)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PartProgram object.
FileName: Required String that denotes the file name from which to import.
278 Automation
Remarks
This function imports CAD or part data from the indicated file to the part program.
The file format is determined by the file name extension of FileName.
PartProgram.MessageBox
Syntax
Return Value=expression.MessageBox(Message,Title,Type)
Return Value: Integer value of the button chosen by the user.
expression: Required expression that evaluates to a PartProgram object.
Message: Required String that is the message of the message box
Title: Optional String that is the title of the message box. If ommitted, the title will
be the name and version of PC-DMIS.
Type: Optional Long used to indicate the button types to be used in the message
box. Examples include, OK, Cancel, Retry, Yes, No etc. If ommitted, the
default is OK.
Remarks
This function uses the PC-DMIS message box function. It includes all functionality
including cancelling of execution tied to the Cancel button.
PartProgram.Quit
Syntax
Return Value=expression.Quit
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails. TRUE if the part was quit successfully, FALSE
otherwise.
PartProgram.Save
Syntax
Return Value=expression.Save
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails. TRUE if the part was saved successfully, FALSE
otherwise.
PartProgram.SaveAs
Syntax
Automation 279
Return Value=expression.SaveAs(name)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails. TRUE if the part was saved successfully, FALSE
otherwise.
expression: Required expression that evaluates to a PartProgram object.
name: Optional expression that evaluates to a String. The file name to which to save.
This subroutine saves the part program. If the name parameter is missing or empty,
PC-DMIS asks for a file name using a Save As dialog.
PartPrograms.Count
Returns the number of part programs active in PC-DMIS. Read-only Long.
PartPrograms.Parent
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Methods:
PartPrograms.Add
Syntax
Return Value=expression.Add(FileName, Units)
Return Value: This function returns the added PartProgram object
expression: Required. An expression that returns a PartPrograms object.
280 Automation
FileName: Required String. The file name in which to store the new PartProgram.
Units: Required Long. Set units to 1 for inches, anythings else for millimeters.
Remarks
The Add function creates a new part program and activates it in PC-DMIS. If a part
program named FileName exists, it is loaded and the Units parameter is ignored.
PartPrograms.CloseAll
Syntax
expression.CloseAll
expression: Required. An expression that returns a PartPrograms object.
Remarks
Closes and deactivates all active part programs in PC-DMIS.
PartPrograms.Item
Syntax 1
Return Value=expression.Item(NameOrNum)
Syntax 2
expression(NameOrNum)
Return Value=The Item function returns a PartProgram object.
expression: Required expression that evaluates to a PartPrograms object.
NameOrNum: Required Variant that indicates which PartProgram object to return.
It can be either a Long or a String. If it is a Long, it is the index number of the
PartProgram object in the PartPrograms collection. If it is a String, it is the ID of
the PartProgram object.
Remarks
Since the Item method is the default, the function name can be omitted as in Syntax
2.
Return Value
The PartProgram Object identified by the NameOrNum parameter.
PartPrograms.Open
Syntax
Return Value=expression.Open(FileName)
Return Value: This function returns the opened PartProgram object. If the file does
not exist, the function returns Nothing.
expression: Required. An expression that returns a PartPrograms object.
FileName: Required String. The file name of the PartProgram to open.
Remarks
The Open Function activates the part program stored in the file FileName. If the file
does not exist, nothing happens.
Automation 281
PartPrograms.Remove
Syntax
Return Value=expression.Remove(NameOrNum)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails. If the function was able to close a part program, it
returns TRUE, otherwise FALSE.
expression: Required expression that evaluates to a PartPrograms object.
NameOrNum: Required Variant that indicates which PartProgram object to return.
It can be either a Long or a String. If it is a Long, it is the index number of the
PartProgram object in the PartPrograms collection. If it is a String, it is the ID of
the PartProgram object.
Remarks
The Remove function saves, closes, and deactivates the indicated part program. That
part program is no longer active in PC-DMIS.
PointData Members
Properties
PointData.X
Represents the X member of this object. Read/write Double.
PointData.Y
Represents the Y member of this object. Read/write Double.
PointData.Z
Represents the Z member of this object. Read/write Double.
PointData.I
Represents the X member of this object. Read/write Double.
Remarks
282 Automation
This property is exactly the same as the X property, but was included for semantic
reasons when working with vectors.
PointData.J
Represents the X member of this object. Read/write Double.
Remarks
This property is exactly the same as the Y property, but was included for semantic
reasons when working with vectors.
PointData.K
Represents the Z member of this object. Read/write Double.
Remarks
This property is exactly the same as the Z property, but was included for semantic
reasons when working with vectors.
Probe Members
Properties:
Probe.ActiveComponent
Represents the highlighted probe component in PC-DMISs Probe dialog. Read/write
Long.
Example:
The following VB code illustrates how to create a probe containing a PH9, a TP2,
and a 5 mm tip, from scratch in the active part program
set app = GetObject(Pcdlrn.Application)
set part = app.GetActiveProgram
set probe = part.Probes.Add(NewProbe)
probe.ActiveComponent=0
for I = 0 to probe.ConnectionCount 1
if (probe.ConnectionDescription(I) = PROBEPH9)
probe.ActiveConnection = I
end if
next I
probe.ActiveComponent = ComponentCount 1
for I = 0 to probe.ConnectionCount 1
if (probe.ConnectionDescription(I) = PROBETP2)
probe.ActiveConnection = I
end if
next I
probe.ActiveComponent = ComponentCount 1
Automation 283
for I = 0 to probe.ConnectionCount 1
if (probe.ConnectionDescription(I) = TIP5BY50MM)
probe.ActiveConnection = I
end if
next I
Probe.ActiveConnection
Represents the highlighted probe connection in PC-DMISs Probe dialogs
connection drop-down list. Read/write Long.
Probe.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Probe.ComponentCount
Returns the number of components in the component list box. There is always at
least one, even when it appears that there are no entries. In that case, the one entry is
invisible, but it can still be made active.
Probe.ConnectionCount
Returns the number of connections in the connection drop-down list. The contents of
this list depend on which component is active.
Probe.FullName
Returns the full name of the file containing this probes information. Read-only
String. If the fully qualified path name is C:\PCDMISW\PROBE\SP600.PRB,
FullName returns C:\PCDMISW\PROBE\SP600.PRB.
Probe.Name
Returns the name of the file containing this probes information. Read-only String.
If the fully qualified path name is C:\PCDMISW\PROBE\SP600.PRB, FullName
returns SP600.PRB.
Probe.Parent
Returns the Probes collection object to which this object belongs.
Probe.Path
Returns the path to the file containing this probes information. Read-only String. If
the fully qualified path name is C:\PCDMISW\PROBE\SP600.PRB, Path returns
C:\PCDMISW\PROBE\.
Probe.Tips
Returns the Tips object associated with this Probe object.
284 Automation
Methods:
Probe.ClearAllTips
Syntax
expression.ClearAllTips
expression: Required expression that evaluates to a PC-DMIS Probe object.
Clears all tips selected for qualification. Use the "Probe.SelectAllTips" funtion on
page 286 to select all tips. Use the "Tip.Selected" property of the tip object on page
303 to select or deselect individual tips for probe qualification.
Probe.ComponentDescription
Syntax
Return Value=expression.ComponentDescription(Item)
Return Value: This function returns a string which is the nth component description
of the component list box as determined by the item parameter.
expression: Required expression that evaluates to a PC-DMIS Probe object.
Item: Required Long. The zero-based index of the string from the list box to return.
This must be between 0 and expression.ComponentCount 1.
Probe.ConnectionDescription
Syntax
Return Value=expression.ComponentDescription(Item)
Return Value: This function returns the Item number string in the connection drop
down list..
expression: Required expression that evaluates to a PC-DMIS Probe object.
Item: Required Long. The zero-based index of the string from the drop down list to
return. This must be between 0 and expression.ConnectionCount 1.
Probe.Dialog
Syntax
Return Value=expression.Dialog
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS Probe object.
Opens the PC-DMIS Probe Utilities dialog for expression.
Probe.Qualify
Syntax
expression.Qualify
expression: Required expression that evaluates to a PC-DMIS Probe object.
Qualifies all of expressions tips.
Automation 285
Probe.SelectAllTips
Syntax
expression.SelectAllTips
expression: Required expression that evaluates to a PC-DMIS Probe object.
Selects all tips in tip list for qualification. Use the "Probe.ClearAllTips" function on
page 285 to clear all selected tips. Use the "Tip.Selected" property of the tip object
on page 303 to select or deselect individual tips for probe qualification.
Probes.Count
Represents the number of Machine objects currently active in PC-DMIS. Read-only
Integer.
Probes.Parent
Returns the parent PartProgram of this object. Read-only PartProgram.
Methods:
Probes.Add
Syntax 1
Return Value=expression.Add(FileName)
The Add function sets the probe name to FileName. This allows the user to start
creating a new probe.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a Probes object.
FileName: Required String that indicates the name of the new probe.
286 Automation
Probes.Item
Syntax 1
Return Value=expression.Item(NameOrNum)
Syntax 2
expression(NameOrNum)
Return Value=The Item function returns a Probe object.
expression: Required expression that evaluates to a Probes object.
NameOrNum: Required Variant that indicates which Probe object to return. It can
be either a Long or a String. If it is a Long, it is the index number of the Probe
object in the Probes collection. If it is a String, it is the name of the Probe object.
Remarks
Since the Item method is the default, the function name can be omitted as in Syntax
2.
ScanCommand Members
Properties
Scan.BoundaryCondition
Represents the boundary condition type. Read/write of enumeration
BSBOUNDCOND_ENUM. All Properties and Methods related to the Boundary
Conditions apply only to DCC scans.
The following are the allowable values:
BSBOUNDCOND_SPHENTRY: Represents a Spherical Boundary Condition. This
Boundary condition requires the following parameters to be set by you using
Automation Properties and/or Automation Methods:
BoundaryConditionCenter
BoundaryConditionEndApproach
Diameter
Number of Crossings
Automation 287
BoundaryConditionPlaneV
Number of Crossings
Scan.BoundaryConditionAxisV
This property represents the boundary condition axis vector. Read/write PointData
object. This vector is used as the axis of the Cylindrical and Conical
BoundaryConditions.
Scan.BoundaryConditionCenter
This property represents the boundary condition center. Read/write PointData
object.
This point is used by all Boundary Conditions and is the location of the Boundary
Condition.
Scan.BoundaryConditionEndApproach
This property represents the boundary condition end approach vector. Read/write
PointData object.
This vector is used by all Boundary Conditions and is the Approach Vector of the
Probe as it crosses the Boundary condition.
Scan.BoundaryConditionPlaneV
This property represents the boundary condition plane vector. Read/write PointData
object.
This vector is the normal vector of the plane used by the Plane and OldStyle
Boundary Conditions.
288 Automation
Boundary
Condition
Properties Required
Plane
BoundaryConditionCenter
BoundaryConditionEndApproach
BoundaryConditionPlaneV
BoundaryConditionCenter
BoundaryConditionEndApproach
BoundaryConditionAxisV
BoundaryConditionCenter
BoundaryConditionEndApproach
BoundaryConditionAxisV
BoundaryConditionCenter
BoundaryConditionEndApproach
Cone
Cylinder
Sphere
Scan.Filter
This property represents the filter type. Read/write of enumeration BSF_ENUM.
The following are the allowable values:
BSF_DISTANCE: PC-DMIS determines each hit based on the set increment and the
last two measured hits. The approach of the probe is perpendicular to the line
between the last two measured hits. The probe will stay on the cut plane. PC-DMIS
will start at the first boundary point and continue taking hits at the set increment,
stopping when it satisfies the Boundary Condition. In the case of a continous scan,
PC-DMIS would filter the data from the CMM and keep only the hits that are apart
by at least the increment. Both DCC and Manual scans can use this filter.
BSF_BODYAXISDISTANCE: PC-DMIS will take hits at the set increment along
the current parts coordinate system. The approach of the probe is perpendicular to
the indicated axis. The probe will stay on the cut plane. The approach vector will be
normal to the selected axis and on the cut plane. This technique uses the same
approach for taking each hit (unlike the previous technique which adjusts the
approach to be perpendicular to the line between the previous two hits). The above
behaviour applies to DCC scans.
When this filter is applied to Manual scans, the following behaviour happens:
This Filter property allows you to scan a part by specifying a cut plane on a certain
part axis and dragging the probe across the cut plane. As you scan the part, you
should scan so that the probe crisscrosses the defined Cut Plane as many times as
desired. PC-DMIS then follows this procedure:
1)
PC-DMIS gets data from the controller and finds the two
data hits that are closest to the Cut Plane on either side
as you crisscross.
2)
PC-DMIS then forms a line between the two hits which will
pierce the Cut Plane.
3)
This operation happens every time you cross the Cut Plane and you will finally have
many hits that are on the Cut Plane.
BSF_VARIABLEDISTANCE: This technique allows you to set specific maximum
and minimum angle and increment values that will be used in determining where PCDMIS will take a hit. The probes approach is perpendicular to the line between the
last two measured hits. You should provide the maximum and minimum values that
Automation 289
will be used to determine the increments between hits. You also must enter the
desired values for the maximum and minimum angles. PC-DMIS will take three hits
using the minimum increment. It will then measure the angle between hits 1-2 and 23.
PC-DMIS will again measure the angle between the newest hit and the two previous
hits. It will continue to erase the last hit and drop the increment value to one quarter
of the increment until the measured angle is within the range defined, or the
minimum value of the increment is reached.
If the measured angle is less than the minimum angle, PC-DMIS will double the
increment for the next hit. (If this is greater than the maximum increment value it
will take the hit at the maximum increment.) PC-DMIS will again measure the angle
between the newest hit and the two previous hits. It will continue to double the
increment value until the measured angle is within the range defined, or the
maximum increment is reached. The above behaviour applies to DCC scans.
When this filter is applied to Manual scans, the following behaviour occurs:
The filter defines the distance between hits based on the part. PC-DMIS allows you
to specify the speed at which it will read hits and the drop point distance. After the
scanning process is complete, PC-DMIS will calculate the total number of hits that
were measured and the total number that were kept after completing the drop point
distance calculations. The reduced data is then converted to hits.
The Time Delta method of scanning allows you to reduce the scan data by setting a
time increment. PC-DMIS will start from the first hit and reduce the scan by deleting
hits that are read in faster than the time delta specified.Scan.HitType
Represents the type of hit to use. Read/write of enumeration BSCANHIT_ENUM.
The following are the allowable values:
BSCANHIT_VECTOR use vector hits for this scan
BSCANHIT_SURFACE use surface hits for this scan
BSCANHIT_EDGE use edge hits for this scan.
BSCANHIT_BASIC use basic hits for this scan. Only Manual scans use this hit
type. Currently there are no Manual Scans.
Remarks
Not every hit type can be used with every method and filter combination.
Method
Open
Vector
Hit
Y
Surface
Hit
Y
Basic Hit
Edge
Hit
Y
Close
HardProb
TTP
290 Automation
Patch
Scan.Method
This property represents the method type for this scan. Read/write of enumeration
BSMETHOD_ENUM.
The following are the allowable values:
BSCANMETH_OPEN: This method will scan the surface along a line. This
procedure uses the starting and ending point for the line and also includes a direction
point. The probe will always remain within the cut plane while doing the scan. This
is valid oly for DCC scans.
BSCANMETH_CLOSE: This method will scan the surface along a line. This
procedure uses the starting and ending point for the line and also includes a direction
point. The probe will always remain within the cut plane while doing the scan.The
scan will start and finish at the same Point. This is valid oly for DCC scans.
BSCANMETH_PATCH: This method will scan the surface in multiple rows
depending on the Boundary Points. This is valid oly for DCC scans.
BSCANMETH_MANUAL_TTP: This is valid only for Manual scans and will allow
you to use a Touch Trigger Probe to take Manual hits.
BSCANMETH_MANUAL_FIXED_PROBE: This is valid only for Manual scans
and will allow you to use a Hard Probe to take Manual
hits.Scan.MethodCutPlane
This property represents the methods cut plane vector. Read/write PointData
object.
Scan.MethodEnd
This property represents the scans end point. Read/write PointData object.
Scan.MethodEndTouch
This property represents the methods end touch vector. Read/write PointData
object.
Scan.MethodInitDir
This property represents the methods initial direction vector. Read/write PointData
object.
Scan.MethodInitTopSurf
This property represents the initial Surface Vector for the Edge method. Read/write
PointData object.
Scan.MethodInitTouch
This represents the methods initial touch vector. Read/write PointData object.
Scan.MethodStart
This property represents the scans start point. Read/write PointData object.
Method
Method
Start
Method
End
Method
Cutpla
ne
Method
InitDir
Method
InitTou
ch
Method
InitTop
Surf
Method
EndTo
uch
Automation 291
Open
Close
Patch
TTP
HardProbe
Scan.NominalMode
This property represents how to determine the nominals for this scan. Read/write of
enumeration BSCANNMODE_ENUM.
The following are the allowable values:
BSCANNMODE_FINDCADNOMINAL: This mode would find the Nominal data
from CAD after scanning. This mode is useful only when CAD surface data is
available.
SCANNMODE_MASTERDATA: This mode keeps the data scanned the first time
as Master data.
Scan.OperationMode
This property represents mode of operation of the scan. Read/write of enumeration
BSOPMODE_ENUM.
The following are the allowable values:
BSCANOPMODE_REGULARLEARN: When this mode is used, PC-DMIS will
execute the scan as though it is learning it. All learned measured data will replace the
new measured data. The nominal will be re-calculated depending on the Nominals
mode.
BSCANOPMODE_DEFINEPATHFROMHITS: This mode is available only when
using analog probe heads that can do continuous contact scanning. When this option
is selected, PC-DMIS allows the controller to define a scan. PC-DMIS gathers all
hit locations from the editor and passes them onto the controller for scanning. The
controller will then adjust the path allowing the probe to pass through all the points.
The data is then reduced according to the increment provided and the new data will
replace any old measured data This value cannot be used currently through
Automation because there is no Method provided to define a path.
BSCANOPMODE_NORMALEXECUTION: If a DCC scan is executed, PC-DMIS
will take hits at each of the learned locations in Stitch scanning mode, storing the
newly measured data.
Method
Regular
Learn
Defined
Path
Normal
Open
Close
Patch
TTP
292 Automation
HardProbe
Methods:
Scan.GetBoundaryConditionParams
Syntax
Return Value=expression. GetBoundaryConditionParams (nCrossings,
dRadius, dHalfAngle)
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
nCrossing: Required Long variable that gets the number of crossings for this
boundary condition. The scan would stop after the probe crosses (breaks) the
Boundary Condition like a Sphere, Cylinder, Cone, or a Plane the given number of
times.
dRadius: Required Double variable that gets the radius of the boundary condition.
This is used by the Spherical and Cylindrical Boundary Conditions.
dHalfAngle: Required Double variable that gets the half-angle of the cone-type
boundary condition, or gets zero if the boundary condition is not of cone type.
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
Remarks
Scan.GetFilterParams
Syntax
Return Value=expression. GetFilterParams (dCutAxisLocation, nAxis,
dMaxIncrement, dMinIncrement, dMaxAngle, dMinAngle)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
dCutAxisLocation: Used for Manual scans with Filter property set to
BSF_BODYAXISDISTANCE.
nAxis: Required Long variable that gets the cut axis. Returns non-zero only for axis
filters. For axis filters, 0 means the X axis, 1 means the Y-axis, and 2 means the Zaxis.
dMaxIncrement: Required Double variable that gets the maximum increment. For
fixed-length filters, this is simply the fixed increment. This is the Time delta valus in
case the filter is BSF_TIME_DELTA or BSF_VARIABLEDISTANCE for Manual
scans.
dMinIncrement: Required Double variable that gets the minimum increment for
Variable Distance Filters. This is the Drop Point distance when a Manul scan is
being used with the filter set to BSF_VARIABLEDISTANCE.
dMaxAngle: Required Double variable that gets the maximum angle used in
Variable Distance Filters.
dMinAngle: Required Double variable that gets the minimum angle used in Variable
Distance Filters.
Automation 293
Remarks
Filter
Distance
BodyAxisDistance (DCC)
BodyAxisDistance
(Manual)
Time
VariableDistance
GetFilterParams
(dCutAxisLocation, nAxis,
dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle)
,,dMaxIncrement
,nAxis, dMaxIncrement
NCutLocation,nAxis
,,dMaxIncrement
,,dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle
Scan.GetHitParams
Syntax
Return Value=expression. GetHitParams (nInitSamples, nPermSamples,
dSpacer, dIndent, dDepth)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
nInitSamples: Required Long variable that gets the number of initial sample hits for
the hits in this scan. It always returns zero for basic hits and vector hits.
nPermSamples: Required Long variable that gets the number of permanent sample
hits for the hits in this scan. It always returns zero for basic hits and vector hits.
dSpacer: Required Double variable that gets the spacing of the sample hits from the
hit center. It always returns zero for basic hits and vector hits.
dIndent: Required Double variable that gets the indent of the sample hits from the hit
center. It always returns zero for basic hits, vector hits, and surface.
dDepth: Required Double variable that gets the depth of the sample hits from the hit
center. It always returns zero for basic hits, vector hits, and surface.
Scan.GetMethodPointData
Syntax
Return Value=expression. GetMethodPointData (MethodStart, MethodEnd,
MethodInitTouch, MethodEndTouch, MethodInitDir, MethodCutPlane)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
MethodStart: Required PointData object that gets the MethodStart property.
MethodEnd: Required PointData object that gets the MethodEnd property.
MethodInitTouch: Required PointData object that gets the MethodInitTouch
property.
294 Automation
MS = scan.MethodStart
ME = scan.MethodEnd
MIT = scan.MethodInitTouch
MET = scan.MethodEndTouch
MID = scan.MethodInitDir
MCP = scan.MethodCutPlane
This method is provided as a shortcut to getting these commonly used properties all
at once.
Scan.GetNomsParams
Syntax
Return Value=expression. GetNomsParams (dFindNomsTolerance,
dSurfaceThickness, dEdgeThickness)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
dFindNomsTolerance: Required Double variable that gets the Find Noms tolerance
and is used only when the NominalMode property is
BSCANNMODE_FINDCADNOMINAL.
dSurfaceThickness: Required Double variable that gets the surface thickness and is
used only when the NominalMode property is
BSCANNMODE_FINDCADNOMINAL.
dEdgeThickness: Required Double variable that gets the edge thickness and is used
only when the NominalMode property is BSCANNMODE_FINDCADNOMINAL
and when the Method property is BSCANMETH_EDGE.
Scan.GetParams
Syntax
Return Value=expression. GetParams (Method, Filter, OperationMode,
HitType, NominalMode, BoundaryCondition)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
Method: Required Long variable that gets the Method property.
Filter: Required Long variable that gets the Filter property.
Automation 295
=
=
=
=
=
=
scan.Method
scan.Filter
scan.OperationMode
scan.HitType
scan.NominalMode
scan.BoundaryCondition
This method is provided as a shortcut to getting these commonly used properties all
at once.
Scan.SetBoundaryConditionParams
Syntax
Return Value=expression.SetBoundaryConditionParams (nCrossings,
dRadius, dHalfAngle)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
nCrossing: Required Long that sets the number of crossings for this boundary
condition.
dRadius: Required Double that sets the radius of the boundary condition.
dHalfAngle: Required Double that sets the half-angle of the cone-type boundary
condition, or is ignored if the boundary condition is not of cone type.
Remarks
Scan.SetFilterParams
Syntax
Return Value=expression.SetFilterParams (dCutAxisLocation, nAxis,
dMaxIncrement, dMinIncrement, dMaxAngle, dMinAngle)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
dCutAxisLocation: Used for Manual scans with Filter property set to
BSF_BODYAXISDISTANCE.
296 Automation
nAxis: Long variable that gets the cut axis. Returns non-zero only for axis filters. For
axis filters, 0 means the X axis, 1 means the Y-axis, and 2 means the Z-axis.
dMaxIncrement: Double variable that gets the maximum increment. For fixed-length
filters, this is simply the fixed increment. This is the Time delta valus in case the
filter is BSF_TIME_DELTA or BSF_VARIABLEDISTANCE for Manual scans.
dMinIncrement: Double variable that gets the minimum increment for Variable
Distance Filters. This is the Drop Point distance when a Manul scan is being used
with the filter set to BSF_VARIABLEDISTANCE.
dMaxAngle: Double variable that gets the maximum angle used in Variable Distance
Filters.
dMinAngle: Double variable that gets the minimum angle used in Variable Distance
Filters.
Remarks
Filter
SetFilterParams (dCutAxisLocation,
nAxis, dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle)
Distance
BodyAxisDistance
VariableDistance
,,dMaxIncrement
,nAxis, dMaxIncrement
,,dMaxIncrement, dMinIncrement,
dMaxAngle, dMinAngle
Scan.SetHitParams
Syntax
Return Value=expression.SetHitParams (nInitSamples, nPermSamples,
dSpacer, dIndent, dDepth)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
nInitSamples: Required Long that sets the number of initial sample hits for the hits
in this scan. It is ignored for basic hits and vector hits.
nPermSamples: Required Long that sets the number of permanent sample hits for the
hits in this scan. It is ignored for basic hits and vector hits.
dSpacer: Required Double that sets the spacing of the sample hits from the hit
center. It is ignored for basic hits and vector hits.
dIndent: Required Double that sets the indent of the sample hits from the hit center.
It is ignored for basic hits, vector hits, and surface.
dDepth: Required Double that sets the depth of the sample hits from the hit center. It
is ignored for basic hits, vector hits, and surface.
Scan.SetMethodPointData
Syntax
Return Value=expression.SetMethodPointData (MethodStart, MethodEnd,
MethodInitTouch, MethodEndTouch, MethodInitDir, MethodCutPlane)
Automation 297
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
MethodStart: Required PointData object that sets the MethodStart property.
MethodEnd: Required PointData object that sets the MethodEnd property.
MethodInitTouch: Required PointData object that sets the MethodInitTouch
property.
MethodEndTouch: Required PointData object that sets the MethodEndTouch
property.
MethodInitDir: Required PointData object that sets the MethodInitDir property.
MethodCutPlane: Required PointData object that sets the MethodCutPlane property.
Remarks
If scan is a ScanCommand object, and MS, ME, MIT, MET, MID,and MCP are all
dimensioned as Object, the following are equivalent:
scan.SetMethodParams MS,ME,MIT,MET,MID,MCP
set
set
set
set
set
set
scan.MethodStart = MS
scan.MethodEnd = ME
scan.MethodInitTouch = MIT
scan.MethodEndTouch = MET
scan.MethodInitDir = MID
scan.MethodCutPlane = MCP
This method is provided as a shortcut to setting these commonly used properties all
at once.
Scan.SetNomsParams
Syntax
Return Value=expression.SetNomsParams (dFindNomsTolerance,
dSurfaceThickness, dEdgeThickness)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
dFindNomsTolerance: Required Double that sets the Find Noms tolerance.
dSurfaceThickness: Required Double that sets the surface thickness.
dEdgeThickness: Required Double that sets the edge thickness.
Remarks
Scan.SetParams
Syntax
Return Value=expression.SetParams (Method, Filter, OperationMode,
HitType, NominalMode, BoundaryCondition)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
298 Automation
This method is provided as a shortcut to setting these commonly used properties all
at once.
Scan.CreateBasicScan
Syntax
Return Value=expression. CreateBasicScan()
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a PC-DMIS ScanCommand
object.
This method has to be called after calling other Properties/Methods. This method
creates the necessary BasicScans needed by DCC and Manual scans and inserts them
into the Part Program.
Statistics Members
Properties:
Statistics.CalcMode
LONG value representing whether calculation mode inside of DataPage is turned off
or on.
Automation 299
Read/Write Long
Statistics.MemoryPages
LONG value representing number of memory pages to be used by DataPage.
Read/Write Long
Statistics.NameType
ENUM_STAT_NAME_TYPES enumeration value indicating whether the feature
name or the dimension name should be sent to DataPage. If set to
PCD_STAT_FEAT_NAME (1), the feature name is used. If set to
PCD_STAT_DIM_NAME (0), the dimension name is used.
Read/Write ENUM_STAT_NAME_TYPES enumeration
Statistics.ReadLock
LONG value representing the number of seconds in timeout period that DataPage
uses when trying to read the port lock.
Read/Write Long
Statistics.StatMode
ENUM_PCD_STAT_TYPES enumeration value representing the mode or function
of the statistics command. Possible values include the following:
PCD_STATS_OFF = 0
PCD_STATS_ON = 1
PCD_STATS_TRANSFER = 2
PCD_STATS_UPDATE = 3
Statistics.WriteLock
LONG value representing number of seconds in timeout period that DataPage uses
when trying to write to the port lock.
Read/Write Long
Methods:
Statistics.AddStatsDir
Syntax:
expression.AddStatsDir (Dir)
Return Value: Boolean value indicating success or failure of call to method.
expression: Required expression that evaluates to a PC-DMIS Statistics object.
Dir: Required String representing the name of the directory to be added to the list of
statistics directories.
Statistics.GetStatsDir
Syntax:
300 Automation
expression.GetStatsDir (Index)
Return Value: String representing the name of the directory at the specified index
value. If index value is greater than the number of directories in the list, the string
will be empty.
expression: Required expression that evaluates to a PC-DMIS Statistics object.
Index: Required Long representing the index of the directory name to be retrieved.
Statistics.RemoveStatsDir
Syntax:
expression.RemoveStatsDir (Index)
Return Value: Boolean value indicating success or failure of call to remove
directory from the list of directories. If index is greater than the number of directories
in the list, the call will fail.
expression: Required expression that evaluates to a PC-DMIS Statistics object.
Index: Required Long representing the line of text to be removed.
Statistics.SetStatsDir
Syntax:
expression.SetStatsDir (Index, Dir)
Return Value: Boolean value indicating success or failure of call to set name of the
directory specified by Index. If the index value is greater than the number of
directories, the call will fail.
expression: Required expression that evaluates to a PC-DMIS Statistics object.
Index: Required Long representing the directory name to change.
Dir: Required String which is the new name of the directory.
TempComp.LowThreshold
DOUBLE value representing the low temperature threshold.
Automation 301
Read/Write Double
TempComp.MaterialCoefficient
DOUBLE value indicating the material coefficient.
Read/Write Double
TempComp.RefTemp
DOUBLE value representing the reference temperature.
Read/Write Double
TempComp.Sensors
STRING value representing the list of sensorsby numberto be used for
temperature compensation. The format of the list is a series of consecutive sensor
numbers. The series are specified using the hyphen between the first number and the
last number of the series. Each non-consecutive sensor or group of sensors is
separated by the comma (or the typical separator for the given locale).
Read/Write String
Example: The sensors 2, 4, 5, 6, 8, 10, 11, 12, 13 would be represented as 2,46,8,10-13.
Methods:
TempComp.GetOrigin
Syntax:
expression.GetOrigin (X, Y, Z)
expression: Required expression that evaluates to a PC-DMIS TempComp object.
X: Required Long variable that receives the X value of the temperature
compensation origin.
Y: Required Long variable that receives the Y value of the temperature
compensation origin.
Z: Required Long variable that receives the Z value of the temperature compensation
origin.
TempComp.SetOrigin
Syntax:
expression.SetOrigin (X, Y, Z)
expression: Required expression that evaluates to a PC-DMIS TempComp object.
X: Required Long that sets the X value of the temperature compensation origin.
Y: Required Long that sets the Y value of the temperature compensation origin.
Z: Required Long that sets the Z value of the temperature compensation origin.
302 Automation
Tip Members
Properties:
Tip.A
Returns the A angle of the tip. Read-only Double.
Tip.B
Returns the B angle of the tip. Read-only Double.
Tip.Date
Returns the PC-DMIS representation of the most recent calibration date of the tip.
Read-only String.
Tip.Diam
Returns the diameter of the tip. Read-only Double.
Tip.ID
Returns the ID string of the tip. Read-only String.
Tip.IJK
A PointData object that returns the vector along which the tip lies. Read-only.
Remarks
If there is a rotary table, the table rotation is taken into account.
Tip.MeasDiam
Returns the measured diameter of the tip. Read-only Double.
Tip.MeasThickness
Returns the measured thickness of the tip. Read-only Double.
Tip.MeasXYZ
Returns the measured location of the tip as a PointData. Read-only.
Tip.Parent
Returns the Tips collection object that contains this tip. Read-only.
Tip.Selected
Determines whether tip is selected for qualification. Read/Write Boolean
Automation 303
Remarks:
Use the "Probe.SelectAllTips" method of the probe object on page 286 to select all
tips at once and the "Probe.ClearAllTips" method of the probe object on page 285 to
clear all tips at once.
Tip.Thickness
Returns the nominal thickness of the tip. Read-only Double.
Tip.Time
Returns the PC-DMIS representation of the most recent calibration time of the tip.
Read-only String.
Tip.TipNum
Returns the tip number in the list of tips. Read-only Long.
Remarks
This is PC-DMISs internal representation of tip number. It may be different from
the number passed to Tips.Item to retrieve the tip.
Tip.Type
Returns the type of the tip. Read-only Long.
Remarks
The following tip types are defined. They can be combined via bitwise operations.
TIPBALL // Default
TIPDISK
TIPSHANK
TIPOPTIC
TIPANALOG
TIPANALOGBALL = TIPANALOG + BALL
TIPANALOGDISK = TIPANALOG + DISK
TIPANALOGSHANK = TIPANALOG + SHANK
TIPANALOGOPTIC = TIPANALOG + OPTIC
TIPFIXED
TIPFIXEDBALL = TIPFIXED + BALL
TIPFIXEDDISK = TIPFIXED + DISK
TIPFIXEDSHANK = TIPFIXED + SHANK
TIPFIXEDOPTIC = TIPFIXED + OPTIC
TIPSP600 // renishaw sp600 analog probe
TIPWBOPTIC // wolf and beck laser probe
TIPINFINITARM // renishaw infinite index arm
TIPSLAVE // tip belongs to slave arm
Tip.WristOffset
Returns the wrist offset of the tip. Read-only PointData.
Tip.WristTipIJK
Returns the wrist tip vector of the tip. Read-only PointData.
Tip.XYZ
Returns the location of the tip. Read-only PointData.
304 Automation
Tips Members
Properties:
Tips.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Tips.Count
Represents the number of Tip objects in the parent Probe object. Read-only Integer.
Tips.Parent
Returns the parent Probe object. Read-only.
Methods:
Tips.Add
Syntax
expression.Add a, b
expression: Required expression that evaluates to a PC-DMIS Tips object.
a: Required Double that is the A parameter of the new tip.
b: Required Double that is the B parameter of the new tip.
This function adds a new tip position to this collection. The new tip is unqualified.
Tips.Item
Syntax 1
Return Value=expression.Item(NameOrNum)
Syntax 2
expression(NameOrNum)
Return Value: The Item function returns a Tip object.
expression: Required expression that evaluates to a Tips object.
NameOrNum: Required Variant that indicates which Tip object to return. It can be
either a Long or a String. If it is a Long, it is the index number of the Tip object in
the Tips collection. If it is a String, it is the ID of the Tip object.
Remarks
Automation 305
Since the Item method is the default, the function name can be omitted as in Syntax
2.
Tips.Remove
Syntax
expression.RemoveNum
expression: Required expression that evaluates to a Tips object.
Num: Required Long that indicates which Tip object to remove.
This function removes the indicated Tip object from this collection.
Tool Members
Properties:
Tool.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Tool.Diam
Returns the diameter of the tool. Read-only Double.
Tool.ID
Returns the ID of the tool. Read-only String.
Tool.Parent
Returns the parent Tools object. Read-only.
Tool.ShankIJK
Returns the shank vector of the tool as a PointData. Read-only.
Tool.ToolType
Returns the type of the tool. Read-only Long.
Remarks
There is only one type of tool currently available, TOOLSPHERE.
Tool.Width
Returns the width of the tool. Read-only Double.
306 Automation
Tool.XYZ
Returns the location of the tool. Read-only PointData.
Tools Members
Properties:
Tools.Application
Represents the read-only PC-DMIS application. The Application object includes
properties and methods that return top-level objects. For example, the
ActivePartProgram property returns a PartProgram object.
Tools.Count
Represents the number of Tool objects in the parent PartProgram object. Read-only
Integer.
Tools.Parent
Returns the parent PartProgram object. Read-only.
Methods:
Tools.Add
Syntax
Return Value=expression.Add(ID)
Return Value: Returns a Tool object.
expression: Required expression that evaluates to a PC-DMIS Tips object.
ID: Required String that is the name of the new tool.
This function adds a new tool to this collection. The new tool is unqualified.
Tools.Item
Syntax 1
Return Value=expression.Item(NameOrNum)
Syntax 2
expression(NameOrNum)
Return Value: The Item function returns a Tool object.
expression: Required expression that evaluates to a Tools object.
Automation 307
NameOrNum: Required Variant that indicates which Tool object to return. It can be
either a Long or a String. If it is a Long, it is the index number of the Tool object in
the Tools collection. If it is a String, it is the ID of the Tool object.
Remarks
Since the Item method is the default, the function name can be omitted as in Syntax
2.
Tools.Remove
Syntax
Return Value=expression.Remove(ID)
Return Value: This method returns a boolean value. Boolean returns true if the
function succeeds, false if it fails.
expression: Required expression that evaluates to a Tools object.
ID: Required String that indicates which Tool object to remove.
This function removes the indicated Tool object from this collection.
Tracefield Members
Properties:
Tracefield.Name
STRING value representing the name of the tracefield.
Read/Write String
Tracefield.Value
STRING value representing the value for the tracefield.
Read/Write String
308 Automation
Introduction
These PC-DMIS OldBasic functions were made available in previous version of PCDMIS basic and are provided here, listed in alphabetical order, for backwards
compatibility.
Fuctions A
AddBoundaryPoint
AddBoundaryPoint x:=(Double), y:=(Double), z:=(Double)
This function is used to add the initial point, end point, and other boundary points in
the case of patch scans. It should be called for each boundary point to be added. It
should not be called more than num_bnd_pnts times (as specified in the call to
StartScan).
x,y,z: Coordinates of the boundary point.
AddFeature
AddFeature ID:=(String), off1:=(Double), off2:=(Double), off3:=(Double)
ID: ID string of the feature to add.
off1: X offset for an offset point. Single offset for this feature for an offset plane or
line.
off2: Y offset for an offset point.
off3: Z offset for an offset point.
Note: This function is used for constructed features only. The parameters off1, off2,
and off3 are only used in the case of offset points, planes or lines.
AddLevelFeat
AddLevelFeat ID:=(String)
AddOriginFeat
AddOriginFeat ID:=(String)
ID: Name of origin feature to be added
This function is used in conjunction with the iterate alignment command
AddRotateFeat
AddRotateFeat ID:=(String)
ID: Name of rotation feature to be added
This function is used in conjunction with the iterate alignment command
ArcSin
ArcSin x:=(Double)
Returns the arc sine of x in degrees.
ArcCos
ArcCos x:=(Double)
Return the arc cosine of x in degrees.
Functions B
BestFit2D
BestFit2D num_inputs:= (Integer), workplane:= (Integer)
num_inputs: The number of features to use to create the best fit alignment. There
must be a corresponding number of calls to Feature before the call to EndAlign.
workplane:The workplane of the 2D alignment. Must be PCD_TOP,
PCD_BOTTOM, PCD_FRONT, PCD_BACK, PCD_LEFT, or PCD_RIGHT.
BestFit3D
BestFit3D num_inputs:= (Integer)
num_inputs: The number of features to use to create the best fit alignment. There
must be a corresponding number of calls to Feature before the call to EndAlign.
Functions C
Calibrate
Calibrate sphere:=(String), tool:=(String)[, moved:=(Integer)]
sphere: Id of measured sphere used in calibration.
tool: Id of tool object used in calibration.
moved: Toggle indicating whether first hit should be taken manually or not. Can be
either PCD_NO or PCD_YES.
CatchMotionError
CatchMotionError tog:=(Integer), catch_error:=(Integer)
tog: PCD_CATCH_IN_INTEGER: All subsequent motion errors will cause the
integer passed by reference as the catch_error parameter to be set to a non-zero
value.
PCD_TRIGGER_ERROR: All subsequent motion errors will generate runtime error
1001. These error may be caught using the On Error statement.
PCD_OFF: Turns off error catching. The basic script will no longer be notified when
motion errors occur.
catch_error: A reference to the integer that will be set to a non-zero value if a CMM
error occurs. When error catching is turned on, this integer is automatically
initialized to zero. Only used when tog is set to PCD_CATCH_IN_INTEGER.
Check
Check distance:= (Double)
distance: The new check distance.
ClearPlane
ClearPlane plane1:= (Integer), val1:= (Double), plane2:= (Integer), val2:=
(Double)
plane1: Clearance plane. Must be one of the following values:
PCD_TOP, PCD_BOTTOM, PCD_LEFT, PCD_RIGHT, PCD_FRONT,
PCD_BACK
val1: The height of the workplane.
plane2: Pass through plane. Must be one of the values listed in the description of
plane1.
val2: The height of the pass through plane.
Column132
Column132 tog:=(Integer)
Turns on or off 132 column mode.
Comment
Comment ctype:=(Integer), comment:=(String)
ctype: PCD_REPORT, PCD_OPERATOR, or PCD_INPUT.
comment: The comment string.
CreatID
CreateID ID:=(String), ftype:=(Integer)
ID: Reference to a string to hold the newly created ID.
ftype: MEAS_POINT, MEAS_CIRCLE, MEAS_SPHERE, MEAS_LINE,
MEAS_CONE, MEAS_CYLINDER, MEAS_PLANE, MEAS_SET,
READ_POINT, CONST_ORIG_POINT, CONST_OFF_POINT,
CONST_PROJ_POINT, CONST_MID_POINT, CONST_DROP_POINT,
CONST_PIERCE_POINT, CONST_INT_POINT, CONST_CAST_POINT,
CONST_CORNER_POINT, CONST_BFRE_CIRCLE, CONST_BF_CIRCLE,
CONST_PROJ_CIRCLE, CONST_REV_CIRCLE, CONST_CONE_CIRCLE,
CONST_CAST_CIRCLE, CONST_INT_CIRCLE, CONST_BFRE_SPHERE,
CONST_BF_SPHERE, CONST_PROJ_SPHERE, CONST_REV_SPHERE,
CONST_CAST_SPHERE,CONST_BFRE_LINE, CONST_BF_LINE,
CONST_PROJ_LINE, CONST_REV_LINE, CONST_MID_LINE,
CONST_CAST_LINE, CONST_INT_LINE, CONST_OFF_LINE,
CONST_ALN_LINE, CONST_PRTO_LINE, CONST_PLTO_LINE,
CONST_BFRE_CONE, CONST_BF_CONE,CONST_PROJ_CONE,
CONST_REV_CONE,CONST_CAST_CONE,CONST_BFRE_CYLINDER,
CONST_BF_CYLINDER,
CONST_PROJ_CYLINDER,CONST_REV_CYLINDER,
CONST_CAST_CYLINDER, CONST_BFRE_PLANE, CONST_BF_PLANE,
CONST_REV_PLANE, CONST_MID_PLANE, CONST_CAST_PLANE,
CONST_OFF_PLANE, CONST_ALN_PLANE, CONST_PRTO_PLANE,
CONST_PLTO_PLANE,CONST_HIPNT_PLANE, CONST_SET,
AUTO_VECTOR_HIT, AUTO_SURFACE_HIT, AUTO_EDGE_HIT,
AUTO_ANGLE_HIT, AUTO_CORNER_HIT, AUTO_CIRCLE, AUTO_SPHERE,
AUTO_CYLINDER, AUTO_ROUND_SLOT, AUTO_SQUARE_SLOT,
AUTO_ELLIPSE, PCD_CURVE, DIM_LOCATION, DIM_STRAIGHTNESS,
DIM_ROUNDNESS, DIM_FLATNESS, DIM_PERPENDICULARITY,
DIM_PARALLELISM, DIM_PROFILE, DIM_3D_DISTANCE,
DIM_2D_DISTANCE, DIM_3D_ANGLE, DIM_2D_ANGLE, DIM_RUNOUT,
DIM_CONCENTRICITY, DIM_ANGULARITY, DIM_KEYIN,
DIM_TRUE_POSITION, PCD_ALIGNMENT
Functions D
DefaultAxes
DefaultAxes
This command is used only for location and true position dimensions. If present, the
default dimension axes are created. Calls to SetNoms with other axes passed as the
dtype parameter will have no effect if this command is used.
DefaultHits
DefaultHits
This command is used within a StartfeatureEndFeature block and is used to cause
the hits specified in the hits parameter of the StartFeature command to be
automatically generated.
DimFormat
DimFormat flags:=(Integer), heading1:=(Integer), heading2:=(Integer),
heading3:=(Integer), heading4:=(Integer), heading5:=(Integer),
heading6:=(Integer)
flags: PCD_HEADINGS, PCD_SYMBOLS. (Optional)
heading1: PCD_DEV, PCD_MAXMIN, PCD_MEAS, PCD_NOM,
PCD_OUTTOL, PCD_TOL. (Optional)
heading2: PCD_DEV, PCD_MAXMIN, PCD_MEAS, PCD_NOM,
PCD_OUTTOL, PCD_TOL. (Optional)
heading3: PCD_DEV, PCD_MAXMIN, PCD_MEAS, PCD_NOM,
PCD_OUTTOL, PCD_TOL. (Optional)
heading4: PCD_DEV, PCD_MAXMIN, PCD_MEAS, PCD_NOM,
PCD_OUTTOL, PCD_TOL. (Optional)
heading5: PCD_DEV, PCD_MAXMIN, PCD_MEAS, PCD_NOM,
PCD_OUTTOL, PCD_TOL. (Optional)
heading6: PCD_DEV, PCD_MAXMIN, PCD_MEAS, PCD_NOM,
PCD_OUTTOL, PCD_TOL. (Optional)
Functions E
EndAlign
EndAlign
This function must be called to end an alignment block.
EndDim
EndDim
EndDim takes no parameters, but must be called to finish off the dimension block.
EndFeature
EndFeature
This function ends a measured, constructed, or auto feature block. It must always be
present as the last function call in a feature block.
EndGetFeatPoint
EndGetFeatPoint
Use this command to release the memory allocated for use by the StartGetFeatPoint
and GetFeatPoint commands.
EndScan
EndScan
Call this when all of the other scan functions needed have been called.
The scan object is inserted in the command list with a call to this function.
EquateAlign
EquateAlign align1:=(String), align2:=(String)
Creates Equate alignment object
Align1: Name of alignment 1
Align2: Name of alignment 2
Functions F
Feature
Feature ID:=(String), pnt_tol:=(Double)
ID: ID string of the feature to add as an input for a best fit or iterative alignment.
pnt_tol: The point tolerance of the feature. Only used with best fit alignments.
This function must only be called after a call to BestFit2D, BestFit3D, or Iterate
Flatness
SHORT Flatness ID:=(String), out_zone:=(Double)
Return value: Non-zero if successfull. Zero if the object with the given ID string
cannot be found.
ID: The string ID of the object to query.
out_zone: A reference to a double to hold the output zone.
Note: This function was added for the tutor translator, and should be used with
caution.
Functions G
GapOnly
GapOnly tog:=(Integer)
tog: PCD_ON, PCD_OFF
GetDimData
GetDimData ID:= (String), buffer:= (DimData), dtype:= (Integer)
ID: The ID string of the dimension to access.
buffer: A record variable of type DimData in which to put the retrieved values. See
below for a description of the DimData structure.
dtype: The type of data to retrieve for location or true position dimensions. Not
needed for any other dimension type.
For location: PCD_X, PCD_Y, PCD_Z, PCD_D, PCD_R, PCD_A, PCD_T,
PCD_PA, PCD_PR, PCD_V, PCD_L
For true position: PCD_X, PCD_Y, PCD_Z, PCD_DD, PCD_DF, PCD_PA,
PCD_PR, PCD_TP
The definition of the DimData record type is as follows:
Type DimData
Nom As Double
Plus As Double
Minus As Double
Meas As Double
Max As Double
Min As Double
Dev As Double
Out As Double
Dev_Angle As Double
Bonus As Double
End Type
Note: The GetDimData function may not be called mid block.
GetDimOutTol
GetDimOutTol
Returns the number of features that are out of tolerance at the time that this
command is executed
GetFeatData
GetFeatData ID:= (String), buffer:= (FeatData), dtype:= (Integer),
xyz:=(Integer), ijk:= (Integer)
ID: The ID string of the feature to access.
buffer: A record variable of type FeatData in which to put the retrieved values. See
below for a description of the FeatData structure.
GetFeatID
Integer GetFeatID index:=(Integer), ID:=(String), type:=(Integer)
Index: The count backwards that should be used to find the next item with an id.
ID: This string is filled in with the id of the nth object back from the current point
when n is specified by index
Type: type of object to be considered. PCD_FEATURE, PCD_ALIGNMENT,
PCD_DIMENSION
GetFeatPoint
Integer GetFeatPoint buffer:= (PointData), index:= (Integer)
This function is called after a call to StartGetFeatPoint to retrieve the actual points.
Return value: The number of points available from the object.
buffer: A record variable of type PointData in which to put the retrieved point.
index: The 1 based index of the point to retrieve.
The definition of the PointData record type is as follows:
Type PointData
X As Double
Y As Double
Z As Double
End Type
GetFeature
Integer GetFeature ID:=(String)
Return value: The feature type of the object, or 0 if unsuccessful. Possible feature
types are the following: PCD_F_POINT, PCD_F_CIRCLE, PCD_F_SPHERE,
PCD_F_LINE, PCD_F_CONE, PCD_F_CYLINDER, PCD_F_PLANE,
PCD_F_CURVE, PCD_F_SLOT, PCD_F_SET, PCD_F_ELLIPSE,
PCD_F_SURFACE
ID: The string ID of the object to query.
Note: This function was added for the tutor translator, and should be used with
caution.
GetPH9Status
SHORT GetPH9Status
Return value: Returns 1 if the probe has a PH9 and 0 if no PH9 is available.
GetProbeOffsets
GetProbeOffsets buffer:= (PointData)
buffer: A record of type pointdata that receives the values of the current xyz offset
from the probe base.
GetProbeRadius
Double GetProbeRadius
Returns the current probe radius
GetProgramOption
Integer GetProgramOption opt:=(Integer)
GetProgramValue
Double GetProgramValue opt:=(Integer)
Return value: returns the current value of the given option
Opt: The options value that is being retrieved. PCD_ROTTABLEANGLE,
PCD_PROBERADIUS, PCD_DIMPLACES, PCD_FLYRADIUS,
PCD_AUTOTRIGDISTANCE, PCD_TABLETOL, PCD_MANRETRACT,
PCD_MEASSCALE, PCD_PH9WARNDELTA, PCD_VALISYSERRTIMEOUT
GetTopMachineSpeed
DOUBLE GetTopMachineSpeed
Return value: Returns the top machine speed of the CMM.
GetType
SHORT GetType ID:=(String)
Return value: The type of the object, or 0 if unsuccessful. Possible types are any of
the types passed to StartFeature or StartDim.
ID: The string ID of the object to query.
Note: This function was added for the tutor translator, and should be used with
caution.
GetUnits
SHORT GetUnits
Return value: The units of the current part program. A value of 1 is returned when
units are in inches and 0 when units are in millimeters.
Functions H
Hit
Hit x:=(Double), y:=(Double), z:=(Double), i:=(Double), j:=(Double),
k:=(Double)
x,y,z, i,j,k: Theoretical x,y,z and approach vector of hit.
Note: This function is used for measured features only. It may be omitted on
measured circles, cones, cylinders, spheres and points as these features generate
default hits. However, if circular moves are required between each hit, the hit
function should be provided as a place holder. The parameters may be eliminated, in
which case the default hit x, y, z and i, j, k are used.
Functions I
IgnoreMotionError
IgnoreMotionError tog:=(Integer)
tog: TRUE or FALSE. TRUE indicates that we wish to begin ignoring CMM
motion errors. FALSE means we wish to stop ignoring CMM motion errors.
Iterate
Iterate num_inputs:= (Integer), pnt_tol:= (Double), flags:= (Integer)
num_inputs: The number of features to use to create the iterative alignment. Must be
no more than six. There must be a corresponding number of calls to Feature before
the call to EndAlign.
pnt_tol: The point tolerance.
flags: Any Ored combination of the following: PCD_BODY_AX,
PCD_AV_ERROR, PCD_MEAS_ALL, PCD MEAS ALL ALWAYS.
Functions L
Level
Level axis:= (Integer), feat:= (String)
axis: Axis to level. PCD_ZPLUS, PCD_ZMINUS, PCD_XPLUS, PCD_XMINUS,
PCD_YPLUS, PCD_YMINUS
feat: ID string of the feature to level to.
LoadProbe
LoadProbe probe:= (String)
probe: The probe to load.
Functions M
MaxMineAve
SHORT MaxMinAve ID:=(String), in_vector:=(PointData),
out_max:=(Double), out_min:=(Double), out_ave:=(Double)
Return value: Non-zero if successfull. Zero if the object with the given ID string
cannot be found.
ID: The string ID of the object to query.
in_vector: Input vector.
out_max: A reference to a double to hold the output maximum.
out_min: A reference to a double to hold the output minimum.
out_ave: A reference to a double to hold the output average.
Note: This function was added for the tutor translator, and should be used with
caution.
Mode
Mode mode:= (Integer)
mode: PCD_DCC, PCD_MANUAL
Move
Move tog:= (Integer), x:= (Double), y:= (Double), z:= (Double),
direction:=(Integer)
tog: PCD_CLEARPLANE, PCD_INCREMENT, PCD_CIRCULAR, PCD_POINT,
PCD_ROTAB
x,y,z: Point or increment x,y,z if tog is PCD_INCREMENT or PCD_POINT.
x is angle if tog is PCD_ROTAB.
direction: PCD_CLOCKWISE, PCD_COUNTERCLOCKWISE,
PCD_SHORTEST. Used only for PCD_ROTAB.
MoveSpeed
Movespeed percent:= (Double)
percent: Move speed of the probe as a percentage of the maximum probe speed.
Functions O
OpenCommConnection
Integer OpenCommConnection port:=(Integer), baud:=(Integer),
parity:=(Integer), data:=(Integer), stop:=(Integer), flow:=(Integer)
Opens a connection to the specified comm port.
RETURN VALUE: 0 if successfull, -1 on error.
port: The comm port to open. Required.
baud: The baud rate at which to communicate with the port. Must be one of the
following values: PCD_BAUD_110, PCD_BAUD_300, PCD_BAUD_600,
PCD_BAUD_1200, PCD_BAUD_2400, PCD_BAUD_4800, PCD_BAUD_9600,
Functions P
Prehit
Prehit distance:= (Double)
distance: New prehit distance.
ProbeComp
ProbeComp tog:= (Integer)
tog: PCD_ON, PCD_OFF. Turns probe compensation on or off.
PutFeatData
PutFeatData ID:= (String), buffer:= (FeatData), dtype:= (Integer),
xyz:= (Integer), ijk:= (Integer)
Parameters, allowed values, and limitations are identical to those of GetFeatData.
The data currently in buffer is stored in the feature identified by the ID string.
Functions R
ReadCommBlock
Integer ReadCommBlock port:=(Integer), buffer:=(String), count:=(Integer)
Reads characters from the comm port specified.
RETURN VALUE: 0 if successfull, -1 on error.
port: The comm port from which to read. Required.
buffer: The string in which to put the read characters. Required.
count: The maximum number of characters to read from the port. Required.
RecallIn
RecallIn recallID:= (String)
recallIn: String ID of internal alignment to recall.
Note: This function does not need to be called within an alignment block.
RecallEx
RecallEx recallID:= (String)
recallID: String ID of external alignment to recall.
Note: This function does not need to be called within an alignment block.
Retract
Retract distance:= (Double)
distance: New retract distance.
RetroOnly
RetroOnly tog:=(Integer)
tog: PCD_ON, PCD_OFF
Rotate
Rotate axis1:= (Integer), feat:= (String), axis2:= (Integer)
axis1: Axis to rotate. PCD_ZPLUS, PCD_ZMINUS, PCD_XPLUS, PCD_XMINUS,
PCD_YPLUS, PCD_YMINUS
feat: ID string of the feature to rotate to.
axis2: Axis to rotate about. PCD_ZPLUS, PCD_ZMINUS, PCD_XPLUS,
PCD_XMINUS, PCD_YPLUS, PCD_YMINUS
RotateCircle
RotateCircle feat1:= (String), feat2:= (String), axis1:= (Integer), axis2:=
(Integer)
feat1: ID string of circle.
feat2: ID string of second circle.
axis1: Axis to rotate. PCD_ZPLUS, PCD_ZMINUS, PCD_XPLUS, PCD_XMINUS,
PCD_YPLUS, PCD_YMINUS
axis2: Axis to rotate about. PCD_ZPLUS, PCD_ZMINUS, PCD_XPLUS,
PCD_XMINUS, PCD_YPLUS, PCD_YMINUS
RotateOffset
RotateOffset offset:= (Double), axis:= (Integer)
offset: Offset value.
axis: Axis to rotate about. PCD_ZPLUS, PCD_ZMINUS, PCD_XPLUS,
PCD_XMINUS, PCD_YPLUS, PCD_YMINUS
Roundness
SHORT Roundness ID:=(String), out_zone:=(Double)
Return value: Non-zero if successfull. Zero if the object with the given ID string
cannot be found.
ID: The string ID of the object to query.
out_zone: A reference to a double to hold the output zone.
Note: This function was added for the tutor translator, and should be used with
caution.
Runout
SHORT Runout ID:=(String), in_datumxyz:=(PointData),
in_datumijk:=(PointData), out_zone:=(Double)
Return value: Non-zero if successfull. Zero if the object with the given ID string
cannot be found.
ID: The string ID of the object to query.
in_datumxyz: Input xyz.
in_datumijk: input ijk.
out_zone: A reference to a double to hold the output zone.
Note: This function was added for the tutor translator, and should be used with
caution.
Functions S
SaveAlign
SaveAlign alignID:=(String), fname:=(String)
alignID: ID string of the alignment to save.
fname: File in which to save the alignment.
SetAutoParams
SetAutoParams init_hits:=(Integer), perm_hits:=(Integer), depth:=(Double),
height:=(Double), wdth:=(Double), radius:=(Double), spacer:=(Double),
indent:=(Double), thickness:=(Double), major:=(Double), minor:=(Double)
SetAutoVector
SetAutoVector index:=(Integer), i:=(Double), j:=(Double), k:=(Double)
index: Which vector to set. Can be any of the following: PCD_VECTOR1,
PCD_VECTOR2, PCD_VECTOR3, PCD_PUNCH_VECTOR,
PCD_PIN_VECTOR, PCD_ANGLE_VECTOR, PCD_REPORT_VECTOR,
PCD_EDGE_REPORT_VECTOR, PCD_SURF_REPORT_VECTOR,
PCD_MEASURE_VECTOR, PCD_UPDATE_VECTOR, PCD_VECTOR1 is
normally not needed as the first ijk values are set with a call to SetTheos.
i,j,k: The parameters of the vector.
Note: This function is used for auto features only.
SetNoms
SetNoms nom:=(Double), plus_tol:=(Double), minus_tol:=(Double),
dtype:=(Integer), multiplier:=(Double)
nom: Double value indicating nominal. May be omitted when no nominal is needed.
plus_tol: Double value indicating plus tolerance.
minus_tol: Double value indicating minus tolerance. May be omitted when no minus
tolerance is needed.
dtype: For Location only: PCD_X, PCD_Y, PCD_Z, PCD_D, PCD_R, PCD_A,
PCD_T, PCD_PA, PCD_PR, PCD_V, PCD_L, PCD_PX, PCD_PY, PCD_PZ,
PCD_PD, PCD_PT
For True Position only: PCD_X, PCD_Y, PCD_Z, PCD_DD, PCD_DF, PCD_PA,
PCD_PR, PCD_TP
IMPORTANT: This parameter should be omitted for all other dimension types.
SetPrintOptions
SetPrintOptions location:=(Integer), draft:=(Integer), filemode:=(Integer),
nextnum:=(Integer)
Location: location of output. Can be PCD_OFF, PCD_PRINTER, or PCD_FILE
Draft: mode of output to printer. PCD_ON or PCD_OFF
Filemode: naming mode for output file. PCD_APPEND, PCD_NEWFILE,
PCD_OVERWRITE, PCD_AUTO
NextNum: used with PCD_AUTO mode naming scheme for output file
SetProgramOption
SetProgramOption opt:=(Integer), tog:=(Integer)
Opt: Program option to set: PCD_AUTOTIPSELECT, PCD_AUTOPREHIT,
PCD_AUTOPROJREFPLANE, PCD_DISPSPEEDS, PCD_ENDKEY,
PCD_EXTSHEETMETAL, PCD_FLYMODE, PCD_TABLEAVOIDANCE,
PCD_USEDIMCOLORS
Tog: Specifies whether option should be turned on or off. PCD_ON or PCD_OFF
SetProgramValue
SetProgramValue opt:=(Integer), val:=(Double)
Opt: Program value to set: PCD_PROBERADIUS, PCD_DIMPLACES,
PCD_FLYRADIUS, PCD_AUTOTRIGDISTANCE, PCD_TABLETOL,
PCD_MANRETRACT, PCD_MEASSCALE, PCD_PH9WARNDELTA,
PCD_VALISYSERRTIMEOUT
Val: New value for program value being set.
SetReportOptions
SetReportOptions opt:=(Integer)
Opt: Any of the combined flags can be used to turn on or off the reporting object
types: PCD_FEATURES, PCD_ALIGNMENTS, PCD_MOVES,
PCD_COMMENTS, PCD_DIMENSIONS, PCD_HITS, PCD_OUTTOL_ONLY
SetRmeasMode
SetRmeasMode mode:=(Integer)
Mode: The mode to be used for auto features using the RMEAS functionality.
PCD_RELATIVE or PCD_ABSOLUTE
SetSlaveMode
SetSlaveMode tog:=(Integer)
Tog: Turns slave mode off or on for all subsequent created commands. PCD_ON or
PCD_OFF
SetScanHitParams
SetScanHitParams htype:=(Integer), init_hits:=(Integer), perm_hits:=(Integer),
spacer:=(Double), depth:=(Double), indent:=(Double), flags:=(Integer)
Note: This function is only used for DCC scans and should not be called for manual
scans.
htype: Type of hits to use. PCD_VECTORHIT, PCD_SURFACEHIT,
PCD_EDGEHIT, PCD_ANGLEHIT.
init_hits: Number of init sample hits to use. Optional.
perm_hits: Number of permanent hits. Optional.
spacer: Spacer value. Optional.
depth: Depth value. Optional.
indent: Indent value. Optional.
flags: For now, just PCD_EXTERIOR or PCD_INTERIOR. Default is
PCD_EXTERIOR. Optional.
SetScanHitVectors
SetScanHitVectors vector:=(Integer), i:=(Double), j:=(Double), k:=(Double)
Note: This function is only used for DCC scans.
vector: Hit vector to set. PCD_TOP_SURFACE, PCD_SIDE_SURFACE,
PCD_BOUNDARY_PLANE.
i,j,k: Values to set.
SetScanParams
SetScanParams incr:=(Double), axis:=(Integer), max_incr:=(Double),
min_incr:=(Double), max_angle:=(Double), in_angle:=(Double),
delta:=(Double), distance:=(Double), incr2:=(Double), axis2:=(Integer),
surf_thickness:=(Double)
incr: Increment value for LINE, BODY, and CUTAXIS scan techniques. Optional.
axis: Axis for BODY and CUTAXIS scan techniques. PCD_XAXIS, PCD_YAXIS,
PCD_ZAXIS. Optional.
max_incr, min_incr, max_angle, min_angle: For VARIABLE scan techniques.
Optional.
delta: Distance delta for FIXED_DELTA scans, time delta for VARIABLE_DELTA
and TIME_DELTA scans. Optional.
SetScanVectors
SetScanVectors vector:=(Integer), i:=(Double), j:=(Double), k:=(Double)
vector: Vector to set. PCD_CUTVECTOR, PCD_INITTOUCH, PCD_INITDIR,
PCD_ROWEND_APPROACH.
i,j,k: Values to set.
SetTheos
SetTheos x:=(Double), y:=(Double), z:=(Double), i:=(Double), j:=(Double),
k:=(Double), diam:=(Double), length:=(Double), angle:=(Double),
small_diam:=(Double), start_angle:=(Double), end_angle:=(Double),
start_angle2:=(Double), end_angle2:=(Double)
Note: A call to SetTheos is mandatory for all measured features.
x,y,z, i,j,k: On a bound line, (i,j,k) is the ending point.
diam: Diameter of a circle, cylinder, or sphere. Big diameter of a cone.
length: Length of a cylinder.
angle: Angle of a cone.
small_diam: Small diameter of a cone.
start_angle, end_angle: Starting and ending angles for circles, cylinders, and
spheres.
start_angle2, end_angle2: Second starting and ending angles for spheres.
ShowXYZWindow
ShowXYZWindow show:=(Integer)
Show: Show or hides the probe position window. PCD_ON or PCD_OFF
Sleep
Sleep seconds:=(Single)
Pauses execution for the specified number of seconds after the previous feature has
finished executing.
Note: Sleep calls the Wait function to ensure that the sleeping does not begin before
all previous features have been executed.
StartAlign
StartAlign ID:= (String), recallID:= (String)
ID: ID string of the alignment to create.
recallID: ID string of the alignment to recall.
StartDim
StartDim dtype:=(Integer), ID:=(String), feat1:=(String), feat2:=(String),
feat3:=(String), axis:=(Integer), length:=(Double), angle:=(Double),
flags:=(Integer)
dtype: DIM_LOCATION, DIM_STRAIGHTNESS, DIM_ROUNDNESS,
DIM_FLATNESS, DIM_PERPENDICULARITY, DIM_PARALLELISM,
DIM_PROFILE, DIM_3D_DISTANCE, DIM_2D_DISTANCE, DIM_3D_ANGLE,
DIM_2D_ANGLE, DIM_RUNOUT, DIM_CONCENTRICITY,
DIM_ANGULARITY, DIM_KEYIN, DIM_TRUE_POSITION
ID: ID string of the dimension to create
feat1: ID string of the Of Feature or From Feature
feat2: ID string of the To Feature
feat3: ID string of the third feature, if any
axis: PCD_XAXIS, PCD_YAXIS, PCD_ZAXIS. Only needed for dimensions using
an axis or workplane.
length: Extended length for angularity, profile, perpendicularity, or parallelism.
angle: Angle for angularity.
flags: PCD_ADD_RADIUS, PCD_SUB_RADIUS, PCD_NO_RADIUS,
PCD_PAR_TO, PCD_PERP_TO. Some of these values may be Ored together.
Example: PCD_ADD_RADIUS Or PCD_PAR_TO) True Position dimensions can
take one of the following flags as well:
PCD_RFS_RFS, PCD_RFS_MMC, PCD_RFS_LMC, PCD_MMC_RFS,
PCD_MMC_MMC, PCD_MMC_LMC, PCD_LMC_RFS, PCD_LMC_MMC,
PCD_LMC_LMC.
The datum computation type comes first. For example, PCD_RFS_LMC specifies
RFS for the datum and LMC for the feature.
StartFeature
StartFeature ftype:=(Integer), ID:=(string), hits:=(Integer), inputs:=(Integer),
flags:=(Long)
ftype: MEAS_POINT, MEAS_CIRCLE, MEAS_SPHERE, MEAS_LINE,
MEAS_CONE, MEAS_CYLINDER, MEAS_PLANE, MEAS_SET,
READ_POINT,CONST_ORIG_POINT, CONST_OFF_POINT,
CONST_PROJ_POINT, CONST_MID_POINT, CONST_DROP_POINT,
CONST_PIERCE_POINT, CONST_INT_POINT, CONST_CAST_POINT,
workplane axis: A workplane/axis flag is only used with alignment lines and planes.
Possible flag values are the following: PCD_FRONT, PCD_BACK, PCD_LEFT,
PCD_RIGHT, PCD_TOP, PCD_BOTTOM, PCD_ZPLUS, PCD_ZMINUS,
PCD_XPLUS, PCD_XMINUS, PCD_YPLUS, PCD_YMINUS, PCD_ZAXIS,
PCD_XAXIS, PCD_YAXIS.
PCD_MEASURE_SURFACE: Sets measure order. For auto edge points only.
Default.
PCD_MEASURE_EDGE: Sets measure order. For auto edge points only.
PCD_MEASURE_BOTH: Sets measure order. For auto edge points only.
PCD_HEM: For auto edge points only. Should not be ored with PCD_TRIM.
PCD_TRIM: For auto edge points only. Should not be ored with PCD_HEM.
Default.
PCD_PIN: For auto circles, cylinders, ellipses, and slots. Do not or with
PCD_NORM.
PCD_NORM: For auto circles, cylinders, ellipses, and slots. Do not or with
PCD_PIN. Default.
PCD_READPOS: Turn read position on. For auto circles, cylinders, ellipses, and
slots. Defaults to off.
PCD_AUTOMOVE: Causes move points to be automatically generated for auto
features.
PCD_FINDHOLE: For Auto Circles. Automatic finding of holes.
PCD_MEASURE_WIDTH: Flag for Auto Square Slots
StartGetFeatPoint
Integer StartGetFeatPoint ID:= (String), dtype:= (Integer), xyz:= (Integer)
This function is used to retrieve the hit or input data from constructed, measured, and
auto features, as well as the hit data for scans. To retrieve the actual points,
subsequent calls to GetFeatPoint must be made. When all of the needed point values
have been retrieved, a call to EndGetFeatPoint must be made to free the memory
allocated for the points.
Return value: The number of points retrieved from the object.
ID: The ID string of the feature to access.
dtype: The type of data to retrieve. Must be either PCD_MEAS or PCD_THEO.
xyz: Type of data to put in xyz. Allowed values are: PCD_BALLCENTER,
PCD_CENTROID, PCD_VECTOR
Note: The StartGetFeatPoint function may not be called mid block.
StartScan
StartScan ID:=(String), mode:=(Integer), stype:=(Integer), dir1:=(Integer),
dir2:=(Integer), technique:=(Integer), num_bnd_pnts:=(Integer),
flags:=(Integer)
ID: ID string of the scan.
Straitness
SHORT Straitness ID:=(String), Put_zone:=(Double)
Return value: Non-zero if successfull. Zero if the object with the given ID string
cannot be found.
ID: The string ID of the object to query.
out_zone: A reference to a double to hold the output zone.
Note: This function was added for the tutor translator, and should be used with
caution.
Stats
Stats tog:=(Integer), dbase_dir:=(String), read_lock:=(Integer),
write_lock:=(Integer), mem_page:=(Integer), flags:=(Integer)
tog: Indicates whether stats is on or off. PCD_ON or PCD_OFF.
dbase_dir: Database directory. Optional.
read_lock: Optional.
write_lock: Optional.
mem_page: Optional.
flags: PCD_USE_FEAT_NAME, PCD_USE_DIM_NAME,
PCD_DO_CONTROL_CALCS. Optional.
Functions T
Tip
Tip tip:= (String)
tip: The tip to load.
Touchspeed
Touchspeed percent:= (Double)
percent: Touchspeed of the probe as a percentage of the maximum probe speed.
Trace
Trace field:=(String)
field: Name of the field to trace.
Translate
Translate axis:= (Integer), feat:= (String)
axis: Axis to translate. PCD_ZAXIS, PCD_XAXIS, PCD_YAXIS
feat: ID string of feature to translate to.
TranslateOffset
TranslateOffset offset:= (Double), axis:= (Integer)
offset: Value of offset.
axis: PCD_ZAXIS, PCD_XAXIS, PCD_YAXIS
Functions W
Wait
Wait
Waits until all preceding commands have been executed. The basic script creates
commands and places them on the execute list more rapidly than the commands are
executed. In a script it is often useful to pop up a dialog box for input after a certain
series of commands has been executed. The script commands may complete long
before the actual commands have been executed. The Wait command is useful to
prevent the dialog box from popping up prematurely.
Workplane
Integer Workplane plane:= (Integer)
Return value: The previous workplane.
plane: PCD_TOP, PCD_BOTTOM, PCD_FRONT, PCD_BACK, PCD_LEFT,
PCD_RIGHT.
Optional. If not provided, the current workplane is returned but no new workplane is
set.
WriteCommBlock
Integer WriteCommBlock port:=(Integer), buffer:=(String), count:=(Integer)
Glossary of Terms
Index
A
Abs Function 57
Accessing an object 45
CreateObject Function 45
GetObject Function 45
Activate 46
Active Tip Members 171
ActiveTip.Angle 171
ActiveTip.GetShankVector 171
ActiveTip.SetShankVector 172
ActiveTip.TipID 171
Active Tip Object Overview 171
AddBoundaryPoint 309
AddFeature 309, 329
AddLevelFeat 309
AddOriginFeat 310
AddRotateFeat 310
AlignCommand Members Error! Not a valid
bookmark in entry on page 172
AlignCommand.AboutAxis 172
AlignCommand.AddBestFitFeat 176
AlignCommand.AddLevelFeat 176
AlignCommand.AddOriginFeat 177
AlignCommand.AddRotateFeat 177
AlignCommand.Angle 172
AlignCommand.AverageError 173
AlignCommand.Axis 173
AlignCommand.BFOffset 173
AlignCommand.CadToPartMatrix 173
AlignCommand.ExternalID 173
AlignCommand.FeatID 173
AlignCommand.FeatID2 174
AlignCommand.FindCad 174
AlignCommand.ID 174
AlignCommand.InitID 174
AlignCommand.MachineToPartMatrix 174
AlignCommand.MeasAllFeat 174
AlignCommand.NumInputs 175
AlignCommand.Offset 175
AlignCommand.Parent 175
AlignCommand.PointTolerance 175
AlignCommand.RepierceCad 175
AlignCommand.UseBodyAxis 175
AlignCommand.Workplane 176
AlignCommand Object Overview 172
AppActivate Statement 58
Application 46
Application Members
Application.ActivePartProgram 177
Application.Caption 178
Application.DefaultFilePath 178
Application.DefaultProbeFile 178
Application.FullName 178
Application.Height 178
Application.Help 179
Application.Left 178
Application.Machines 178
Application.Maximize 180
Application.Minimize 180
Application.Name 178
Application.OperatorMode 178
Application.PartPrograms 179
Application.Path 179
Application.Post 180
Application.Quit 180
Application.Restore 180
Application.SetActive 181
Application.StatusBar 179
Application.Top 179
Application.UserExit 179
Application.Visible 179
Application.Width 179
Application Object Overview 177
ArcCos 310
ArcSin 310
Array Index Members 181
ArrayIndex.AddIndexSet 181
ArrayIndex.GetLowerBound 181
ArrayIndex.GetUpperBound 182
ArrayIndex.RemoveIndexSet 182
ArrayIndex.SetLowerBound 182
ArrayIndex.SetUpperBound 182
Array Index Object Overview 181
Arrays 29
Asc Function 58
Atn Function 59
Attach Members 183
Attach.AttachedAlign 183
Attach.Execute 183
Attach.ID 183
Attach.LocalAlign 183
Attach.PartName 183
Attach Object Overview 183
Automation Object
ScanCommand Object 287
Index 337
B
Basic Help 14
Basic Scan Object Combinations 198
Basic Script Editor 1114
Basic Script Toolbar 11
BasicScanCommand Members 184
BasicScan.AutoClearPlane 184
BasicScan.BoundaryCondition 184
338 Index
BasicScan.BoundaryConditionAxisV 184
BasicScan.BoundaryConditionCenter 184
BasicScan.BoundaryConditionEndApproach 185
BasicScan.BoundaryConditionPlaneV 185
BasicScan.BoundaryPointCount 185
BasicScan.DisplayHits 185
BasicScan.Filter 185
BasicScan.GetBoundaryConditionParams 189
BasicScan.GetBoundaryPoint 189
BasicScan.GetFilterParams 190
BasicScan.GetHitParams 190
BasicScan.GetMethodParams 191
BasicScan.GetMethodPointData 192
BasicScan.GetNomsParams 192
BasicScan.GetParams 193
BasicScan.HitType 186
BasicScan.Method 187
BasicScan.MethodCutPlane 187
BasicScan.MethodEnd 187
BasicScan.MethodEndTouch 187
BasicScan.MethodInitDir 187
BasicScan.MethodInitTopSurf 187
BasicScan.MethodInitTouch 187
BasicScan.MethodStart 188
BasicScan.NominalMode 188
BasicScan.OperationMode 188
BasicScan.SetBoundaryConditionParams 193
BasicScan.SetBoundaryPoint 194
BasicScan.SetFilterParams 194
BasicScan.SetHitParams 195
BasicScan.SetMethodParams 195
BasicScan.SetMethodPointData 196
BasicScan.SetNomsParams 197
BasicScan.SetParams 197
BasicScan.SinglePoint 189
BasicScanCommand Object Overview 183
Beep Statement 60
Best Fit Alignment 174
BestFit2D 310, 314
BestFit3D 310, 314
C
CadWindow Members 200
CadWindow.Application 200
CadWindow.Height 200
CadWindow.Left 200
CadWindow.Parent 201
CadWindow.Print 201
CadWindow.Top 201
CadWindow.Visible 201
CadWindow.Width 201
CadWindow Object Overview 200
CadWindows Members 202
CadWindows.Application 202
CadWindows.Count 202
CadWindows.Item 202
CadWindows.Parent 202
CadWindows Object Overview 201
Calibrate 311
Calibration Members 202
Calibration.Moved 202
Calibration.SphereID 203
Calibration.ToolID 203
Calibration Object Overview 202
Call Statement 60
Calling Procedures in DLLs 27
CatchMotionError 311
CBool Function 61
CDate Function 62
CDbl Function 62
ChDir 51, 54, 63
ChDrive 51
ChDrive Statement 64
Check 13, 23, 28, 35, 3739, 43, 6061, 65, 77, 79, 88,
140, 311
Check Boxes 35
CheckBox 64
Choose Function 65
Chr, Function 65
Cint Function 66
Class 47
ClearPlane 311, 320
CLng Function 67
Close Statement 67
Column132 311
Command List 249
Command Members 203
Command.ActiveTipCommand 203
Command.AlignmentCommand 203
Command.Application 204
Command.ArrayIndex 204
Command.AttachCommand 204
Command.BasicScanCommand 204
Command.CalibrationCommand 204
Command.Count 204
Command.Dialog 213
Command.Dialog2 213
Command.DimensionCommand 204
Command.DimFormat 205
Command.DimInfoCommand 205
Command.DisplayMetaFileCommand 205
Command.Execute 213
Command.ExternalCommand 205
Command.Feature 205
Command.FeatureCommand 206
Command.FileIOCommand 207
Command.FlowControlCommand 207
Command.GetExpression 214
Command.ID 208
Command.IsActiveTip 208
Command.IsAlignment 208
Command.IsArrayIndex 208
Command.IsAttach 208
Command.IsBasicScan 208
Command.IsCalibration 208
Command.IsComment 209
Command.IsConstructedFeature 209
Command.IsDCCFeature 209
Command.IsDimension 209
Command.IsDimFormat 209
Command.IsDimInfo 209
Command.IsDisplayMetaFile 209
Command.IsExternalCommand 209
Command.IsFeature 210
Command.IsFileIOCommand 210
Command.IsFlowControl 210
Command.IsHit 210
Command.IsLeitzMotion 210
Command.IsLoadMachine 210
Command.IsLoadProbe 210
Command.IsMeasuredFeature 211
Command.IsModal 210
Command.IsMove 211
Command.IsOptMotion 211
Command.IsScan 211
Command.IsStatistic 211
Command.IsTempComp 211
Command.IsTraceField 211
Command.Item 214
Command.LeitzMotion 211
Command.LoadMachineCommand 212
Command.LoadProbeCommand 212
Command.Mark 214
Command.ModalCommand 212
Command.MoveCommand 212
Command.Next 215
Command.OptMotion 212
Command.Parent 212
Command.Prev 215
Command.Remove 215
Command.ScanCommand 212
Command.ShowIDOnCad 213
Command.SlaveArm 213
Command.StatisticCommand 213
Command.TempCompCommand 213
Command.TraceFieldCommand 213
Command.Type 213
Command Object Overview 203
Commands Members 216
Commands.Add 213, 216
Commands.Application 216
Commands.ClearMarked 216
Commands.Count 216
Commands.InsertionPointAfter 216
Commands.Item 217
Commands.MarkAll 217
Commands.Parent 216
Index 339
D
Data Types 53
Date Function 74
DateSerial 75
DateValue 76
Day Function 76
Declare Statement 77
DefaultAxes 312, 325
DefaultHits 313
Delete 12
Dialog Dialog Function 78
Dialog Support 33
Dim Statement 80
DimData Members 220
DimData.Bonus 220
DimData.Dev 220
DimData.DevAngle 220
DimData.Max 220
DimData.Meas 220
DimData.Min 220
DimData.Minus 220
DimData.Nom 220
DimData.Out 220
DimData.Plus 220
DimData Object Overview 219
340 Index
DlgControlId Function 41
DlgEnable Statement 82
DlgFocus Statement, DlgFocus() Function 42
DlgListBoxArray, DlgListBoxArray() 42
DlgSetPicture 42
DlgText Statement 84
DlgValue, DlgValue() 43
DlgVisible Statement 84
Dmis Matrix Object Overview 231
DmisDialog Members 231
DmisDialog.Visible 231
DmisDialog Object Overview 231
DmisMatrix Members 232
DmisMatrix.Copy 232
DmisMatrix.Inverse 232
DmisMatrix.IsIdentity 232
DmisMatrix.Item 232
DmisMatrix.Multiply 233
DmisMatrix.Normalize 233
DmisMatrix.OffsetAxis 232
DmisMatrix.Reset 233
DmisMatrix.RotateByAngle 233
DmisMatrix.RotateToPoint 233
DmisMatrix.RotateToVector 234
DmisMatrix.SetMatrix 234
DmisMatrix.TransformDataBack 234
DmisMatrix.TransformDataForward 235
DmisMatrix.XAxis 232
DmisMatrix.YAxis 232
DmisMatrix.ZAxis 232
Do...Loop Statement 85
E
Edit Menu 12
EditWindow Members
EditWindow.Application 235
EditWindow.CommandMode 237
EditWindow.Height 235
EditWindow.Left 236
EditWindow.Parent 236
EditWindow.Print 237
EditWindow.ReportMode 237
EditWindow.SetPrintOptions 237
EditWindow.ShowAlignments 236
EditWindow.ShowComments 236
EditWindow.ShowDimensions 236
EditWindow.ShowFeatures 236
EditWindow.ShowHeaderFooter 236
EditWindow.ShowHits 236
EditWindow.ShowMoves 236
EditWindow.ShowOutTolOnly 236
EditWindow.ShowTips 236
EditWindow.StatusBar 237
EditWindow.Top 237
EditWindow.Visible 237
EditWindow.Width 237
EditWindow Object Overview 235
Enable Scripting Language 19
End Statement 86
EndAlign 310, 313, 319
EndDim 313
EndFeature 313, 329
EndGetFeatPoint 313, 330
EndScan 314
Eof 86
EquateAlign 314
Erase 87
Execute Error! Not a valid bookmark in entry on
page 188, 198, 270
Exit 12
Exit Statement 88
Exp 52, 88, 89
Export 180, Error! Not a valid bookmark in entry on
page 278
ExternalCommand Members 238
ExtCommand.Command 238
ExternalCommand Object Overview 238
F
FeatCommand Members 238
FeatCommand.AddInputFeat 249
FeatCommand.AlignWorkPlane 238
FeatCommand.AutoCircularMove 239
FeatCommand.AutoClearPlane 239
FeatCommand.AutoMove 239
FeatCommand.AutoMoveDistance 239
FeatCommand.AutoPH9 239
FeatCommand.AutoReadPos 239
FeatCommand.BestFitMathType 239
FeatCommand.BoxLength 240
FeatCommand.BoxWidth 240
FeatCommand.CirclularRadiusIn 240
FeatCommand.CirclularRadiusOut 240
FeatCommand.CornerRadius 240
FeatCommand.DCCFindNomsMode 241
FeatCommand.DCCMeasureInMasterMode 241
FeatCommand.Depth 241
FeatCommand.Deviation 241
FeatCommand.DisplayConeAngle 241
FeatCommand.EdgeMeasureOrder 241
FeatCommand.EdgeThickness 241
FeatCommand.EndAngle 242
FeatCommand.EndAngle2 242
FeatCommand.FilterType 242
FeatCommand.GenerateHits 249
FeatCommand.GenericAlignMode 242
FeatCommand.GenericDisplayMode 242
FeatCommand.GenericType 242
FeatCommand.GetData 249
FeatCommand.GetHit 251
Index 341
FeatCommand.GetInputFeat 250
FeatCommand.GetInputOffset 250
FeatCommand.GetPoint 251
FeatCommand.GetSurfaceVectors 252
FeatCommand.GetVector 252
FeatCommand.HighPointSearchMode 243
FeatCommand.ID 243
FeatCommand.Increment 243
FeatCommand.Indent 243
FeatCommand.Indent2 243
FeatCommand.Indent3 243
FeatCommand.InitHits 244
FeatCommand.Inner 244
FeatCommand.InteriorHit 244
FeatCommand.Line3D 244
FeatCommand.MeasAngle 244
FeatCommand.MeasDiam 244
FeatCommand.MeasHeight 244
FeatCommand.MeasLength 245
FeatCommand.MeasMajorAxis 245
FeatCommand.MeasMinorAxis 245
FeatCommand.MeasPinDiam 245
FeatCommand.MeasSmallLength 245
FeatCommand.MeasureSlotWidth 245
FeatCommand.NumHits 245
FeatCommand.NumHitsPerRow 245
FeatCommand.NumRows 246
FeatCommand.Parent 246
FeatCommand.PermHits 246
FeatCommand.Polar 246
FeatCommand.PutData 253
FeatCommand.PutPoint 254
FeatCommand.PutSurfaceVectors 254
FeatCommand.PutVector 255
FeatCommand.ReferenceID 247
FeatCommand.ReferenceType 246
FeatCommand.RMeasFeature 247
FeatCommand.SetInputOffset 256
FeatCommand.Spacer 247
FeatCommand.StartAngle 247
FeatCommand.StartAngle2 247
FeatCommand.TheoAngle 247
FeatCommand.TheoDiam 247
FeatCommand.TheoHeight 247
FeatCommand.TheoLength 248
FeatCommand.TheoMajorAxis 248
FeatCommand.TheoMinorAxis 248
FeatCommand.TheoPinDiam 248
FeatCommand.Thickness 248
FeatCommand.Tolerance 248
FeatCommand.UsePin 248
FeatCommand Object Overview 238
FeatData Members 257
FeatData.ANGLE 258
FeatData.DIAM 258
FeatData.EndAngle 258
342 Index
FeatData.EndAngle2 258
FeatData.F 258
FeatData.I 257
FeatData.ID 259
FeatData.J 257
FeatData.K 258
FeatData.LENGTH 258
FeatData.P1 258
FeatData.P2 258
FeatData.SmallDiam 258
FeatData.StartAngle 258
FeatData.StartAngle2 258
FeatData.TP 258
FeatData.X 257
FeatData.Y 257
FeatData.Z 257
FeatData Object Overview 257
Feature 133, 30910, 31317, 319, 32122, 324, 327
30, 332
File Input/Output 28
File IO Members 259
FileIO.BufferSize 259
FileIO.Expression 259
FileIO.FailIfExists 259
FileIO.FileIOType 259
FileIO.FileName1 260
FileIO.FileName2 260
FileIO.FileOpenType 260
FileIO.FilePointerID 260
FileIO.VariableID 260
File IO Object Overview 259
File Menu 11
FileCopy 51, 89
FileLen Function 90
Find 13, 174, 188, 193, 197
Find Next 1314
Fix Function 90
Flatness 312, 314, 328
FlowControlCommand Members 261
FlowControlCommand.AddArgument 263
FlowControlCommand.AddSkipNum 264
FlowControlCommand.AngleOffset 261
FlowControlCommand.ErrorMode 261
FlowControlCommand.ErrorType 261
FlowControlCommand.Expression 261
FlowControlCommand.FileName 261
FlowControlCommand.GetArgumentDescription 264
FlowControlCommand.GetArgumentExpression 264
FlowControlCommand.GetArgumentName 265
FlowControlCommand.GetEndNum 261
FlowControlCommand.GetSkipNum 265
FlowControlCommand.ID 262
FlowControlCommand.IsExpressionValid 265
FlowControlCommand.IsValidLeftHandValue 265
FlowControlCommand.IsValidSubroutineArgumentN
ame 265
FlowControlCommand.Label 262
FlowControlCommand.NumArguments 262
FlowControlCommand.RemoveArgument 266
FlowControlCommand.RemoveSkipNum 266
FlowControlCommand.SetArgumentDescription 266
FlowControlCommand.SetArgumentExpression 267
FlowControlCommand.SetArgumentName 267
FlowControlCommand.SetLeftSideOfAssignment
267
FlowControlCommand.SetRightSideOfAssignment
267
FlowControlCommand.SkipCount 262
FlowControlCommand.StartNum 262
FlowControlCommand.SubName 262
FlowControlCommand.XAxisOffset 263
FlowControlCommand.YAxisOffset 263
FlowControlCommand.ZAxisOffset 263
FlowControlCommand Object Overview 260
For...Next Statement 91
Format Statement 92
FreeFile Function 100
Function Statement 101
K
Kill Statement 115
Machine Members
Machine.Application 270
G
GapOnly 314
Get Object Function 102, 103
GetDimData 31516
GetDimOutTol 315
GetFeatData 31516, 321
GetFeatID 316
GetFeatPoint 314, 317, 330
GetFeature 317
GetPH9Status 317
GetProbeOffsets 317
GetProbeRadius 317
GetProgramOption 317
GetProgramValue 318
GetTopMachineSpeed 318
GetType 318
GetUnits 318
Global Statement 103
GoTo Statement 104
Index 343
Machine.Name 270
Machine.Parent 270
Machine Object Members 270
Machine Object Overview 269
Machines Members
Machines.Application 271
Machines.Count 271
Machines.Item 271
Machines.Parent 271
Machines Object Members 271
Machines Object Overview 270
Making Applications Work Together 49
MaxMineAve 319
Methods 46
Mid Function 122
Minute Function 123
MkDir 124
ModalCommand Members
ModalCommand.ClearPlane 272
ModalCommand.Digits 272
ModalCommand.Distance 272
ModalCommand.Distance2 272
ModalCommand.Mode 273
ModalCommand.Name 273
ModalCommand.On 273
ModalCommand.Parent 273
ModalCommand.PassPlane 273
ModalCommand.Speed 273
ModalCommand.WorkPlane 274
ModalCommand Object Overview 272
Mode 102, 13133, 168, 311, 320, 325, 330
Month Function 125
Move 40, 320, 330
MoveCommand Members
MoveCommand.Angle 274
MoveCommand.Direction 274
MoveCommand.NewTip 274
MoveCommand.OldTip 275
MoveCommand.Parent 275
MoveCommand.XYZ 275
MoveCommand Object 274
MoveCommand Object Overview 274
MoveSpeed 320
MsgBox 125
N
Name Statement 128
Now Function 128
Numbers 1921, 20, 30, 41, 92, 9596, 126, 128, 150,
158, 162
O
Oct Function 128
OK and Cancel Buttons 34
344 Index
OKButton 129
Old PC-DMIS Basic Functions 309
OLE Automation 47, 48, 50
What is OLE Automation? 48, 50
OLE Fundamentals 47
OLE Object 47
On Error 130
Open 11, Error! Not a valid bookmark in entry on
page 15, 178, 179, 180, 271, Error! Not a valid
bookmark in entry on page 280, 281
Open Statement 133
OpenCommConnection 320
Operations 304
Operators 53
Opt Motion Members 276
OptMotion.MaxTAcceleration 276
OptMotion.MaxTSpeed 276
OptMotion.MaxXAcceleration 276
OptMotion.MaxYAcceleration 276
OptMotion.MaxZAcceleration 276
OptMotion.MovePositionalAccuracy 276
Opt Motion Object Overview 275
Option Base Statement 134
Option Buttons and Group Boxes 37
Option Explicit 135
Other Data Types 21
Declaration of Variables 21
Scope of Varibles 21
P
PartProgram Members
PartProgram.ActiveMachine 276
PartProgram.Application 277
PartProgram.Close 278
PartProgram.Commands 277
PartProgram.EditWindow 277
PartProgram.Export 278
PartProgram.FullName 277
PartProgram.Import 278
PartProgram.MessageBox 279
PartProgram.Name 277
PartProgram.OldBasic 277
PartProgram.Parent 277
PartProgram.PartName 277
PartProgram.Path 277
PartProgram.Probes 277
PartProgram.Quit 279
PartProgram.RevisionNumber 277
PartProgram.Save 279
PartProgram.SaveAs 279
PartProgram.SerialNumber 278
PartProgram.Tools 278
PartProgram.Visible 278
PartProgram Object Overview 276
PartPrograms Object Members 280
PartPrograms.Add 280
PartPrograms.Application 280
PartPrograms.CloseAll 281
PartPrograms.Count 280
PartPrograms.Item 281
PartPrograms.Open 281
PartPrograms.Parent 280
PartPrograms.Remove 282
PartPrograms Object Overview 280
Paste 12
PointData Members 282
PointData.I 282
PointData.J 283
PointData.K 283
PointData.X 282
PointData.Y 282
PointData.Z 282
PointData Object Overview 282
Prehit 321
Print 12, 201, Error! Not a valid bookmark in entry
on page 237
Print # Statement 136
Print Method 136
Print Preview 12
Probe Members 283
Probe.ActiveComponent 283
Probe.ActiveConnection 283, 284
Probe.Application 284
Probe.ClearAllTips 285
Probe.ComponentCount 284
Probe.ComponentDescription 285
Probe.ConnectionCount Error! Not a valid
bookmark in entry on page 283, 284
Probe.ConnectionDescription 283, 285
Probe.Dialog 285
Probe.FullName 284
Probe.Name 284
Probe.Parent 284
Probe.Path 284
Probe.Qualify 285
Probe.SelectAllTips 286
Probe.Tips 284
Probe Object Overview 283
ProbeComp 321
Probes Members
Probes.Add 283, 286
Probes.Application 286
Probes.Count 286
Probes.Item 287
Probes.Parent 286
Probes Object Members 286
Probes Object Overview 286
Properties 46
PutFeatData 321
R
Randomize Statement 139
ReadCommBlock 321
RecallEx 322
RecallIn 322
ReDim Statement 139
Rem Statement 140
Replace 13, 188
Retract 322
RetroOnly 322
Right, Function 140
RmDir Statement 141
Rnd 142
Rotate 322
RotateCircle 322
RotateOffset 323
Roundness 312, 323, 328
Run 14
Runout 312, 323, 328
S
SaveAlign 323
ScanCommand Members 287
Scan.BoundaryCondition 287
Scan.BoundaryConditionAxisV 288
Scan.BoundaryConditionCenter 288
Scan.BoundaryConditionEndApproach 288
Scan.BoundaryConditionPlaneV 288
Scan.Filter 289
Scan.GetBoundaryConditionParams 293
Scan.GetFilterParams 293
Scan.GetHitParams 294
Scan.GetMethodPointData 294
Scan.GetNomsParams 295
Scan.GetParams 295
Scan.HitType 290
Scan.Method 291
Scan.MethodCutPlane 291
Scan.MethodEnd 291
Scan.MethodEndTouch 291
Scan.MethodInitDir 291
Scan.MethodInitTopSurf 291
Scan.MethodInitTouch 291
Scan.MethodStart 291
Scan.NominalMode 292
Scan.OperationMode 292
Scan.SetBoundaryConditionParams 296
Scan.SetFilterParams 296
Scan.SetHitParams 297
Scan.SetMethodPointData 297
Scan.SetNomsParams 298
Scan.SetParams 298, 299
ScanCommand Object Overview 287
Scripting 19
Index 345
346 Index
T
Temperature Compensation Members 301
TempComp.GetOrigin 302
TempComp.HighThreshold 301
TempComp.LowThreshold 301
TempComp.Material Coefficient 302
TempComp.RefTemp 302
TempComp.Sensors 302
TempComp.SetOrigin 302
Temperature Compensation Object Overview 301
Text 157
Text Boxes and Text 36
TextBox 158
The Dialog Function 38
The Dialog Function Syntax 39
Time, Function 158
Timer Event 159
TimeSerial - Function 159
TimeValue - Function 160
Tip 331
Tip Members 303
Tip.A 303
Tip.B 303
Tip.Date 303
Tip.Diam 303
Tip.ID 303
Tip.IJK 303
Tip.MeasDiam 303
Tip.MeasThickness 303
Tip.MeasXYZ 303
Tip.Parent 303
Tip.Selected 303
Tip.Thickness 304
Tip.Time 304
Tip.TipNum 304
Tip.Type 304
Tip.WristOffset 304
Tip.WristTipIJK 304
Tip.XYZ 304
Tip Object Overview 303
Tips Members 305
Tips.Add 305
Tips.Application 305
Tips.Count 305
Tips.Item 304, 305
Tips.Parent 305
Tips.Remove 306
Tips Object Overview 305
Tool Members 306
Tool.Application 306
Tool.Diam 306
Tool.ID 306
Tool.Parent 306
Tool.ShankIJK 306
Tool.ToolType 306
Tool.Width 306
Tool.XYZ 307
Tool Object Overview 306
Tools Members 307
Tools.Add 307
Tools.Application 307
Tools.Count 307
Tools.Item 307
Tools.Parent 307
Tools.Remove 308
Tools Object Overview 307
Touchspeed 332
Trace 332
Tracefield 308
Tracefield Members
Tracefield.Name 308
Tracefield.Value 308
Tracefield Object Overview 308
Translate 332
TranslateOffset 332
Trim, LTrim Rtrim Functions 160
Type Statement 161
Type/Functions/Statements 51
Y
Year 169
U
UBound Function 163
UCase, Function 164
Undo 12
User Defined Types 32, 162
V
Val 165
Variable and Constant Names 20
Variable Names 20
Variable Types 20
Variants and Concatenation 20
Varialbe Types
Variant 20
VarType 165
View 14, 201
W
Wait 147, 327, 332
Weekday Function 166
What is an OLE Object? 46
While...Wend Statement 166
With Statement 167
Workplane 31011, 328, 330, 332
Write # - Statement 168
WriteCommBlock 332
Index 347