GibbsCAM Macro Reference
GibbsCAM Macro Reference
Reference Guide
GibbsCAM 2009
rev 1.1, March 2009
Proprietary Notice
This document contains propriety information of Gibbs and Associates and is to be used only pursuant to and in
conjunction with the license granted to the licensee with respect to the accompanying Gibbs and Associates
licensed software. Except as expressly permitted in the license, no part of this document may be reproduced,
transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any
form or by any means, electronic, magnetic, optical, chemical, manual or otherwise, without the prior expressed
written permission from Gibbs and Associates or a duly authorized representative thereof.
It is strongly advised that users carefully review the license in order to understand the rights and obligations
related to this licensed software and the accompanying documentation.
Use of the computer software and the user documentation has been provided pursuant to a Gibbs and Associates
licensing agreement.
© 2006-2008 Gibbs and Associates, a Cimatron® Company. All rights reserved. The Gibbs logo, GibbsCAM,
GibbsCAM logo, Virtual Gibbs, Gibbs SFP, MTM, SolidSurfacer, and “Powerfully Simple. Simply Powerful.”
are either trademark(s) or registered trademark(s) of Gibbs and Associates in the United States and/or
other countries. Windows Vista and the Windows logo are trademarks or registered trademarks of
Microsoft Corporation in the United States and/or other countries. All other brand or product names are
trademarks or registered trademarks of their respective owners.
Table of Contents
MACRO LANGUAGE REFERENCE 1
The GibbsCAM Macro Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
About the Macro Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
About The Macro Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Language Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Flow Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Functions, Operators & Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
About Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Commands With Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Conditional Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Functions With String Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
User Input Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Dialog Creation Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Gibbs Part Manipulation Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
File Handling Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Part Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Post Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Geometry Creation Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
A Note About The <Option> Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Circles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Other Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Geometry Selection & Transformation Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Geometry Information Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Workgroup & Coordinate System Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Solids Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
Tool Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
ToolGroup Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Machining Process Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Machining Operation Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
View Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Commands To Work With External Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Excel Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
Debugging Macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
Parameters from GibbsCAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Part Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
MTM Setup Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Tool Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Process Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
All Process Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
i
Table of Contents
INDEX 77
ii
MACRO LANGUAGE
REFERENCE
Macro Language Reference
User input is available through a simple prompt for a single value, or a user def ined dialog (a .DLG f ile) that may
contain input boxes, check boxes and radio buttons.
Following is some general information about the GibbsCAM Macros and the syntax of the macros.
2
Macro Language Reference
LANGUAGE DESCRIPTION
VARIABLES
GibbsCAM Macro variables do not need to be, but can be declared. If a variable is not declared then it is
automatically def ined when it is used and is global. All numeric variables are double precision floating point
numbers ("floats").
GLOBAL <VARIABLE NAME>, <VAR NAME> ... , <VAR NAME>: Global variables are available to all macros from the
f irst run in an instance. Global variables do not need to be declared unless they are arrays. If a variable is not
declared, i.e. specif ically stated as "global" or "local" then it is considered global.
In this example of an array "XVAL" is an array with 10 values, "YVAL" holds 5 values, "ABC" is a single numeric
value and "DEF$" holds a single string of text characters.
LOCAL <VARIABLE NAME>, <VAR NAME> ... , <VAR NAME>: A local variable is only available to the particular macro
in which it was def ined. Variables that are local to a macros must be declared before they are used. When you exit
the macro the variable is lost.
ARGS <VARIABLE NAME>, <VAR NAME> ... , <VAR NAME>: When you call another macro, you can pass values or
variables to that macro. Inside the macro that is called, you must declare these values using the ARGS command.
This will def ine variables that are local to the called macro that will hold the values passed to that macro.
In the "example.mac" macro, the local variable NUM will start with the value 1 (the f irst value passed to it) and
the local variable COUNTER will hold the value of the ABC variable in the calling macro. When the
"example.mac" macro is f inished, it will pass back the current value of COUNTER into the variable ABC.
FLOW CONTROL
GOTO <LABEL NAME>: Goto instructs the computer to jump to another point in the macro, specif ied by a label
name.
CALL <MACRO FILENAME>: Call instructs the macro to refer to another macro, specif ied by the name of the macro
to be referenced.
3
Macro Language Reference
The GibbsCAM Macros use the standard mathematical operators, i.e. +, -, /, *, <, > and =. Expressions follow the
standard order of operations. Parentheses are optional but are highly recommended to ensure calculation is
correct and to maximize readability.
a = x**3
INT <NUMBER>: When this command is placed in front of a value or numeric variable the number will be
truncated to an integer.
SIN <NUMBER>: Return the sine of the given number. By default the result is in radians.
x= r1 * sin(a)
COS <NUMBER>: Return the cosine of the given number. By default the result is in radians.
x= r1 * cos(a)
TAN <NUMBER>: Return the tangent of the given number. By default the result is in radians.
x= r1 / tan(a)
ASIN <NUMBER>: Compute the arc sine of the given number. By default the result is in radians.
ACOS <NUMBER>: Compute the arc cosine of the given number. By default the result is in radians.
ATAN <NUMBER>: Compute the arc tangent of the given number. By default the result is in radians.
DEGREES: This command will switch all trig functions to work in degrees.
RADIANS: This command will switch all trig functions to work in radians.
4
Macro Language Reference
Strings
About Strings
Concatenation
Most macro operators (-, *, /, etc) don't operate on strings. The exception is +, which acts as a concatenation
operator.
In this example the msg will be set to "This string and a little bit of text".
Embedding Variables
Variables can be embedded in strings at runtime by using the "%variable" syntax.
a = 3
b = 4
s = a * a + b * b
c = sqrt(s)
Message "The hypotenuse of a right triangle with sides of length %a and %b is %c."
In this example the message will be set to "The hypotenuse of a right triangle with sides of
length 3 and 4 is 5."
Special Characters
Linebreaks in strings may be represented with the "\n" special character sequence.
this
and that
Double quotes may be output in text strings using "\q" (or "\Q") .
returns
Certain characters may not be included in string literals. At this point, the following characters will cause errors:
percent sign (%), and exclamation point (!).
EVAL_TEXT <VARIABLE NAME>: This command will evaluate the contents of the string and save the result back into
the variable. This lets you evaluate an array with a variable index.
a$="this is %fred(i)"
i=3
a$=a$+" and %fred(i)"
message a$
5
Macro Language Reference
eval_text a$
Ilen = len("abc")
Ilen = len(a$)
LEFT$ <STRING>, <NUMBER OF CHARACTERS>: Return the leftmost number of characters from a string.
B$ = left$("ABCDE", 3)
RIGHT$ <STRING>, <NUMBER OF CHARACTERS>: Return the rightmost number of characters from a string.
B$ = right$("ABCDE", 3)
MID$ <STRING>, <FIRST CHARACTER>, <NUMBER OF CHARACTERS>: Return the characters from the middle of a
string.
B$ = mid$("ABCDE", 3, 2)
LTRIM$ <STRING>: Return the string with any leading spaces removed
RTRIM$ <STRING>: Return the string with any trailing spaces removed
TRIM$ <STRING>: Return the string with any leading and trailing spaces removed
UCASE$ <STRING>: Return the string with any characters converted to upper case
LCASE$ <STRING>: Return the string with any characters converted to lower case
FMT$ <STRING>, <FORMAT>: Return a numeric value, formatted as a text string. The format may contain:
0 A digit
. A decimal point
6
Macro Language Reference
B$ = fmt$(123.45, "0000.000")
CHR$: This command will take as ASCII code and output the associated character string.
ASC: This command takes the f irst character in a string and returns the ASCII code for that character
7
Macro Language Reference
CONDITIONAL LOGIC
IF <EXPRESSION> THEN <EXPRESSION>: The if/then loop is fairly standard. A basic logic command has the following
syntax.
IF a = b THEN c = d
FOR <VARIABLE> = <START> TO <END>, [STEP <INTEGER>]: For loops are very straight forward. The STEP parameter
has a default value of 1 so you do not need to declare the STEP if the increment is 1. Several examples of FOR loops
follow.
FOR I = 1 TO 10
A = A + 1
NEXT I
The f irst example increments "A" by 1 ten times. The second example has a FOR in a FOR.
NEXT <VARIABLE NAME>: The next command modif ies the FOR variable by the specif ied step and executes the
contents of the loop again.
CONTINUE: The continue command, when placed inside a loop, stops executing the current iteration of a loop and
returns to the top of the next iteration of the loop.
for i = 1 to 3
message "This message will appear three times."
if i = 2 then continue
message "This message will appear twice, for i = 1 and 3; it is bypassed for 2"
next i
8
Macro Language Reference
COMMANDS
Commands that require arguments use a comma as a delimiter between each argument. In the description of the
commands angled brackets ( < > ) indicate any valid expression that evaluates to a number. Square brackets ( [ ] )
indicate optional arguments. The pipe character ( | ) indicates individual valid parameter entries such as "CW |
CCW", which indicates clockwise or counter clockwise and "0 | 1" which indicates either "true or false" or "on or
off". Quite a few commands described here have the parameters "Left" and "Top". The "Left" parameter describes
the distance from the left edge of GibbsCAM or the dialog the parameter is in. The "Top" parameter describes the
distance from the top edge of GibbsCAM or the dialog the parameter is in.
The results of this code is a dialog with an input box that prompts the user to input a value with a default of
"10". This value will be assigned to the variable w1.
YESNO "PROMPT TEXT", <VARIABLE>, ["CAPTION"]: This command calls a dalog with "Yes" and "No" buttons. The
variable gets set to "0" for "No" and "1" for "Yes". If a caption is not set then the top of the dialog will simply say
"Custom Macro".
YESNO "Do you want to do this?", doit1, "You need to make a choice."
This will display a dialog with the caption "You need to make a choice" and the message "Do you want to do
this?". There will be YES and NO buttons. If you press "yes", the variable doit1 will be set to 1, if you press "no"
or close the dialog, it will be set to 0.
DIALOG "FILENAME": You can set up a technique to get input through a custom dialog. When run this command
will open the specif ied dialog.
DIALOG "MyMacro.dlg"
9
Macro Language Reference
DIALOG "CAPTION", <LEFT>, <TOP>, <WIDTH>, <HEIGHT>: This command def ines the left and top position of a
dialog followed by its width and height. This command must be the f irst command in a dialog text f ile.
This creates a dialog called Diamond Insert that is 530x390 pixels which will open 30 pixels from the left and 50
pixels from the top of the GibbsCAM window.
FONT <NAME>, <SIZE>: By default the Macros function uses the default system font for all text in a macro. This
command lets you specify the font used. If the font specif ied is not installed on the user’s system then the macro
will use the system default font.
FRAME <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, "TEXT": This command lets you place a frame within a dialog that can
include a text label. A frame is useful for organizing groups of controls.
This creates a frame within a dialog that has a label that says Angle Definition. The frame is 250x100 pixels and
is offset by 20 pixels from the left and 240 pixels from the top of the dialog.
LABEL "TEXT", <LEFT>, <TOP>, <WIDTH>, <HEIGHT>: This command lets you place a text label in a dialog. You def ine
the left and top position within the dialog, followed by the size of the text, followed by what the text is. Each label
you create is automatically given an incrementing name, i.e. the f irst label in the dialog is referred to as "label1",
the second label is "label2", etc.
This creates text that says Enter a value. The text is offset by 310 pixels from the left and 39 pixels from the top
of the dialog. The text has a maximum area of 100x24 pixels. If the text takes up more space than this it will be
clipped.
INPUT <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, <VARIABLE>, [<DEFAULT>]: This command lets you place a text input
box in a dialog. You def ine the left and top position within the dialog, followed by the size of the box, followed by
a variable name and, optionally, a default value. Each input you create is automatically given an incrementing
name, i.e. the f irst input in the dialog is referred to as "input1", the second input is "input2", etc.
This creates a text entry box that is offset by 420 pixels from the left and 35 pixels from the top of the dialog.
The box is 70x24 pixels. Whatever the user types into this box will be assigned to the variable "a1". This box has
a default value of "10".
CHECK <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, "LABEL", <VARIABLE NAME>, [<0|1>]: This command lets you place a
checkbox within a dialog. You def ine the left and top position within the dialog, followed by the size of the
checkbox, followed by the text that will appear, followed by a variable name and lastly by the default state. "0"
states that the checkbox is off, "1" states that the checkbox is on. If a default setting is not used the checkbox s
10
Macro Language Reference
automatically set off. Each check box you create is automatically given an incrementing name, i.e. the f irst check
box in the dialog is referred to as "check1", the second check box is "check2", etc.
CHECK 420, 35, 20, 20, "Ooh! Ooh! Pick me! Pick me!" check1, 1
RADIO <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, "LABEL", <VAR NAME>, [<0|1>, <GROUP #>]: This command lets you
place a radio button within a dialog and you can group them together. You def ine the left and top position within
the dialog, followed by the size of the button, followed by the text that will appear, followed by a variable name.
Optionally you can specify whether the item is off (0, which is the default) or on (1) and assign the button to a
group, which is any integer value. Each radio button you create is automatically given an incrementing name, i.e.
the f irst radio button in the dialog is referred to as "radio1", the second radio button is "radio2", etc.
This code creates two radio buttons, the f irst is selected the second is not. The buttons are inset from the
dialog by 40 pixels and are 260 and 285 pixels from the top of the dialog. both occupy a 200x24 area, which
includes label text. The f irst button sets the variable "opt1" and the second button sets the variable "opt2". Face
Relief is enabled by default and both radio buttons are in group 1. See the "ON_EVENT" command for an
example of toggling radio buttons.
IMAGE <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, <FILENAME>: This command lets you place an image within a dialog.
You def ine the left and top position within the dialog, followed by the size of the image, followed by the name of
the image. The name may be simply the name of the f ile or it may be the entire path to the f ile. The image must be
a bitmap (.BMP) f ile. Each image you create is automatically given an incrementing name, i.e. the f irst image in
the dialog is referred to as "image1", the second image is "image2", etc.
This code places the image "UpLeft.bmp" 20 pixels from the left and 20 pixels from the top of the dialog. The
image is given an area of 250x200 pixels.
OK <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, ["CAPTION"]: This command lets you place an "Okay" button within a
dialog. You def ine the left and top position within the dialog, followed by the size of the button. The CAPTION
option lets you change the text on the button.
This code creates an "OK" button that is 70x24pixels. The button is 420 pixels from the left and 316 pixels from
the top of the dialog.
CANCEL <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, ["CAPTION"]: This command lets you place a "Cancel" button within a
dialog. You def ine the left and top position within the dialog, followed by the size of the button. The CAPTION
option lets you change the text on the button.
This code creates an "Cancel" button that is 70x24pixels. The button is 310 pixels from the left and 316 pixels
from the top of the dialog.
BUTTON <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, "LABEL", <VALUE>: This command lets you place a custom button
within a dialog. You def ine the left and top position within the dialog, followed by the size of the button, followed
by the text that will appear. This command def ines a variable called "button" that can be used to pass the value.
11
Macro Language Reference
This creates a 40x20 pixel button labelled "Do it" that sets a value of 1 when the button is pressed.
ON_EVENT <CONTROL NAME>, <CONTROL NAME>, <"ENABLE" | "DISABLE" | "SHOW" | "HIDE">: This command is
used to control the enabling and disabling of controls. Following are two examples of this command’s use. The
f irst example illustrates displaying an image when a radio button is selected. The second example shows the
toggling action between radio buttons.
We see two different uses of the on_event command. The f irst ("on_event radio3, image3, show") will display
image 3 when radio button 3 is clicked. The second example shows interactivity of radio buttons. When radio
button 1 is clicked "input1" will be enabled and "input2" will be disabled. When radio button 2 is clicked
"input1" will be disabled and "input2" will be enabled.
DROPDOWN_NEW <DROPDOWN #>, <LEFT>, <TOP>, <WIDTH>, <HEIGHT>, <VARIABLE>: This command lets you
create a dropdown menu within a dialog. The arguments <left> and <top> specify the where the top left corner of
the menu will be placed in the dialog. The <height> argument is the total height of the menu when dropped down,
which is different than other uses <height>, therefore the value should be fairly large to accommodate multiple
entries in the menu. The <variable> argument sets the name the dropdown menu’s value. You may def ine up to
twenty menus in a dialog.
This creates dropdown menu #1 20 pixels in from the top and left of a dialog. The menu is 250 pixels wide and
100 pixels tall when deployed. The selection will be assigned to the variable drop1.
DROPDOWN_ADD <DROPDOWN #>, <CAPTION>, <VALUE>: This command puts an entry into a dropdown menu.
This dropdown menu has three entries. If the "Create a Circle" item is selected from the menu, the variable is
set to "30".
DROPDOWN_VAL <DROPDOWN #>, <VALUE>: This is an optional command that lets you specify a pre-selected
entry in the dropdown list. If this command is not used then the menu will automatically display the f irst item
def ined by "dropdown_add".
DROPDOWN_VAL 1, 20
The dropdown we are def ining will, by default, display the entry with the value "20".
DROPDOWN_EXCEL <DROPDOWN #>, <RANGE NUMBER>: This command maps an Excel range, which is set by using
the "excel_get_range" command. The "excel_get_range" command is used in the macro which calls the dialog. See
the Excel macro sample f ile for an example of this command’s use.
12
Macro Language Reference
SAVE_DEFAULTS: This command has no arguments. When the dialog is closed, it will save all of the dialog values in
a f ile that has the same name as the macro f ilename, but ending with "_in.ini" or "_mm.ini" depending on whether
the current units are inch or metric.
LOAD_DEFAULTS: This command has no arguments. It will set all of the dialog variables to the values that they
contained when the dialog was last used. The values will be read from the f ile previously saved using the
SAVE_DEFAULTS command.
COMMENTS
! Comments are noted by a leading exclamation point. To make a multi-line comment be sure to place an
exclamation point at the start of each line. Comments can be placed in-line with commands but anything
following the exclamation point will not be read by the macro.
Here we see a radio button being def ined. At the end of the line there is a comment.
Multi-Line comments can be split into individual lines using the following variables.
CR$: This is a variable mapped to the character strings for Carriage Return. This will help split comments into
multiple individual lines.
LF$: This is a variable mapped to the character strings for Line Feed. This will help split comments into multiple
individual lines.
CRLF$: This is a variable mapped to the character strings for Carriage Return and Line Feed. This will help split
comments into multiple individual lines.
LABELS
LABELS: A label is used as a pointer for references. A label is designated as a line of text with a colon ( : ) at the start
of the line.
Here we see a logic test and if the test is true the macro will go to "option2". Further down the macro we f ind
":option2" which is the label for that section of the code. There is a comment to help us keep track of what the
code does. The last two lines are the actual code for option2.
13
Macro Language Reference
OPEN_PART "FILENAME": This command will open an existing f ile. If the f ile resides in the same directory as the
macro then the name does not need to be in quotes. Alternatively the f ilename can be a variable.
SAVE_PART: This command will save the current part. This command has no arguments.
SAVE_PART_AS <"FILENAME">: This command will save the current part with a new f ilename specif ied or data
from a variable. The name of the f ile must be specif ied within quotation marks.
FILE_DIALOG_NEW <CAPTION>: This command creates a new Windows Common Dialog with the given caption.
FILE_DIALOG_EXTENSION <DESCRIPTION>, <EXTENSION>: This command adds a value to the f ilename f ilter part of
the dialog box.
FILE_DIALOG_SHOW OPEN|SAVE <VARIABLE NAME>: This command shows the created dialog in "Open" or "Save"
mode.
Part Data
GET_PART_DATA <PARAMETER>, <VARIABLE NAME>: This command is used to get part specif ic data. A list of the
available parameters is provided in the section “Part Data” on page 34.
SET_PART_DATA <PARAMETER>, <VALUE>: This command is used to set part specif ic data. A list of the available
parameters is provided in the section “Part Data” on page 34.
GET_SPINDLE_NUM <VARIABLE NAME>: This command is used to get the number of the currently selected spindle.
SET_SPINDLE_NUM <SPINDLE NUMBER>: This command is used to set the number of the currently selected spindle.
GET_MTM_DATA <PARAMETER>, <VARIABLE NAME>: This command is used to get part specif ic data that is unique
to MTM. A list of the available parameters is provided in the section “MTM Setup Data” on page 34.
SET_MTM_DATA <PARAMETER>, <VALUE>: This command is used to set part specif ic data that is unique to MTM. A
list of the available parameters is provided in the section “MTM Setup Data” on page 34.
Post Commands
GET_POST_DATA <PARAMETER>, <VARIABLE NAME>: This command is used to get data from the posting dialog. A
list of the available parameters is provided in the section “Post Data” on page 47.
SET_POST_DATA <PARAMETER>, <VALUE>: This command is used to set data in the posting dialog. A list of the
available parameters is provided in the section “Post Data” on page 47.
14
Macro Language Reference
RUN_POST [<POST FILENAME>, <OUTPUT FILENAME>]: This command is used to run a post.
Each solution is calculated mathematically, so by trial and error you can see which one you will need. For example,
intersecting a line and circle to get a point will have 2 options. option 1 will always be the f irst intersection as you
look along the direction of the line. Intersecting 2 circles will have 2 solutions. Option 1 will always be the same
side of the line from the center of circle 1 to the center of circle 2.
Points
POINT <X>, <Y>: This command will create a point at the given position.
POINT x1, y1
POINT 10, 15
We see two different examples here. The f irst uses variables; a point will be created at the position specif ied by
variables from user input. The second example uses a hard-coded value; a point will be created at x10 y15. The
values are in part units.
CREATE_POINT <POINT NUMBER>: Points, lines and circles can be created internally in a macro that are in memory
but not drawn. These geometry features are used to calculate geometry, e.g. so you can create a point at the
intersection of a line and circle. This command takes a point def inition that is in memory and creates an actual
point at that location.
POINT_XY <POINT NUMBER>, <X>, <Y>: This command will create a point at the given position.
POINT_CA <POINT NUMBER>, <CIRCLE>, <ANGLE>: This command will create a point on a circle at an angle.
POINT_2L <POINT NUMBER>, <LINE>, <LINE>: This command will create a point at the intersection of two lines.
POINT_LC <POINT NUMBER>, <LINE>, <CIRCLE>, <OPTION>: This command will create a point at the intersection of a
line and circle.
POINT_2C <POINT NUMBER>, <CIRCLE>, <CIRCLE>, <OPTION>: This command will create a point at intersection of 2
circles.
POINT_2P <POINT NUMBER>, <POINT>, <POINT>: This command will create a point between two specif ied points.
POINT_GET_DATA <POINT NUMBER>, <X>, <Y>: This command acquires the data for the point specif ied.
This example shows us getting the X and Y coordinates for point #10. The coordinate data is put into the
variables xx and yy.
15
Macro Language Reference
POINT_COPY <POINT NUMBER>, <NEW POINT NUMBER>: This command will create a copy of the specif ied point.
The copied point is given a number.
point_copy 1, 99
This example shows point 1 being duplicated and the new point being set as point 99.
POINT_TRANSLATE <POINT NUMBER>, <DX>, <DY>: This command will move the specif ied point by an amount in X
and Y.
point_translate 1, 3, -5
This example shows point 1 being moved by 3 part units in X and -5 part units in Y.
POINT_ROTATE <POINT NUMBER>, <XC>, <YC>, <ANGLE>: This command will rotate the point about a specif ied
location at an angle. Negative values are valid.
point_rotate 1, 0, 0, 45
point_rotate 2, -3, -3, -45
This example shows point 1 being rotated about X0Y0 by 45 degrees and point 2 being rotated about X-3Y-3 by
-45 degrees.
POINT_MIRROR <POINT NUMBER>, <AXIS>, <VAL>: This command will reflect the specif ied point across the
specif ied axis at a particular value.
point_mirror 1, x, 0
point_mirror 2, y, 5
This example shows point 1 being reflected across the X axis and point 2 being reflected across Y5, from its
present position.
POINTS: This command takes no arguments This command lets you can create a group of pre-selected points.
Within brackets you def ine the various points in the group using any combination of the point creation
commands.
POINTS [
POINT 1, 2
POINT 3, 2
POINT 3, 5
]
After these commands there will be 3 points, [at (1,2), (3,2) and (3,5)] and they are all selected. At this point you
can load a drilling process to create a drilling operation.
Lines
LINE_2P <LINE NUMBER>, <POINT>, <POINT>: This command will create a line though 2 points.
line_2p 1, 3, 4
line_2p 2, varp1, varp2
The f irst example shows line #1 being created through point 3 and point 4. The second example shows line #2
being created through points that are variables.
16
Macro Language Reference
LINE_HP <LINE NUMBER>, <POINT>: This command will create a horizontal line though a point.
line_hp 5, 1
This example shows horizontal line #5 being created through point #1.
LINE_VP <LINE NUMBER>, <POINT>: This command will create a vertical line though a point.
line_vp 5, 1
This example shows vertical line #5 being created through point #1.
LINE_PA <LINE NUMBER>, <POINT>, <ANGLE>: This command will create a line though a point at an angle.
line_pa 2, 1, 30
LINE_PC <LINE NUMBER>, <POINT>, <CIRCLE>, <OPTION>: This command will create a line though a point tangent to
a circle.
LINE_CA <LINE NUMBER>, <CIRCLE>, <ANGLE>, <OPTION>: This command will create a line tangent to a circle at a
specif ic angle.
LINE_2C <LINE NUMBER>, <CIRCLE>, <CIRCLE>, <OPTION>: This command will create a line tangent to two circles.
LINE_LD <LINE NUMBER>, <LINE>, <DISTANCE>: This command will create a line offset from another line at a
specif ied distance.
LINE_COPY <LINE NUMBER>, <NEW LINE NUMBER>: This command will create a copy of the specif ied line. The
copied line is given a number.
line_copy 1, 99
This example shows line 1 being duplicated and the new line being set as line 99.
CREATE_LINE <LINE NUMBER>: Points, lines and circles can be created internally in a macro that are in memory but
not drawn. These geometry features are used to calculate geometry, e.g. so you can create a point at the
intersection of a line and circle. This command takes a line def inition that is in memory and creates an actual line
at that location.
LINE <X1>, <Y1>, <X2>, <Y2>: This command has been deprecated. Use one of the other line creation commands
instead.
17
Macro Language Reference
Circles
CIRCLE <XC>, <YC>, <RADIUS>: This command will create a circle with a given center point and radius. Upon
creation the circle is def ined by CircleRef(+1).
We see two different examples here. The f irst uses variables; a circle with a radius def ined by rad1 will be
created with its center at cpx, cpy. These variables will be determined at runtime from user input. The second
example uses a hard-coded value; a 10 part unit radius circle will be created at the part origin.
CREATE_CIRCLE <CIRCLE NUMBER>: Points, lines and circles can be created internally in a macro that are in memory
but not drawn. These geometry features are used to calculate geometry, e.g. so you can create a point at the
intersection of a line and circle. This command takes a circle def inition that is in memory and creates an actual
circle at that location.
CIRCLE_CR <CIRCLE NUMBER>, <POINT #>, <RAD>: This command will create a circle using an existing point for the
center point with a specif ied radius.
CIRCLE_CP <CIRCLE NUMBER>, <POINT1>, <POINT2>: This command will create a circle using two points, the f irst is
the center point and the second specif ies the radius.
CIRCLE_2P <CIRCLE NUMBER>, <POINT>, <POINT>: This command will create a circle using two points two def ine
the diameter.
CIRCLE_2PR <CIRCLE NUMBER>, <POINT>, <POINT>, <RAD>, <OPTION>: This command will create a circle using two
points that are on the radius with a stated radius value.
CIRCLE_2LR <CIRCLE NUMBER>, <LINE>, <LINE>, <RAD>, <OPTION>: This command will create a circle with a
specif ied radius tangent to two lines.
CIRCLE_3P <CIRCLE NUMBER>, <POINT>, <POINT>, <POINT>: This command will create a circle through three points.
CIRCLE_PL <CIRCLE NUMBER>, <POINT>, <LINE>: This command will create a circle with the specif ied point at the
center, that is tangent to a line.
CIRCLE_PLR <CIRCLE NUMBER>, <POINT>, <LINE>, <RAD>, <OPTION>: This command will create a circle with the
specif ied point at the center, that is tangent to a line and has a specif ied radius.
CIRCLE_PC <CIRCLE NUMBER>, <POINT>, <CIRCLE>: This command will create a circle with the specif ied point at the
center, that is tangent to a circle.
CIRCLE_PCR <CIRCLE NUMBER>, <POINT>, <CIRCLE>, <RAD>, <OPTION>: This command will create a circle with the
specif ied point at the center, that is tangent to another circle and has a specif ied radius.
CIRCLE_LCR <CIRCLE NUMBER>, <LINE>, <CIRCLE>, <RAD>, <OPTION>: This command will create a circle with a
specif ied radius that is tangent to a line and a circle.
CIRCLE_2CR <CIRCLE NUMBER>, <CIRCLE>, <CIRCLE>, <RAD>, <OPTION>: This command will create a circle with a
specif ied radius that is tangent to two circles.
CIRCLE_GET_DATA <CIRCLE NUMBER>, <CX>, <CY>, <RAD>: This command acquires the data for the circle specif ied.
18
Macro Language Reference
This example shows us getting the X and Y coordinates and the radius value for circle #10. The coordinate data
is put into the variables xx, yy and rr.
CIRCLE_COPY <CIRCLE NUMBER>, <NEW CIRCLE NUMBER>: This command will create a copy of the specif ied circle.
The copied circle is given a number.
circle_copy 1, 99
This example shows circle 1 being duplicated and the new circle being set as circle 99.
CIRCLE_TRANSLATE <CIRCLE NUMBER>, <DX>, <DY>: This command will move the specif ied circle by an amount in
X and Y.
circle_translate 1, 3, -5
This example shows circle 1 being moved by 3 part units in X and -5 part units in Y.
CIRCLE_ROTATE <CIRCLE NUMBER>, <XC>, <YC>, <ANGLE>: This command will rotate the circle about a specif ied
location at an angle. Negative values are valid.
circle_rotate 1, 0, 0, 45
circle_rotate 2, -3, -3, -45
This example shows circle 1 being rotated about X0Y0 by 45 degrees and circle 2 being rotated about X-3Y-3 by
-45 degrees.
CIRCLE_MIRROR <CIRCLE NUMBER>, <AXIS>, <VAL>: This command will reflect the specif ied circle across the
specif ied axis at a particular value.
circle_mirror 1, x, 0
circle_mirror 2, y, 5
This example shows circle 1 being reflected across the X axis and circle 2 being reflected across Y5, from its
present position.
19
Macro Language Reference
Other Geometry
CONTOUR [ ]: The macro function lets you can create a contour comprised of lines and/or circular arcs. Within
brackets you def ine the starting position of the shape followed by the lines and arcs that def ine the shape. The
contour def inition is terminated by a ].
contour [
start r1, 0
line l1-r1, 0
line l1, h2-r2
line l2+r2, h2
line l2, h1-r2
line r1, h1
line 0, r1
]
<REF> = CONTOURREF: Once the contour def inition is terminated, the variable ContourRef is set to the reference
number of the contour.
myShape = ContourRef
START <X>, <Y>: This is the starting position of the contour you are def ining.
START 0, 0
LINE <X>, <Y>: This is the starting position of a line in a contour shape.
LINE 0, 0
We see two different examples here. The f irst uses variables; a line will be created that starts at the intersection
of varx1 and vary1. These variables will be determined at runtime from user input. The second example uses a
hard-coded value; a line will be created that starts at the part origin. The values are in part units.
ARC <XC>, <YC>, <X>, <Y>, "CW" | "CCW": This command states the centerpoint, radius def ined by a position, and
the direction of an arc.
ARC 9, 1, 9, 0, ccw
We see two different examples here. The f irst uses variables; a counter clockwise arc whose centerpoint is the
intersection of xc2, yc2, with an end point at (x2+tx2), (y2+ty2). These variables will be determined at runtime
from user input. The second example uses a hard-coded value; a counter clockwise arc whose centerpoint is
X9, Y1 with an end point at X9, Y0. The values are in part units.
FIT_CURVE <TOLERANCE>, <UNIFORM | CHORD_LEN | FOLEY | CENTRIPETAL>: This command will create a curve
between points using one of four modes, either uniform, chord length, Foley’s or centripetal. See the Geometry
Creation manual for more information on the differences between these types of curves.
20
Macro Language Reference
SELECT_GEO <REF NUM>: Select the given geometry feature, this will be added to the currently selected geometry.
Once selected, geometry may be transformed using the Translate, Rotate, Scale or Mirror functions.
SELECT_GEO line1
SELECT_ALL_GEO: This command will select all geometry in the current workgroup. There are no arguments for
this command. Once selected, geometry may be transformed using the Translate, Rotate, Scale or Mirror
functions.
SELECT_SHAPE <REF>: This command will select a shape. The shape reference number may be the number of any
feature on that shape, the GibbsCAM Macro function will automatically select all features that are connected to
the given feature. Once selected, geometry may be transformed using the Translate, Rotate, Scale or Mirror
functions.
SELECT_SHAPE myShape
DESELECT_ALL_GEO: This command will deselect all geometry. This is typically used before selecting shapes to
ensure you do not get multiple/incorrect selections and at the end of a macro. There are no arguments for this
command.
DESELECT_GEO <REF NUM>: This command will deselect the given geometry feature.
DESELECT_GEO line1
SELECT_REF <REF>: This command has been deprecated by “select_geo <ref num>”.
GET_SELECTION_LIST <LIST NUMBER>: This command gets a list of all currently selected geometry and saves that list
for later use. For example you may have a matrix of points selected. Creating a selection list lets you save this
particular grouping for use later, such as after creating more geometry. The "get_selection_list" command saves the
current selection. You may have up to 10 selection lists.
SET_SELECTION_LIST <LIST NUMBER>, [<OPTION>]: Select the geometry that was previously saved in the given
selection list number. If you set the option to 1, then any currently selected geometry will remain selected, setting
it 0 (the default) will deselect all geometry before selecting the geometry in the list.
TRANSLATE_GEO <DX>, <DY>, [ <DZ>, <# OF COPIES>]: This command will move the selected geometry by the given
amount. Numbers may be positive or negative. Optionally you may also change the depth of the geometry and/or
translate the geometry multiple times.
TRANSLATE_GEO 5, -2, 2
This command will move selected geometry by 5 part units in X, -2 units in Y and 2 units in Z. Typically this
command will be used with variables whose values are set at runtime.
ROTATE_GEO <XC>, <YC>, <ANGLE IN DEGREES>, [<# OF COPIES>]: This command will rotate the selected geometry
about the specif ied position by the specif ied number of degrees. Numbers may be positive or negative. Optionally
you may also rotate the geometry multiple times.
ROTATE_GEO 5, 0, 45
21
Macro Language Reference
This command will rotate the selected geometry by 45 degrees about X5, Y0. Typically this command will be
used with variables whose values are set at runtime.
SCALE_GEO 0.1
SCALE_GEO 25.4
The f irst example command will scale the selected geometry to 10% of its current size. The second example
will scale the selected geometry to 25.4 times its current size. Typically this command will be used with
variables whose values are set at runtime.
MIRROR_GEO <AXIS>, <AXIS VALUE>, [<# OF COPIES>]: This command will flip the selected geometry at the
specif ied point along a specif ic axis. The "axis" parameter for the mirror command is either X or Y. Optionally you
may also create more than one copy of the mirrored geometry.
MIRROR_GEO X, 5
MIRROR_GEO Y, 0
The f irst example command will flip the selected shape about X5. The second example command will flip the
geometry about Y0. Typically this command will be used with variables whose values are set at runtime.
22
Macro Language Reference
GET_SELECTED_GEO_REF <NUMBER>, <VARIABLE NAME>: Get the GibbsCAM feature reference number for one of
the currently selected features. <NUMBER> is a value between 1 and the number of selected features.
GET_NUM_FEAT_SELECTED inum
FOR I = 1 to inum
GET_SELECTED_GEO_REF i, iref
DEBUG iref
NEXT i
In the above example, assume that there were 3 features currently selected. The variable inum would be set to 3
and the macro would loop 3 times displaying the GibbsCAM feature number for the f irst selected feature, then
the second selected feature followed by the third.
GET_FEAT_TYPE <NUMBER>, <VARIABLE NAME>: Get the type of selected feature. The variable will be set to:
GET_FEAT_START <GEO_REF>, <CS>, <XS>, <YS>, [<ZS>]: Get the start position data of the selected feature. If <CS> is
set to 0, the position is in the local feature CS, any other value will return the positions in the world CS.
GET_FEAT_END <GEO REF>, <CS>, <XE>, <YE>, [<ZE>]: Get the end position data of the selected feature.
GET_CIRCLE_DATA <GEO REF>, <CS>, <RAD>, <XC>, <YC>, [<ZC>]: Get the center position data of the selected feature.
If the feature is not a circle, the macro will stop processing.
GET_ARC_DATA <GEO REF>, <CS>, <RAD>, <DIR>, <XC>, <YC>, [<ZC>]: Get the center position data of the selected
feature. If the feature is not an arc, the macro will stop processing.
1. ,
Based on the XY plane [xy <name>, <x>, <y>, <z>] This CS will be aligned to the XY plane and its origin
will be at the XYZ coordinates specif ied.
,
2. Based on the XZ plane [xz <name>, <x>, <y>, <z>]. This CS will be aligned to the XZ plane and its origin
will be at the XYZ coordinates specif ied.
,
3. Based on the YZ plane[yz <name>, <x>, <y>, <z>]. This CS will be aligned to the YZ plane and its origin
will be at the XYZ coordinates specif ied.
,
4. Based on three points [3p <name>, <x1>, <y1>, <z1>, <x2>, <y2>, <z2>, <x3>, <y3>, <z3>].
This option allows you to create a CS that is aligned to three arbitrary points. The new CS’s origin will be
23
Macro Language Reference
placed at the f irst point. The second point def ines any position along the H axis and the third point is any
position along the V axis.
GET_CS <VARIABLE NAME>: Get the number of the currently selected CS.
GET_CS_LIST: This command is one of three commands used to iterate through the CS list. Once called it enables
the use of the number_of_css and next_cs_number commands. See the example macro “Get CS List Info” on
page 55 for a good example of this and related commands.
NUMBER_OF_CSS: This command is the second of three commands used to iterate through the CS list.This
command stores a variable for the number of coordinate systems in a part.
NEXT_CS_NUMBER: This command is the third of three commands used to iterate through the CS list. This
command iterates to the next CS.
GET_CS_NAME <CS NUMBER>, <VARIABLE>: This command is used to acquire the name of a particular CS. The f irst
variable is the CS number and the second variable is the name of the CS.
SET_CS_NAME <CS NUMBER>, <VARIABLE NAME>: Get the name of the given CS number.
GET_GEO_CS <GEO REF>, <VARIABLE NAME>: Get the CS number associated with the given feature number and
return the CS number in the variable.
GET_GEO_AIR <GEO REF>, <VARIABLE NAME>: Get the Air/Wall attribute of a geometry feature. If it is Air, the
variable will be set to 1, if not it will be set to 0.
SET_GEO_AIR <GEO REF>, <VALUE>: Change the Air/Wall attribute of a geometry feature. 1 will set it to Air, 0 to
Wall.
NEW_WG <WG NUMBER>: This command creates a new workgroup. Typically a variable will be used for the
workgroup number to increment to the next WG.
SET_WG <WG NUMBER>: Set the current Workgroup to the given workgroup number.
GET_WG <VARIABLE NAME>: Get the number of the currently selected Workgroup.
GET_WG_NAME <WG NUMBER>, <VARIABLE NAME>: Get the name of the given Workgroup number.
GET_CS_SPINDLE <CS>, <VARIABLE>: This command retrieves the spindle number associated with a given CS.
24
Macro Language Reference
Solids Commands
EXTRUDE <ZS>, <ZE>: This command will create an extruded solid from a selected closed shape. Def ine the starting
and ending Z values, relative to the current coordinate system. The order of the values does not matter, i.e. the +Z
or the -Z can be f irst or last.
The examples shown here will create identical solids, extruded by 10 part units.
REVOLVE H <VALUE>, <ANGLE> | V <VALUE>, <ANGLE>: This command will create a revolved solid from selected
geometry about either the horizontal or vertical axis. The <value> parameter states the position about which the
shape will be revolved and the <angle> specif ies how many degrees the revolution should be, with 360 being the
maximum value.
revolve v, 0, 360
revolve h, 1, 180
These examples will create a shape that is revolved 360 degrees about the vertical axis and a shape that is
revolved 180 degrees about H+1.
TRANSLATE_SOLID <DX>, <DY>, [<DZ>, <NUM COPIES>]: This command will move the selected solid by the given
amount. Numbers may be positive or negative. Optionally you may also move the solid along the depth axis and/or
translate the solid multiple times.
ROTATE_SOLID <XC>, <YC>, <ANGLE>, [<NUM COPIES>]: This command will rotate the selected solid about the
specif ied position by the specif ied number of degrees. Numbers may be positive or negative. Optionally you may
also rotate the solid multiple times.
MIRROR_SOLID <AXIS>, <AXIS VALUE>, [<# OF COPIES>: This command will flip the reflect the currently selected
solid across the specif ied point along a specif ic axis. The "axis" parameter for the mirror command is either X or Y.
Optionally you may also make more than one copy of the mirrored solid.
SCALE_SOLID <SCALE FACTOR>: This command will scale the selected solid.
SCALE_SOLID 0.1
SCALE_SOLID 25.4
The f irst example command will scale the selected solid to 10% of its current size. The second example will
scale the selected solid to 25.4 times its current size. Typically this command will be used with variables whose
values are set at runtime.
SOLID_UNION <SOLID REF>, <SOLID REF>: This command will perform the Union boolean function on the two
specif ied solids.
SOLID_SUBTRACT <SOLID REF>, <SOLID REF>: This command will perform the Subtract boolean function on the two
specif ied solids.
SOLID_INTERSECT <SOLID REF>, <SOLID REF>: This command will perform the Intersection boolean function on the
two specif ied solids.
SELECT_SOLID <SOLID REF>: This command will select the specif ied solid body.
25
Macro Language Reference
SELECT_ALL_SOLIDS: This command will select all solids, both in the workspace and the Body Bag if it is open. This
command has no arguments.
DELETE_SOLID <SOLID REF>: This command will deselect the specif ied solid body.
DESELECT_ALL_SOLIDS: This command will deselect all solids, both in the workspace and the Body Bag if it is open.
This command has no arguments.
GET_SOLID_BAGGED <SOLID REF>, <VARIABLE NAME>, <0 | 1>: This command will check if the given solid is in our
out of the body bag. 1 means that it is in the bag, 0 means that it is not.
SET_SOLID_BAGGED <SOLID REF>, <0 | 1 >: This command will put a specif ied solid in the Body Bag or take it out.
"0" takes the body out of the Body Bag while "1" puts it in the Body Bag.
Tool Commands
GET_TOOL_LIST [0 | 1]: This command creates a list of tools in the Tool list. This command does not require any
arguments, by default the it looks at the entire list (which is "0"). Alternatively you can use "1" in the argument
and the command will create a list only of selected tools. Once the list is generated the macro sets the variables
number_of_tools, first_tool_number, last_tool_number and first_free_tool_number. This allows the
macro to determine how many tools there are, what the number of the f irst tool is and the number of the f irst
empty tile. Then you can use the variable next_tool_number. The f irst time you use this it is set to the number of
the f irst tool, the next time it is set to the second tool and each time you use it the number is incremented to the
next tool. So you can use a FOR/NEXT loop to look at each tool.
GET_TOOL_LIST 1
This command creates a list in memory of the selected tools in the tool list. It also sets four variables that let
you look through the list of selected tools.
CREATE_MILL_TOOL <NUMBER>: This command creates a new mill-type tool. The tool is created in the Tool list at
the tile number specif ied
CREATE_LATHE_TOOL <NUMBER>: This command creates a new lathe-type tool. The tool is created in the Tool list
at the tile number specif ied
DELETE_TOOL <NUMBER>: This command deletes the tool that occupies the specif ied position in the Tool list.
GET_TOOL_STATUS <TOOL NUMBER>, <VARIABLE NAME>: This command determines the state of a tool tile. A
returned value of "0" means the tile position is empty, "1" means that the tool is def ined and valid while a value of
"-1" means that not all of the data required to def ine the tool has been def ined.
GET_TOOL_DATA <TOOL NUMBER>, <PARAMETER>, <VARIABLE NAME>: This command is used to get tool specif ic
data. A list of the available parameters is provided in the section “Tool Data” on page 35.
SET_TOOL_DATA <TOOL NUMBER>, <PARAMETER>, <VALUE>: This command is used to set tool specif ic data. A list
of the available parameters is provided in the section “Tool Data” on page 35.
contour [
start 1, 0
line 1, 1
26
Macro Language Reference
line 1, 2
line 2, 2
]
iShapeRef = ContourRef
set_tool_data 1, mtool_holder, 11
set_tool_data 1, holder_shape_ref, iShapeRef
This code def ines a very simple, geometry-based shape for a mill tool holder using the holder_shape_ref
option.
GET_TOOL_SELECTED <TOOL NUMBER>, <VARIABLE NAME>: This command is used to check if a given tool number
is currently def ined. If it is the variable is set to 1, otherwise it will be set to 0.
SELECT_TOOL <NUMBER>: This command selects the tool that occupies the specif ied position in the Tool list.
SELECT_ALL_TOOLS: This command selects all tools in the tool list. This command has no arguments.
DESELECT_TOOL <TOOL NUMBER>: This command deselects the tool that occupies the specif ied position in the
Tool list.
DESELECT_ALL_TOOLS: This command deselects all tools in the tool list. This command has no arguments.
ToolGroup Commands
GET_TG_DATA <SPINDLE #>, <TOOLGROUP #>, <PARAMETER>, <VARIABLE NAME>: This command is used to get the
tool change position for a given toolgroup. The command requires input for the spindle currently being
referenced, the tool group number, a parameter and a variable name to store the data. The valid parameters for
this command are tool_change_x, tool_change_y and tool_change_z.
SET_TG_DATA <SPINDLE #>, <TOOLGROUP #>, <PARAMETER>, <VALUE>: This command is used to set the tool
change position for a given toolgroup. The command requires input for the spindle currently being referenced, the
tool group number, a parameter and a value to assign to the parameter. The valid parameters for this command are
tool_change_x, tool_change_y and tool_change_z.
GET_PROC_LIST [0 | 1]: This command creates a list of processes in the Process list. This command does not require
any arguments, by default the it looks at the entire list (which is "0"). Alternatively you can use "1" in the argument
and the command will create a list only of selected processes. Once the list is generated the macro sets the
variables number_of_procs, first_proc_number, last_proc_number and first_free_proc_number. This
allows the macro to determine how many processes there are, what the number of the f irst process is and the
number of the f irst empty tile. Then you can use the variable next_proc_number. The f irst time you use this it is
set to the number of the f irst process, the next time it is set to the second process and each time you use it it is
incremented to the next process. So you can use a FOR/NEXT loop to look at each process.
GET_PROC_LIST 1
This command creates a list in memory of the selected processes in the Process list. It also sets four variables that
let you look through the list of selected processes.
27
Macro Language Reference
CREATE_PROC <NUMBER>: This command creates a process. You must follow this with commands to set the
process type and process values using SET_PROC_DATA commands
DELETE_PROC <PROCESS NUMBER>: This command deletes the process number specif ied from the Process list.
GET_PROC_STATUS <PROCESS NUMBER>, <VARIABLE NAME>: This command checks the status of a given process
number. The variable will be set to 0 if the process tile is empty, 1 if it contains a valid process def inition and –1 if
contains a partially complete process.
GET_PROC_DATA <PROCESS NUMBER>, <PARAMETER>, <VARIABLE NAME>: This command is used to get process
data. A list of the available parameters is provided in the section “Process Data” on page 36.
SET_PROC_DATA <PROCESS NUMBER>, <PARAMETER>, <VALUE>: This command is used to set process data. A list of
the available parameters is provided in the section “Process Data” on page 36.
GET_UTIL_PROC_DATA <PROCESS NUMBER>, <PARAMETER>, <VARIABLE NAME>: This command is used to get data
from a utility process. A list of the available parameters is provided in the section “Utility Process Data” on page 41.
SET_UTIL_PROC_DATA <PROCESS NUMBER>, <PARAMETER>, <VALUE>: This command is used to set data for a utility
process. A list of the available parameters is provided in the section “Utility Process Data” on page 41.
CLEAR_PROC_LIST: This command will delete all of the processes in the Process list. This command has no
arguments.
LOAD_PROC <"FILENAME">: This command enables a macro to load a stored/saved process. The name may be
simply the name of the f ile or it may be the entire path to the f ile. This command deprecates "load_process".
CALC_PROC: This command enables a macro to calculate toolpath and create one or more operations. A process
must have been set or loaded for this command to work. This is the equivalent to clicking the "Do It" button. This
command deprecates "calc_process".
GET_PROC_SELECTED <PROCESS NUMBER>, <VARIABLE NAME>: This command is used to check if a given process is
currently selected. The variable will be set to 1 if it is, 0 if not.
SELECT_PROC <PROCESS NUMBER>: This command will select the Process tile specif ied.
SELECT_ALL_PROCS: This command will select all of the processes in the Process list. This command has no
arguments.
DESELECT_PROC <PROCESS NUMBER>: This command will deselect the Process tile specif ied.
DESELECT_ALL_PROCS: This command will deselect all of the processes in the Process list. This command has no
arguments.
SET_MARKERS <0 | 1 | 2 (TOOL SIDE)>, <START FEAT>, <START DIST>, <END FEAT>, <END DIST>, [<DIRECTION>, <SINGLE
FEATURE>]: This command lets you specify how the machining markers are set prior to creating toolpath.
<Tool side> values may be "0" (no offset), "1" (tool left) or "2" (tool right).
28
Macro Language Reference
<Start feat> specif ies which geometry feature to start on. Valid values are integers where "1" is the f irst feature in
the contour, "2" is the second feature, etc.
<Start dist> specif ies the distance along the start feature at which to start machining. Valid values are a percentage
along the feature expressed as a decimal, where "-0.1" is 10% of the feature length before the start of the feature,
"0.5" is halfway along the feature and "0.9" is 90% of the way along the feature.
<End feat> specif ies which geometry feature to end on. Valid values are integers where "1" is the f irst feature in
the contour, "2" is the second feature, etc.
<End dist> specif ies the distance along the end feature at which to stop machining. Valid values are a percentage
along the feature expressed as a decimal, where "-0.1" will start before the feature by 10% of the feature length,
"0.5" is halfway along the feature and "1.1" is 10% of the feature length past the end of the feature.
<Direction> is set to 1 to machine in the direction that the shape was created, 0 to machine in the opposite
direction.
This example sets the machining markers to cut on center, starting off of the f irst feature by 5% of the feature
length. The 4th feature is the last to be cut and the toolpath will f inish off the end of the feature by 5% of its
length. The markers are set to go all the way around and cut in the direction the shape was made.
GET_OP_LIST [0 | 1]: This command creates a list of operations in the Operations list. This command does not
require any arguments, by default the it looks at the entire list (which is "0"). Alternatively you can use "1" in the
argument and the command will create a list only of selected processes. Once the list is generated the macro sets
the variables number_of_ops, first_op_number, last_op_number and first_free_op_number. This allows
the macro to determine how many operations there are, what the number of the f irst operation is and the number
of the f irst empty tile. Then you can use the variable next_op_number. The f irst time you use this it is set to the
number of the f irst operation, the next time it is set to the second operation and each time you use it it is
incremented to the next operation. So you can use a FOR/NEXT loop to look at each operation.
GET_OP_LIST 1
This command creates a list in memory of the selected operations in the Operations list. It also sets four variables
that let you look through the list of selected operations.
GET_OP_STATUS <NUMBER>, <VARIABLE NAME>: This command gets the status of the given operation tile number.
0 means that it is empty, 1 means that it contains a valid operation and –1 means it is a partially completed
operation tile.
DELETE_OP <NUMBER>: This command deletes the operation number specif ied from the Operation list.
GET_OP_DATA <NUMBER>, <PARAMETER>, <VARIABLE NAME>: This command is used to get data from an operation
process. A list of the available parameters is provided in the section “Operation Data” on page 43.
29
Macro Language Reference
SET_OP_DATA <NUMBER>, <PARAMETER>, <VALUE>: This command is used to set data for an operation process. A
list of the available parameters is provided in the section “Operation Data” on page 43.
GET_OP_SELECTED <NUMBER>, <VARIABLE NAME>: This command is used to check if a given operation tile is
currently selected. The variable will be set to 1 if it is, 0 if not.
SELECT_OP <NUMBER>: This command will select the Operation tile that is specif ied.
SELECT_ALL_OPS: This command will select all of the operations in the Operation List. This command has no
arguments.
DESELECT_OP <NUMBER>: This command will deselect the Operation tile that is specif ied.
DESELECT_ALL_OPS: This command will deselect all of the operations in the Operation List. This command has no
arguments.
DESELECT_OPS: This command has been deprecated by “deselect_all_ops”. Use that command instead.
View Commands
SET_VIEW <TOP | FRONT | LEFT | RIGHT | BACK | ISO | HOME>: This command will set the view of the part to one of
the seven standard views, either top, front, left, right, back, isometric or the home view for the current CS.
ZOOM_VIEW <(ZOOM FACTOR)>: This command will zoom in or out on the parts based on the zoom factor entered.
A value of "0" is unzoom, meaning the stock boundary will f it the screen. The zoom factor must be a positive
floating point value. A factor of "0.5" will set the view to half the current size, "1" is the current view size and "2"
is double the current size.
SHRINK_WRAP: This command will enact the Shrink Wrap function, causing the stock to shrink or expand to the
bounds of all geometry and solids. This command has no arguments.
REDRAW: This command will force the screen to redraw. This is typically used at the end of macro to ensure the
user sees what has been done if the system does not force a redraw.
RUN_EXE "APPLICATION FILENAME", ["TEXT" | <VAR NAME>]: This command will launch the specif ied application.
The path to the application is required. The optional parameter is simply passed to the EXE that is being run as a
command line argument. The optional parameter may be a string of text in quotes or a text variable.
So in the example you found, the result is the same as running notepad with a command line argument that is the
contents of the variable $output_f ile. Instead of a variable, you could just as easily have the second argument as a
string of text in double quotes, (for example run_exe "\Windows\System32\Notepad.exe", "c:\myf ile.txt")
30
Macro Language Reference
The f irst item above simply launches Excel. The second example launches Notepad and opens a specif ic f ile.
The third example launches Notepad and opens the f ile whose name is stored in a variable. Please refer to the
macro “Run a Post Processor” for a working example of this.
Text Files
The macro language provides the ability to create, open, read from and write to text f iles. Text f iles should be
space delimited.
FILE_OPEN <FILE NUMBER>, "FILENAME": This command will open a f ile for reading and writing. A maximum of 10
f iles may be opened and the f ile number must be between 1 and 10.
FILE_CLOSE <FILE NUMBER>: This command will close a f ile previously opened using the FILE_OPEN command.
FILE_READ_VARS <FILE NUMBER>, <VAR NAME 1>, ... , <VAR NAME 10>: This command will read one line from the
given f ile number and separate out the data from that line into a set of values. Each value will be returned in the
variable names used in this command. This command supports reading arrays.
FILE_WRITE_VARS <FILE NUMBER>, <VAR NAME 1>, ... , <VAR NAME 10>: This command will write a line of text to a
f ile, that line containing the values of the variables in this command.
FILE_READ_TEXT <FILE NUMBER>, <VARIABLE>: This command will read a line of text from a f ile and save the
contents in the string variable given in this command.
FILE_WRITE_TEXT <FILE NUMBER>, <TEXT>: This command will write a line of text to a f ile.
Excel Files
The macro language provides the ability to open an Excel spreadsheet, scan cells on any given sheet in the XLS f ile
and extract data from specif ic cells.
EXCEL_OPEN "FILENAME": This command will open the specif ied Excel spreadsheet. The path to the f ile is
required.
EXCEL_CLOSE: This command will close Excel. This command has no arguments.
EXCEL_SELECT_SHEET <SHEET NAME>: This command will select all of the data in the specif ied sheet of an open
Excel f ile. As a note, Excel f iles have three sheets by default, labelled "Sheet1", "Sheet2" and "Sheet3", these may be
renamed and the macro requires the correct sheet name.
EXCEL_FIND_CELL <ROW1>, <COL1>, <ROW2>, <COL2>, <CELL TEXT>, <ROW VARIABLE>, <COL VARIABLE>: This
command f inds a cell containing a particular value within a specif ied range. This command matches the exact
value only.
31
Macro Language Reference
EXCEL_GET_CELL <ROW>, <COL>, <VARIABLE NAME>: This command will extract data from a particular cell. You
must specify the row and column to identify the cell. The data in the cell will be assigned to a given variable.
EXCEL_GET_CELL 3, e, data3
EXCEL_GET_RANGE <RANGE NUMBER>, <ROW 1>, <COL 1>, <ROW 2>, <COL 2>: This command will extract data from
a range of cells. You must specify the start cell (row and column) followed by the cell at the end of the range.
EXCEL_GET_RANGE 1, 1, a, 1, j
EXCEL_GET_RANGE 2, 2, a, 11, j
The f irst example above gets the text from the f irst 10 cells (a-j) in the f irst column. The second range example
gets the text from a 10x10 cell range, rows 2-11 and columns a-j.
MISCELLANEOUS COMMANDS
SLEEP <TIME IN SECONDS>: This command will cause the macro to wait for a given amount of time. This puts the
macro to "sleep" for a few seconds, which gives the operating system time to close f iles and clear buffers when you
are creating and/or reading data from external applications.
DEBUGGING MACROS
These commands are provided to assist with debugging.
MESSAGE "TEXT", ["CAPTION"]: This command will display a message box with given text. Optionally you may also
include a caption on the message by including text in a second set of quotation marks. This command is often used
with a logic statement.
DEBUG <VARIABLE>, <VARIABLE> ... This command will display a message box with the value of the given
variable(s).
STOP "TEXT", [<CAPTION>]: This command will stop the macro and display a dialog with the text of your choosing.
This command is often used with a logic statement for error checking. The text must be contained within
quotation marks. Optionally you may give the message box a custom title.
CHECK <PARAMETER>, <ERROR MSG TEXT>: This command can check to see if there is a part currently open in
GibbsCAM and what type of part it is. The command has four parameters, "part_open", "part_mill",
"part_turn"and "part_mtm". In each case the variable gets set to "1" if the case is true, so if a part is open the
value is "1". If the part type and parameter do not match then the macro will stop and the error message will be
displayed.
32
Macro Language Reference
TRACE <ON | OFF>: This command will display each macro in a message box. You will need to press OK to continue
processing the macro.
33
Macro Language Reference
Mill Parts
tool_change_x tool_change_y stock_x1
stock_y1 stock_z1 stock_x2
stock_y2 stock_z2
Turn Parts
tool_change_x tool_change_z stock_rad
stock_z1 stock_z2
34
Macro Language Reference
TOOL DATA
The following parameters are accessible by the get_tool_data and set_tool_data commands.
All Tools
type material offset
spindle_dir id use_id
tool_group_pos tool_group prime_spindle
holder_solid_ref holder_shape_ref
comment (this is a string variable)
Mill Tools
mtool_type mtool_num_flutes mtool_len_offset
mtool_options mtool_length mtool_flute_length
mtool_radius mtool_shank_rad mtool_top_corner_rad
mtool_corner_rad mtool_draft_angle mtool_non_cut_dia
mtool_orientation mtool_tip_angle mtool_pitch_tpi
mtool_preset mtool_tc_shift mtool_lead_tip
mtool_tip_rad mtool_inner_top_corner_rad mtool_bottom_rad
mtool_top_rad holder_type
Lathe Tools
ltool_type ltool_isize ltool_orientation
ltool_holder ltool_thread_style ltool_thread_type
ltool_thread_id_od ltool_thread_dir ltool_offset
ltool_cut_side ltool_face_up ltool_neg_side
ltool_other ltool_holder_option ltool_size
ltool_thick ltool_length ltool_tip_rad
ltool_insert_angle ltool_tip_offset ltool_preset_pt_x
ltool_preset_pt_z ltool_turret_shift_x ltool_turret_shift_z
ltool_face_angle ltool_side_angle ltool_tip_width
ltool_tip_length ltool_thread_pitch ltool_thread_flat_len
ltool_thread_insert_width ltool_thread_edge_pos ltool_mid_angle
ltool_tip_centre_to_preset ltool_face_relief ltool_dia_relief
ltool_holder_thickness ltool_b_axis ltool_util_len
ltool_util_dia ltool_util_angle
LTOOL_ORIENTATION: This item has eight values, 0 through 7. The values correspond to a position
in the tool setup dialog as shown here.
35
Macro Language Reference
LTOOL_TYPE: This item has 17 values, numbered 1 through 17. The values correspond to a position in the tool setup
dialog as shown here.
MTOOL_ORIENTATION: This item has four values, 0, 1, 2 and 3. The values correspond to a
position in the tool setup dialog as shown here.
MTOOL_TYPE: This item has 20 values, numbered 1 through 20. The values correspond to a
position in the tool setup dialog as shown here.
PROCESS DATA
All Process Types
The following parameters are accessible by the get_proc_data and set_proc_data commands when referencing any
type of part.
36
Macro Language Reference
Mill Processes
The following parameters are accessible by the get_proc_data and set_proc_data commands when referencing a
Mill-type part.
37
Macro Language Reference
Intersection Parameters
surface_intersect_type surface_cuts_type surface_passes_type
surface_cleanup_type surface_passes_per_side surface_corner_rad
surface_max_cut_angle
38
Macro Language Reference
39
Macro Language Reference
Lathe Processes
The following parameters are accessible by the get_proc_data and set_proc_data commands when referencing a
Mill-type part.
40
Macro Language Reference
Unload Spindle
spindle_num time
41
Macro Language Reference
SubSpindle In
flow_1 flow_2 fromworkpiece
to_workpiece c_synched spindle_speed
forward sub_in_unload part_in_main
part_in_sub z_clearance z_grip
feedrate orientation
Please note that the options that are used for check boxes will only have a value of 0 or 1.
SubSpindle Return
spindle_on forward with_part
open_main_collet main_loaded spindle_speed
Parts Catcher In
spindle_num z_position time
Move ToolGroup
spindle_num location x_home
x_value z_home z_value
cs control_point
All Stop
This Utility op has no variables
42
Macro Language Reference
OPERATION DATA
All Operation Types
The following parameters are accessible by the get_op_data and set_op_data commands.
Type
mill_type lathe_type
Comment String
op_start (this is a string variable) op_end (this is a string variable)
Mill-Type Operations
The following parameters are accessible by the get_op_data and set_op_data commands when referencing a mill-
type operation.
43
Macro Language Reference
44
Macro Language Reference
Thread Milling
mthread_traverse_cp1 mthread_id_od mthread_thread_dir
mthread_start_thread mthread_end_thread mthread_cut_dia
mthread_clear_dia mthread_pitch mthread_feed
45
Macro Language Reference
Lathe-Type Operations
The following parameters are accessible by the get_op_data and set_op_data commands when referencing a lathe-
type operation.
Lathe Threading
lthread_balanced lthread_angle_alt lthread_starts
lthread_last_cut lathe_prefer_canned lathe_canned_autof in
lthread_type lathe_cut_dir num_spring_passes
Lathe Roughing
lathe_rough_type lathe_pull_off_wall lathe_plunge_cut_type
lathe_plunge_center_out lathe_plunge_type lathe_plunge_entry_type
lathe_pat_shift_f ixed_srt lathe_pat_shift_passes lathe_square_corners
lathe_no_drag lathe_cut_off lathe_od_id_face
lathe_cut_other_side lrough_round_corners lrough_exit_perp
lrough_xplus lrough_xminus lrough_zplus
lrough_zminus lrough_autof in lrough_spindle_dir
lrough_constant_path lrough_min_rad lrough_entry_line
lrough_entry_rad lrough_exit_rad lrough_exit_line
lrough_start lrough_cut_width lrough_ramp_angle
Lathe Threading
lthread_stype lthread_alternate lthread_nom_pitch_index
lthread_angle lthread_nominal_xd lthread_tpi
lthread_pitch lthread_slope lthread_minor_xd
lthread_height_xr lthread_run_in lthread_run_out
lthread_f irst_cut lthread_last_cut lthread_z_start
lthread_z_end lthread_major_dia lathe_surface_z
46
Macro Language Reference
POST DATA
The following parameters are accessible by the get_post_data and set_post_data commands.
47
Macro Language Reference
You can avoid having to go through the process of entering the macros each time you get a new version of
GibbsCAM. The information is saved in the f ile "Macros.ini" which is located in the GibbsCAM
application data folder. You can simply copy this f ile to the new version’s folder.
48
Macro Language Reference
STARTING MACROS
Macros are accessed from the Plug-Ins menu of
GibbsCAM. Additionally a macro may be
automatically run when GibbsCAM is launched
using a command line parameter. To use this the
macro f ilename must be specif ied as an absolute
path. The command may be run from the
command line interface, added to the shortcut to
GibbsCAM (see image to the right) or added to a
batch f ile.
-m "x:\path\to\macro.mac"
49
MACRO LANGUAGE SAMPLES
Macro Language Samples
DIALOG "Sample",100,250,200,120
IMAGE 200, 30, 50, 50, "c:\macros\pic1.bmp"
LABEL 30, 30, 80, 20, "Width"
LABEL 30, 60, 80, 20, "Height"
INPUT 120, 30, 60, 20, w1, 10
INPUT 120, 60, 60, 20, h1, 6
CANCEL 30, 90, 60, 20
OK 120, 90,60, 20
CONTOUR [
START 1, 2
LINE 1, 4
ARC 2, 4, 2, 5, CW
LINE 4, 5
ARC 4, 4, 5, 4, CW
LINE 5, 2
LINE 2, 2
]
51
Macro Language Samples
xx=0
yy=0
CONTOUR [
START xx, yy
LINE (xx+10), yy
LINE (xx+10), (yy+6)
LINE xx, (yy+6)
LINE xx, yy
]
refnum = ContourRef
CLEAR_SELECT
SELECT_SHAPE refnum
ROTATE_GEO xx, yy, 30
Machining Example
As an example, we could follow the contour created in “Simple Geometry Selection and Rotation Example” with
the following:
LOAD_PROCESS "c:\macros\process1.prc"
CALC_PROCESS
SET_MARKERS 1, 1, 0.5, 1, 0.5
This will start and end half way along the f irst feature and cut with tool to the left.
! ---------------------------------------
! start a new part and set the stock size
new_part "Example.vnc"
set_part_data mdd_name, "VMill3a"
! 3 axis vertical mill
set_part_data units, 1
! inches
set_part_data stock_x1, -10
set_part_data stock_y1, -10
set_part_data stock_z1, -1
set_part_data stock_x2, 10
set_part_data stock_y2, 10
set_part_data stock_z2, 1
set_view top
zoom_view 0
! zoom full
message "Create a contour", "Geo Transform", 1
contour [
start 0, 0
52
Macro Language Samples
line 5, 0
line 4, 2
line 4, 1
line 0, 1
line 0, 0
]
iref = ContourRef
! ---------------------------------------
! Start the transformations
message "Select the contour", "Geo Transform", 1
clear_select
select_shape iref
redraw
get_selection_list 1
! save list of currently selected geometry
! ---------------------------------------
! Translate
message "Translate by X 3, Y 4", "Geo Transform", 1
translate_geo 3, 4, 0
redraw
! ---------------------------------------
! Rotate
message "Rotate cw by 30 degrees", "Geo Transform", 1
rotate_geo 0, 0, 30
redraw
! ---------------------------------------
! Mirror
message "Mirror in X, about Y 0", "Geo Transform", 1
mirror_geo x, 0
redraw
! ---------------------------------------
! Translate
message "Copy Translate by X 6, Y 0", "Geo Transform", 1
translate_geo 6, 0, 0, 1
redraw
get_selection_list 2
! save list of currently selected geometry
message "Select both shapes", "Geo Transform", 1
set_selection_list 1
! select the original shape
set_selection_list 2, 1
! add the copy
redraw
! ---------------------------------------
! Mirror
message "Copy Mirror in Y about Y 1.5", "Geo Transform", 1
53
Macro Language Samples
mirror_geo y, 1.5, 1
redraw
! ---------------------------------------
! Scale
message "Scale all geometry to half size", "Geo Transform", 1
select_all_geo
scale_geo 0.5
redraw
check part_open, "You must have a part open to run this macro"
get_wg_list
inum = number_of_wgs
if inum<1 then stop "No WG found"
if inum>20 then inum = 20
! just display data for the f irst 20 workgroups
a$ = "Number of WGs = %inum\n"
a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'"
stop "Finished\n"+a$
54
Macro Language Samples
a1$ = "This macro will get a list the CSs and indicate"
a2$ = "which spindle number is associated with each CS."
a3$ = "Lastly you can create a new CS at the end of the macro."
message "%a1$\n%a2$\n%a3$"
check part_open, "You must have a part open to run this macro."
get_cs_list
inum = number_of_css
if inum<1 then stop "No CS found"
if inum>20 then inum = 20
! just display data for the f irst 20
a$ = "Number of CSs = %inum\n"
! This section is for adding a new CS. Commenting out everything between here
! and the "stop" command will cause the macro to only generate a list of the CSs.
yesno a$, iyesno
if iyesno=0 then stop "Finished"
set_cs ics
update_cs_window
a$ = "Created new CS, number " + format$(ics, "###0") + " = 'Macro CS'"
stop "Finished\n"+a$
55
Macro Language Samples
message "%a1$\n%a2$"
check part_open, "You must have a part open to run this macro"
check part_mill, "This macro is not designed for turned parts"
global xmin, ymin, xmax,ymax ! these variables are used by all macros
global ics
xmin=99999
ymin=99999
xmax=-99999
ymax=-99999
! when we get the data for each feature, we can get the xyz values in either the world cs or the cs local
to each feature.
ics = 1
! world cs (local cs would be zero)
! -----------------------------------
! get the number of selected features
get_num_feat_selected inum
if inum<1 then stop "No geometry selected"
! --------------------------------------
! loop through all selected features and update the min/max xy data according to each features xy
data
for i=1 to inum
! ------------------------------------
! get the feature reference number for the 'i'th selected feature
get_selected_geo_ref i, iref
! -------------------------------------
! get the feature type for this feature
get_feat_type iref, itype
if itype=1 then call "Check_Point_Data.mac"
if itype=2 then call "Check_Line_Data.mac"
if itype=3 then call "Check_Circle_Data.mac"
if itype=4 then call "Check_Arc_Data.mac"
next i
! -------------------
! display the results
56
Macro Language Samples
xmin$=format$(xmin,"####0.0###")
ymin$=format$(ymin,"####0.0###")
xmax$=format$(xmax,"####0.0###")
ymax$=format$(ymax,"####0.0###")
! -------------------------------------
! get the feature type for this feature
yesno "Draw a rectangle around the geometry ?", iyesno
contour[
start xmin, ymin
line xmax, ymin
line xmax, ymax
line xmin, ymax
line xmin, ymin
]
redraw
stop "Finished"
57
Macro Language Samples
58
Macro Language Samples
59
Macro Language Samples
a1$ = "This macro will change the units of the current part"
a2$ = "from inch to metric, or metric to inch, scaling the"
a3$ = "geometry and solids accordingly"
message "%a1$\n%a2$\n%a3$"
check part_open, "You must have a part open to run this macro"
yesno "This part is Metric, Do you want to convert it to Inch ?", iyesno, "Inch Metric Macro"
if iyesno=0 then stop "Finished - no action taken"
! ---------------------------
! convert from metric to inch
scale = 1/25.4
iunits= 1
goto scale
! ---------------------------
! convert from metric to inch
:inch
scale = 25.4
iunits= 0
:scale
60
Macro Language Samples
scale_geo scale
! ---------------------------
! get the current stock
get_part_data stock_x1, x1
get_part_data stock_y1, y1
get_part_data stock_z1, z1
get_part_data stock_x2, x2
get_part_data stock_y2, y2
get_part_data stock_z2, z2
zoom_view 0
message "Finished"
check part_open, "You must have a part open to run this macro"
check part_mill, "This macro is not designed for turned parts"
get_num_feat_selected inum
if inum<1 then stop "No geometry selected"
! -------------------------
! create a f ile open dialog
file_dialog_new "Select output filename"
file_dialog_extension "Text files (*.txt)", "txt"
61
Macro Language Samples
! -------------------------
! open the f ile on unit 1 for writing
file1_open=0
file_open 1, f$, write
if FileError<>0 then goto file_error
file1_open=1
! -------------------------
! loop through all selected features and update the min/max
! xy data according to each features xy data
! try setting fmt$ to any of the next 3
! to get different formatted numbers
fmt$ = "+~~~0.0~~"
! ! output spaces in place of leading/trailing zeros
!fmt$ = "+###0.0##"
! do not output leading/trailing zeros
!fmt$ = "+0000.000"
! output leading/trailing zeros
for i=1 to inum
! -------------------------
! get the feature reference number for the 'i'th selected feature
get_selected_geo_ref i, iref
! -------------------------
! get the feature type for this feature
get_feat_type iref, itype
if itype=1 then goto label_point
if itype=2 then goto label_line
if itype=3 then goto label_circle
if itype=4 then goto label_arc
continue
:label_point
get_feat_start iref, 1, xs, ys, zs
:label_line
get_feat_start iref, 1, xs, ys, zs
get_feat_end iref, 1, xe, ye, ze
62
Macro Language Samples
:label_circle
get_circle_data iref, 1, rad, xc, yc, zc
:label_arc
get_feat_start iref, 1, xs, ys, zs
get_feat_end iref, 1, xe, ye, ze
get_arc_data iref, 1, rad, dir, xc, yc, zc
a$="Arc CCW"
if dir=1 then a$ = "Arc CW "
a$ = a$ + " Xc=%xc$ Yc=%yc$ Zc=%zc$ R =%rr$"
a$ = a$ + "\n Xs=%xs$ Ys=%ys$ Zs=%zs$"
a$ = a$ + " Xe=%xe$ Ye=%ye$ Ze=%ze$"
goto label_print
:label_print
file_write_text 1, a$
if FileError<>0 then goto file_error
next i
file_close 1
if FileError<>0 then goto file_error
stop "Finished"
:file_error
ierr=FileError
if file_open=1 then file_close 1
stop "File error, code = %FileError"
63
Macro Language Samples
! -----------------------------------------------
! create a f ile open dialog and get post f ilename
file_dialog_new "Select Post"
file_dialog_extension "Post files (*.pst)", "pst"
file_dialog_show open, post_file$
! -----------------------------------------------
! create a f ile save dialog and get code f ilename
file_dialog_new "Post Output File"
file_dialog_extension "All files (*.*)", "*"
file_dialog_show open, output_file$
! -----------------------------------------------
! get some post parameters
get_post_data, start_prog_num, post_start_prog_num
get_post_data, seq_from, post_seq_from
get_post_data, seq_by, post_seq_by
64
Macro Language Samples
run_post
message "Finished - output file = %output_file$"
yesno "View the output ?", iyesno
if iyesno = 0 then stop "Finished"
run_exe "\Windows\System32\Notepad.exe", output_file$
65
Macro Language Samples
Loop Example
Following is an example of how a "For/Next Loop" (for i=1 to 3)
variable works. In the example, we will make a variable loop to
create a bolt-circle as shown to the right. The bolt-circle will
have a radius of 1.3 with 8 holes equally spaced. The f irst hole
will be located at 22.5°. The positive direction of rotation is c/
cw.
Known Values
• 1.3 = r1 (radius).
• 8 = n1 (# of holes).
• 360/8 = 45°
1. DEGREES
2. r1=20
3. n1=8
4. a1=22.5
5. aa = a1
! 22.5°
6. da = (360/n1)
! 45°
7. points[
! start creating a set of points
8. for i=1 to n1
! loop 8 times
9. xx = r1*cos(aa)
! x position of hole
10. yy = r1*sin(aa)
! y position of hole
11. point xx,yy
! points 1 to 8
12. aa = aa + da
! angle of next hole going ccw
13. next i
! increment loop count i
14. ]
! end creating set of points
66
Macro Language Samples
13. Add 1 to variable I, making it 2. Since 2 is less than or equal to 8 (n1), jump back to line 5.
13. Add 1 to I, making it 9. Since 9 is greater than 8 (n1), f inish the loop and continue to line 10.
67
Macro Language Samples
The Math
i1 = 000.0° + 022.5° = 022.5° = x1.2010 y0.4975
Macro3.mac Code
dialog "Macro3.dlg"
! This calls the dialog f ile. The macro f ile is the basis of the program but the user interacts with the
dialog. Since this macro can’t do anything until it has data fro the user the dialog must be called
f irst. Looking at the dialog f ile at the is point is recommended so that you become familiar with its
components. The code for "Macro3.dlg" can be found on page 70.
! a1 = incline angle
! a2 = included angle
! ww = width
! ll = length
! xs = start point
! ys = start point
! These are comments to help you keep track of what the variables represent. A liberal use of
comments is strongly recommended.
degrees ! switch all trig functions to degrees
! Here we see an inline comment letting us know we’re switching value types.
d2 = (ll * tan(90-a2))
w2= (ww-d2-d2) ! length of short end
! As the comment says, this calculates the length of the short end of the trapezoid. The user inputs
the length of the long end and the included angle of the sides, the system calculates the short end.
if messages=1 then message "Create contour, without rotation"
68
Macro Language Samples
! If the user selected the "Show Messages" option a message will open
that keeps the user informed. Please note that the user must click
the "OK" button before the macro continues.
contour [
start xs, ys
line xs+ll, ys+d2
line xs+ll, ys+d2+w2
line xs, ys+ww
line xs, ys
]
! The contour command creates the trapezoid from the user-supplied data.
iref = ContourRef
! The contour is assigned the variable name "iref".
if messages=1 then message "select contour"
! If messages are on the user is told the system is selecting the shape it just made.
clear_select
select_shape iref
redraw
! The macro f irst makes sure nothing is selected, then it selects "iref" and f inally redraws the screen.
if messages=1 then message "Rotate to inclination angle"
! If messages are on then the user is told the shape is going to be rotated.
rotate_geo xs,ys,a1
redraw
! The shape is rotated about the start point by the user-supplied angle.
if messages=1 then message "Set markers, load process and create ops"
! If messages are on then the user is told that toolpath is going to be created.
set_markers 1, 1, 0.5, 1, 0.5
! The machining markers are set to cut on the left ("1") and to start and end halfway along the f irst
feature ("1. 0.5").
load_process "macro3.prc"
! The saved process f ile is loaded. Since only the f ile name is referenced the process f ile must be in
the same directory as the macro.
calc_process
clear_select
redraw
! The process is applied to the shape. The selection is cleared and the screen is redrawn so the user
can see the results.
if messages=1 then message "Finished"
! If messages are on then the user is told that the macros has done its job. The macro is not set up to
save the f ile. A good way to learn more about the macros is to add a message warning the user
about saving the f ile or even adding code to this f ile that will save the part.
69
Macro Language Samples
Macro3.dlg Code
This is the actual code for the macro dialog. If you do not have the sample you can copy the text and save it. The
green text denotes our comments to help you understand the code.
70
Macro Language Samples
! An option is placed for the user. If this option is checked then the macro will show a text message
at certain points during the macro’s execution. The messages let the user know what is going on.
This sets the variable "messages" to true ("1").
cancel 260, 240, 70, 24
! This creates a cancel button which is mandatory.
ok 370, 240, 70, 24
! This creates an okay button which is mandatory. That is all there is to the dialog f ile. All the data
collected here gets passed to the macro f ile.
The Results of the Macro
This macro requires an open f ile. We start with an empty 3-axis mill part.
71
Macro Language Samples
The f inal results. The shape, tools. processes and operations are all created by the macro.
8"
6"
70°
30°
X4,
dialog "Macro2.dlg"
! The f ile “Macro2.dlg” is opened to gather the shape dimensions.
“Macro2.dlg” can be found on page 74.
dialog "Macro2repeats.dlg"
! After data has been collected from "macro2.dlg" this dialog, “Macro2Repeats.dlg” opens to
determine the number of repeats.“Macro2Repeats.dlg” can be found on page 75.
! l1 = long length
! l2 = short length
! h1 = long height
! h2 = short height
! r1 = large fillet
! r2 = small fillet
! These are the variables collected by "macro2.dlg".
! xs = x start
! ys = y start
! dx = x spacing
! dy = y spacing
! nx = number in x
! ny = number in y
! These are the variables collected by "macro2repeats.dlg".
if nx<2 then stop "Invalid number of parts in X (2 to 5)"
if nx>5 then stop "Invalid number of parts in X (2 to 5)"
72
Macro Language Samples
! the macro can only create up to 5 shapes in an X direction. If less than 2 or more than 5 parts are
requested then the macro will stop.
if ny<2 then stop "Invalid number of parts in Y (2 to 4)"
if ny>4 then stop "Invalid number of parts in Y (2 to 4)"
! the macro can only create up to 4 shapes in a Y direction. If less than 2 or more than 4 parts are
requested then the macro will stop.
x1=xs
! The variable "x1" is set equal to the X start position the user specif ied.
for i=1 to nx
! a count is started
y1=ys
! The variable "y1" is set equal to the Y start position the user specif ied.
for j=1 to ny
! a count is started
contour [
start x1+r1, y1
line x1+l1-r1, y1
arc x1+l1-r1, y1+r1, x1+l1, y1+r1, ccw
line x1+l1, y1+h2-r2
arc x1+l1-r2, y1+h2-r2, x1+l1-r2, y1+h2, ccw
line x1+l2+r2, y1+h2
arc x1+l2+r2, y1+h2+r2, x1+l2, y1+h2+r2, cw
line x1+l2, y1+h1-r2
arc x1+l2-r2, y1+h1-r2, x1+l2-r2, y1+h1, ccw
line x1+r1, y1+h1
arc x1+r1, y1+h1-r1, x1, y1+h1-r1, ccw
line x1, y1+r1
arc x1+r1, y1+r1, x1+r1, y1, ccw
]
! This code creates the shape from the user-input using simple math.
y1 = y1 + dy
! The variable "y1" is incremented by the Y offset
next j
! The next contour is created in Y. This will repeat a number of times equal to "ny".
x1 = x1 + dx
! The variable "x1" is incremented by the x offset
next i
! The next contour is created in X. This will repeat a number of times equal to "nx". Basically, this
code creates a number of shapes in Y, then steps over in X and creates the same number of shapes.
This will repeat until "nx" is reached.
clear_select
! This deselects any item to ensure it is not accidentally deleted.
redraw
! This forces a redraw so the user can see the results of the macro.
73
Macro Language Samples
Macro2.dlg
This code sets the dialog "Example Macro 2" which collects user input for def ining the shape that will be repeated.
74
Macro Language Samples
75
Macro Language Samples
! Text labels for the input f ields and the accompanying text entry boxes are created. A variable and
default is set for each f ield.
cancel 260, 240, 70, 24
ok 340, 240, 70, 24
! The required "Cancel" and "OK" buttons are created. When this dialog is closed with "OK" the
macro will continue to run with values for all of the variables.
76
INDEX
Index
Index
Comments: 13, 68
Symbols Concatenation: 5
%variable: 5 Continue statements: 8
Contour
example of defining: 51
example of transforming: 52
A contour command: 20, 69
Absolute Value: 4 ContourRef: 69
Air/Wall geometry: 24 Coordinate System commands
arc command: 20 get_cs: 24
Arc Cosine: 4 get_cs_list: 24
Arc Sine: 4 get_cs_name: 24
Arc Tangent: 4 get_geo_air: 24
Args: 3 new_cs: 23
Arrays: 3 next_cs_number: 24
number_of_css: 24
set_cs: 24
set_cs_name: 24
B set_geo_air: 24
button command: 11 Cosine: 4
CounterRef: 20
create_lathe_tool: 26
C create_mill_tool: 26
create_proc command: 28
calc_proc command: 28 Curve, creation of: 20
calc_process command: 28, 69
Call function: 3
cancel button command: 11, 71
check command: 32 D
check(box) command: 10, 70 debug command: 32
Circle commands Degrees: 4
circle: 18 command: 4, 68
circle_2cr: 18 Delete commands
circle_2lr: 18 clear_proc_list: 28
circle_2p: 18 delete_geo: 22
circle_2pr: 18 delete_op: 29
circle_3p: 18 delete_proc: 28
circle_copy: 19 delete_shape: 22
circle_cp: 18 delete_solid: 26
circle_cr: 18 delete_tool: 26
circle_get_data: 18 Deselect, see Selection commands
circle_lcr: 18 Dialog
circle_mirror: 19 command: 9, 68
circle_pc: 18 creating a: 10, 70
circle_pcr: 18 example of defining: 51
circle_pl: 18 Dropdown menus
circle_plr: 18 dropdown_add command: 12
circle_rotate: 19 dropdown_excel command: 12
circle_translate: 19 dropdown_new command: 12
create_circle: 18 dropdown_val command: 12
clear_select command: 69
78
Index
parameters: 43, 46
E All Milling Ops: 43
Embedding Variables: 5 All Operations: 43
Excel commands Comment String: 43
excel_close: 31 Lathe Roughing: 46
excel_find_cell: 31 Lathe Threading: 46
excel_get_cell: 32 Mill Contour & Pocket Wall: 44
excel_get_range: 32 Mill Contour Entry: 44
excel_open: 31 Mill Drilling: 43
excel_select_sheet: 31 Mill Pocket & Contour: 43
Exclamation Point: 5 Pocket Entry: 45
Exponent: 4 Surfacing Entry: 45
extrude command: 25 Surfacing, 2 Curve Flow: 45
Surfacing, General: 45
Surfacing, Intersection: 45
Surfacing, Lace Cut: 45
F Surfacing, Surface Flow: 45
File commands Thread Milling: 45
file_close: 31 Turning Ops: 46
file_delete: 31 Type: 43
file_dialog_extension: 14 get_op_list: 29
file_dialog_new: 14 get_op_selected: 30
file_dialog_show open: 14 get_op_status: 29
file_open: 31 get_part_data
file_read_text: 31 command: 14
file_read_vars: 31 parameters: 34
file_write_text: 31 All Part Types: 34
file_write_vars: 31 Mill Parts: 34
fit_curve command: 20 Turn Parts: 34
font: 10 get_post_data
For Statements: 8 command: 14
Loop Example: 73 parameters: 47
frame command: 10, 70 Posting Data: 47
get_proc_data
command: 28
parameters: 36, 37, 40
G 2 Curve Flow: 38
Get commands Contour Entry, Mill: 39
Get Feature commands General Process Parameters: 36
get_feat_end: 23 Intersection: 38
get_feat_start: 23 Lace Cut: 38
get_feat_type: 23 Lathe Drilling: 40
get_arc_data: 23 Lathe Process: 40
get_circle_data: 23 Lathe Roughing: 40
get_geo_air command: 24 Lathe Threading: 40
get_mtm_data Mill Drilling: 37
command: 14 Milling: 37
parameters: 34 Pocket & Contour: 37
General MTM: 34 Pocket Entry: 37
get_num_feat_selected: 23 Surface Entry: 38
get_op_data Surface Process: 38
command: 29 Thread Milling: 39
79
Index
get_proc_list: 27 Labels: 13
get_proc_selected: 28 lcase$ command: 6
get_proc_status: 28 left$ command: 6
get_selected_geo_ref: 23 len command: 6
get_selection_list: 21 Line commands
get_solid_bagged: 26 create_line: 17
get_tg_data: 27 line: 17
get_tool_data line (in a contour): 20
command: 26 line_2c: 17
parameters: 35 line_2p: 16
All Tools: 35 line_ca: 17
Lathe Tools: 35 line_copy: 17
Mill Tools: 35 line_hp: 17
get_tool_list command: 26 line_ld: 17
get_tool_selected: 27 line_pa: 17
get_tool_status: 26 line_pc: 17
get_util_proc_data line_vp: 17
command: 28 Linebreak: 5
parameters: 41 Load commands
All Stop: 42 load_defauts: 13
Load, Auto Bar Feed: 41 load_proc: 28
Load, Auto Chuck: 41 load_process: 28, 69
Load, Bar Feed: 41 Local variables: 3
Load, Bar Pull: 41 ltrim$ command: 6
Load, Manual Chuck: 41
Move ToolGroup: 42
Part Shift, Bar Feed: 41
Part Shift, Bar Pull: 41
M
Parts Catcher In: 42 Machining markers: 28
Parts Catcher Out: 42 Machining process, example of defining: 52
Process Names: 41 Mathematical Operators: 4
SubSpindle In: 42 message command: 32, 68
SubSpindle Return: 42 mid$ command: 6
Unload: 41 mirror_geo command: 22
get_cs_spindle: 24 mirror_solid: 25
Global variables: 3 MTM commands
Goto: 3 get_mtm_data: 14
set_mtm_data: 14
I
If - Then
N
command: 8 new_part command: 14
Loop example: 72 Next statements: 8
Image command: 11, 70 Not Equal: 4
Indents: 2
Input command: 9, 10, 70
Int: 4 O
ok (button) command: 11, 71
on_event command: 12
L open_part command: 14
Label command: 10, 70 Option argument: 15
80
Index
save_part_as: 14
P scale_geo command: 22
Part Data commands scale_solid command: 25
get_part_data: 14 Selection commands
set_part_data: 14 deselect_all_geo: 21
Passing values: 3 deselect_all_ops: 30
percent sign: 5 deselect_all_procs: 28
Point Commands deselect_all_solids: 26
create_point: 15 deselect_all_tools: 27
point: 15 deselect_geo: 21
point_2c: 15 deselect_op: 30
point_2l: 15 deselect_ops: 30
point_2p: 15 deselect_proc: 28
point_ca: 15 deselect_tool: 27
point_copy: 16 select_all_geo: 21
point_get_data: 15 select_all_ops: 30
point_lc: 15 select_all_procs: 28
point_mirror: 16 select_all_solids: 26
point_rotate: 16 select_all_tools: 27
point_translate: 16 select_geo: 21
point_xy: 15 select_op: 30
points: 16 select_proc: 28
Post commands select_ref: 21
get_post_data: 14 select_shape: 21, 69
run_post: 15 select_solid: 25
set_post_data: 14 select_tool: 27
Selection list: 21
Set commands
set_markers: 28, 30, 69
Q set_mtm_data
Quote Mark: 5 command: 14
get_part_data: 14
parameters: 34
General MTM: 34
R set_op_data
Radians: 4 command: 30
command: 4 parameters: 43, 46
radio command: 11 All Milling Ops: 43
redraw command: 30, 69 All Operations: 43
Return Values, String: 9 Comment String: 43
revolve (solid) command: 25 Lathe Roughing: 46
right$ command: 6 Lathe Threading: 46
rotate_geo command: 21, 69 Mill Contour & Pocket Wall: 44
rotate_solid command: 25 Mill Contour Entry: 44
rtrim$ command: 6 Mill Drilling: 43
run_exe command: 30 Mill Pocket & Contour: 43
Pocket Entry: 45
Surfacing Entry: 45
S Surfacing, 2 Curve Flow: 45
Surfacing, General: 45
Save commands Surfacing, Intersection: 45
save_defaults: 13 Surfacing, Lace Cut: 45
save_part: 14
81
Index
82
Index
V
Variable: 3
W
Workgroup commands
get_wg: 24
get_wg_name: 24
new_wg: 24
set_wg: 24
Y
Yes or No button: 9
yesno command: 9
Z
zoom_view command: 30
83