Tool and Holder Functions
Tool and holder functions provide control over the management and configuration of tools and their holders within the simulation.
These functions support dynamic tool/
Manage additional active tools
Indicates the start of a tool change sequence
Color definition for dynamic tools and holders
Indicates the end of a tool change sequence
Manage gouge testing status
Dynamic holder creation
Get pocket number associated with the tool
Dynamic tool creation
The $FMSADDTOOL Function
Manage additional active tools Returns: Numeric |
The $FMSADDTOOL function identifies an additional cutting tool that operates in conjunction with the primary tool, using the same machine axes. It is typically used in machines with multiple spindles that machine duplicate parts simultaneously. The tool-axis-id or tool-axis-id/
pocket-id pair specifies the additional tool to be activated or deactivated. To activate a tool, provide a part-id indicating the part on which the tool’s movements should be applied. To deactivate a previously activated tool, specify OFF or use a value of 0 in place of the part-id.
The $FMSBTC Function
Beginning of tool change Returns: Numeric (always returns 1) |
The $FMSBTC function is used to indicate the beginning of a tool change. When in continuous animation mode and the “Motion step during Tool Change” setting is active, the animation mode will switch to the Motion Step format. The animation mode will switch back to continuous when the $FMSETC function is later called to indicate the end of the tool change.
The $FMSCOLR Function
Define the material properties Returns: Numeric (always returns 1) |
The $FMSCOLR function provides the ability to define the material properties of dynamically created tools, holders, parts and fixtures, using same functionality as can be found in the Simulation»
Material dialog. To define a color, first call $FMSCOLR(START,name) where name is a string constant or variable defining the name of the custom color. This name can subsequently be used in $FMSTOOL, $FMSHLD, $FMSPART and $FMSFIXTURE properties that take a color name.
Next, call $FMSCOLR(property,parameter-list) once for each color property to be defined, where the property name is specified using a string constant or variable containing the name of the property. Available properties and their parameter values are:
The color of the environment. The red, green and blue parameters are values in the range 0-255. The default ambient color is black (0,0,0).
The color of the object. Default is black.
The color shown in reflections. Default is black.
The degree of shininess in the range 0-100. Default is 0 (not shiny).
The degree of transparency in the range 0-100. Default is 0 (opaque).
Lastly, call $FMSCOLR(END) to complete the color definition.
The $FMSETC Function
End of a tool change Returns: Numeric (always returns 1) |
The $FMSETC function is used to indicate the end of a tool change. When in continuous animation mode, and the “Motion step during Tool Change” setting is active, the animation mode will switch to the Motion Step format when the $FMSBTC function is called. The animation mode will switch back to continuous when the $FMSETC function is later called to indicate the end of the tool change.
The $FMSGOUG Function
Returns the current gouge testing status Returns: Numeric |
The $FMSGOUG function returns the current gouge testing status between the cutting portion of the tool and the part. A return value of 0 (zero) means gouge testing is disabled; a return value of 1 (one) means it is enabled.
Optionally, you can change the gouge testing status by specifying n: use 0 to disable testing, or 1 to enable it.
The $FMSHLD Function
Holder properties Returns: Numeric, String or Sequence |
There are three forms of the $FMSHLD function. CLEAR clears all holder definitions from the holder table. RETURN obtains holder information. START-END creates new holder definitions.
Clear holder table
This form of the $FMSHLD function removes all holder definitions from the holder table. It always returns the value 1.
Get holder properties
This form of the $FMSHLD function returns requested properties of a holder where holder is a string constant or variable defining the name of the holder and property-list is a string constant or variable defining a comma separated case insensitive list of properties to be returned. Returned holder properties can be either numeric values or strings. Multiple property values are returned as a sequence. Linear properties are returned in the current machine units.
The following holder properties can be queried:
property
Common holder properties
TYPE
1:profile, 2:generic
PARENT
Parent holder name string, blank if none
UNITS
Units of holder definition (informational) 1:inch, 25.4:mm
Profile holder properties
PT0
Spindle contact distance along holder axis
PT1
Tool contact distance along holder axis
Generic holder properties
ACTASAHEAD
Holder acts as a head for tool comp. purposes 0:no, 1:yes
SPINDLE
Sequence of xyz spindle contact distances from holder origin
SPINDLE.X
Spindle contact x-axis distance from holder origin
SPINDLE.Y
Spindle contact y-axis distance from holder origin
SPINDLE.Z
Spindle contact z-axis distance from holder origin
TOOL
Sequence of xyz tool contact distances from holder origin
TOOL.X
Tool contact x-axis distance from holder origin
TOOL.Y
Tool contact y-axis distance from holder origin
TOOL.Z
Tool contact z-axis distance from holder origin
TOOL.A
Tool rotation around x-axis relative to the holder tool contact point
TOOL.B
Tool rotation around y-axis relative to the holder tool contact point
TOOL.C
Tool rotation around z-axis relative to the holder tool contact point
Create new holder
This form of the $FMSHLD function provides the ability to create a new holder. To create a holder, first call $FMSHLD(START,name) where name is a string constant or variable defining the name of the holder. This name can subsequently be used in the $FMSTOOL 'HOLDER' property.
Next, call $FMSHLD(property,parameter-list) once for each holder property to be defined, where the property name is specified using a string constant or variable containing the name of the property. Available properties and their parameter values are:
For profile holders:
Specifies a “Profile” holder type. The profile is a sequence containing the xz values of the profile to be swept around a {0,0,1} axis. The optional crprofile is a sequence of corner radius values to apply to the corresponding vertices of the profile (trailing zero values can be omitted).
Specifies the spindle contact point distance along the {0,0,1} holder axis. This is where the holder is attached to its parent. Default is zero.
Specifies the tool contact point distance along the {0,0,1} holder axis. This is where the tool (or child holder) is attached to the holder. Default is zero.
For generic holders:
Specifies a “Generic” mesh holder type. The filename is a string constant or variable specifying the ASCII STL file containing the mesh geometry of the holder.
Specifies a “Generic” extruded holder type. The profile is a sequence containing the xy values of the holder profile to be extruded for the specified distance along the {0,0,1} holder axis. The optional crprofile is a sequence of corner radius values to apply to the corresponding vertices of the profile (trailing zero values can be omitted).
Specifies the position and orientation of the holder geometry (mesh or extruded) using a 12 element matrix sequence. The matrix must be defined before any STLs to which it applies.
Specifies the spindle contact xyz offset from the holder origin. This is where the holder is attached to its parent. Default is (0,0,0).
Specifies the tool contact xyz offset from the holder origin and the tool abc orientation in degrees (a is rotation around the x-axis, b around the y-axis and c around the z-axis). This is where the tool (or child holder) is attached to the holder. Default is (0,0,0,0,0,0).
Common properties for all holders:
Specifies the units of measure for the holder (1:inch, 25.4:mm). Default units are current machine units.
Specifies the color of the holder, which must have previously been defined using the $FMSCOLR function.
Specifies the name of another holder to which the current one is mated.
Lastly, call $FMSHLD(END) to complete the holder definition.
When creating holders, all three forms of the $FMSHLD function (START, property, and END) always return the value 1.
The $FMSPCK Function
Returns the component ID of the pocket associated with tool number Returns: Numeric |
The $FMSPCK function returns the numeric component ID of the pocket associated with tool number n, or zero if there is no associated pocket.
The $FMSTOOL Function
Tool properties Returns: Numeric, String or Sequence |
There are four forms of the $FMSTOOL function. CLEAR clears all tool definitions from the tool table. RETURN obtains tool information. START-END creates new tool definitions. COPY creates a copy of an existing tool with a new id.
Clear tool table
This form of the $FMSTOOL function removes all tool definitions from the tool table. It always returns the value 1.
Get tool properties
This form of the $FMSTOOL function returns requested properties of a tool where tool is the tool number as defined in Virtual Machine and property-list is a string constant or variable defining a comma separated case insensitive list of properties to be returned. Returned tool properties can be either numeric values or strings. Multiple property values are returned as a sequence. Linear properties are returned in the current machine units.
The following tool properties can be queried:
property
Common tool properties
NAME
Tool name string, blank if none
TYPE
1:mill, 2:lathe, 3:probe, 4:additive
SUBTYPE
Value varies depending on TYPE
GL
Sequence of xyz gage lengths
GL.X
X axis gage length
GL.Y
Y axis gage length
GL.Z
Z axis gage length
HOLDER
Holder name string, blank if none
TCD
Sequence of zero or more Diameter compensation offsets
TCF
Sequence of zero or more Fixture compensation offsets
TCL
Sequence of zero or more Length compensation offsets
UNITS
Units of holder definition (informational) 1:inch, 25.4:mm
Mill tool properties
SUBTYPE
1:end-mill, 2:ball, 3:bull, 4:drill, 5:apt, 6:profile, 7:generic
D
Tool diameter
R
Tool radius (D/2)
L
Tool length
FL
Flute length
CR
Corner radius
BA
Bottom angle (degrees)
SA
Side angle (degrees)
BO
Body offset
N
Number of flutes or teeth
SL
Shank length
SD
Shank diameter
LEFT
1:left-hand, 0:unknown, -1:right-hand
RIGHT
1:right-hand, 0:unknown, -1:left-hand
USAGE
1:finishing, 2:semi-finishing, 3:roughing
Lathe tool properties
SUBTYPE
1:round, 2:trigon, 3:diamond, 4:symmetric, 5:thread, 6:groove, 7:profile, 8:generic
R
Inscribed circle radius
D
Inscribed circle diameter (R*2)
J
Joint radius
H
Insert height
SA
Clearance (side) angle (degrees)
N
Number of sides
CR
Corner radius
A
Internal angle (degrees)
TW
Tooth width
TH
Tooth height
TO
Tooth offset
TC
Tooth clearance
LEFT
1:left-hand, 0:unknown, -1:right-hand
RIGHT
1:right-hand, 0:unknown, -1:left-hand
USAGE
1:finishing, 2:semi-finishing, 3:roughing
Probe tool properties
SUBTYPE
1:straight, 2:star, 3:generic
R
Probe tip radius
D
Probe tip diameter (R*2)
SL
Stylus length
SD
Stylus diameter
H
Height of star component
W
Width of star component
Additive tool properties
SUBTYPE
1:profile, 2:generic
Create new tool
This form of the $FMSTOOL function provides the ability to create a new tool. To create a tool, first call $FMSTOOL(START,tool) where tool is a numeric constant or variable defining the tool number. Specify an optional pocket number if the tool is to be assigned to a specific tool pocket on the machine. On machines having multiple tool holding devices with duplicate pocket numbers, specify the pocket's toolaxis ID to uniquely identify it.
Next, call $FMSTOOL(property,value_list) once for each tool property to be defined, where the property name is specified using a string constant or variable containing the name of the property. Available properties and their parameter values are:
![]()
For milling tools:
Specifies a parametrically defined milling tool, where t is an integer constant or variable that defines the type of tool. The number of required APT cutter parameters shown in the image is dependent upon the tool type, as follows:
- 1:
End mill, requires 3 or 7 cutter parameters.
- 2:
Ball nose, requires 3 or 7 cutter parameters.
- 3:
Bull nose, requires 3 or 7 cutter parameters.
- 4:
Drill, requires 7 cutter parameters.
- 5:
APT, requires 7 cutter parameters.
- 6:
Profile, no cutter parameters. Requires a PROFILE (see below).
- 7:
Generic, no cutter parameters. Requires an STL or INSERT (see below).
Milling tool types 1 to 5 accept the following:
Specifies the flute length of the tool, measured from the tool tip to the tool top.
Specifies the relief to apply between the tool body and the tool diameter.
Specifies the color of the body portion of the tool, which must have previously been defined using the $FMSCOLR function.
Specifies the length and diameter of the shank portion of the tool. The length of the shank is measured with respect to the holder or spindle mount point.
Specifies the color of the shank portion of the tool, which must have previously been defined using the $FMSCOLR function.
Profile milling tools (type 6) accept the following:
Specifies a profile to use. The profile is a sequence containing the xy values of the profile to be swept around a {0,0,1} axis. The optional crprofile is a sequence of corner radius values to apply to the corresponding vertices of the profile (trailing zero values can be omitted). By default the profile is cutting.
Specifies that subsequent profiles define the cutting edge of the revolved tool.
Specifies that subsequent profiles define the non-cutting edge of the revolved tool.
Generic milling tools (type 7) accept the following:
Specifies a mesh to use. The filename is a string constant or variable specifying the STL file containing the mesh geometry.
Specifies a mesh to use. The id is an integer representing an existing lathe insert tool id.
Specifies a mesh repetitive instances around the tool axis of revolution. The count is an integer representing the number of instances of the mesh repeated around the tool. The angle is the offset angle of the first mesh instance.
Specifies the position and orientation of the insert geometry using a 12 element matrix sequence. The matrix must be defined before the STL.
Specifies the tool contact xyz offset from the mesh origin. This is the tool control point. Default is (0,0,0).
Specifies that subsequent meshes define the cutting mesh of the generic tool.
Specifies that subsequent meshes define the non-cutting mesh of the generic tool.
For lathe inserts:
Specifies a parametrically defined lathe tool insert, where type is an integer constant or variable that defines the type of insert. The number of required parameters is dependent upon the insert type, as follows:
- 1:
Round, requires ic, j, h and a.
- 2:
Trigon, requires ic, j, h, a, cr and t. n is ignored (always 3).
- 3:
Diamond, requires ic, j, h, a, cr and t. n is ignored (always 4).
- 4:
Symmetrical, requires ic, j, h, a, n and cr.
- 5:
Thread, requires all parameters.
- 6:
Groove, requires all parameters.
- 7:
Profile, no parameters. Requires a PROFILE (see below)
- 8:
Generic, no parameters. Requires an STL (see below).
The parameter names match those that can be found in the lathe tool builder dialog:
- ic:
Inscribed circle radius (i: Length for Groove insert)
- j:
Joint radius
- h:
Height
- a:
Clearance angle
- n:
Number of sides
- cr:
Corner radius
- t:
Internal angle
- tw:
Tooth width
- th:
Tooth height
- to:
Tooth offset
- tc:
Tooth clearance
Profile lathe inserts (type 7) accept the following:
Specifies a profile to use. The profile is a sequence containing the xy values of the insert profile to be extruded for the specified height. The optional crprofile is a sequence of corner radius values to apply to the corresponding vertices of the profile (trailing zero values can be omitted). The angle is the clearance angle along the side of the insert.
Specifies the tool contact xyz offset from the profile origin. This is where the insert is attached to the holder. Default is (0,0,0).
Generic lathe inserts (type 8) accept the following:
Specifies a mesh to use. The filename is a string constant or variable specifying the STL file containing the mesh geometry of the insert.
Specifies the position and orientation of the insert geometry using a 12 element matrix sequence. The matrix must be defined before the STL.
Specifies the tool contact xyz offset from the mesh origin. This is where the insert is attached to the holder. Default is (0,0,0).
For probe tools:
Specifies a probe tool, where type is an integer constant or variable that defines the type of probe. The number of required parameters is dependent upon the probe type, as follows:
- 1:
Straight, requires sl, sd, and r.
- 2:
Star, requires sl, sd, h, w and r.
The parameter names match those that can be found in the probe tool builder dialog:
- sl:
Stylus length
- sd:
Stylus diameter
- h:
Height
- w:
Width
- r:
Probe ball radius
Specifies the color of the body portion of the probe, which must have previously been defined using the $FMSCOLR function.
For additive tools:
Specifies an additive tool, where type is an integer constant or variable that defines the type of additive tool, as follows:
- 1:
Profile. Requires a PROFILE (see below)
- 2:
Generic. Requires an STL (see below).
Profile additive (type 1) accept the following:
Specifies a profile to use. The profile is a sequence containing the xy values of the profile to be swept around a {0,0,1} axis. The optional crprofile is a sequence of corner radius values to apply to the corresponding vertices of the profile (trailing zero values can be omitted). By default the profile is additive.
Specifies the tool contact xyz offset from the profile origin. This is the tool control point relative to the holder. Y is ignored for profile tool. Default is (0,0,0).
Specifies that subsequent profiles define the additive edge of the revolved tool. Only one additive profile is supported.
Specifies that subsequent profiles define the non-additive edge of the revolved tool.
Generic additive (type 2) accept the following:
Specified a mesh to use. The filename is a string constant or variable specifying the STL file containing the mesh geometry.
Specifies the position and orientation of the STL geometry using a 12 element matrix sequence. The matrix must be defined before the STL.
Specifies the tool contact xyz offset from the mesh origin. This is the tool control point. Default is (0,0,0).
Specifies that subsequent meshes define the additive mesh of the revolved tool. Only one additive mesh is supported.
Specifies that subsequent meshes define the non-additive mesh of the revolved tool.
Common properties for all tools:
Specifies the name of the tool.
Specifies the units of measure for the tool (1:inch, 25.4:mm). Default units are current machine units.
Specifies a left hand cutting tool or insert (ignored with probe tools).
Specifies a right hand cutting tool or insert (ignored with probe tools).
Specifies the intended use of the tool, which can be one of the following values: 0 for finishing (the default); 1 for semi-finishing; and 2 for roughing (ignored with probe tools).
Specifies the color of the cutting portion of the tool, insert or probe tip, which must have previously been defined using the $FMSCOLR function (ignored with probe tools).
Specifies the color to show on the in-process stock for cuts created with this tool. The red, green and blue parameters are values in the range 0-255. If a color is not defined, then VM will automatically assign one (ignored with probe tools).
Specifies the name of the holder to which the tool, insert or probe is mated.
Lastly, call $FMSTOOL(END) to complete the tool definition.
When creating tools, all three forms of the $FMSTOOL function (START, property, and END) always return the value 1.
Copy tool
This form of the $FMSTOOL function provides the ability to create a new tool by copying an existing tool, where tool is a numeric constant or variable referencing an existing tool number and copy is a numeric constant or variable defining the new tool number. Specify an optional pocket number if the tool is to be assigned to a specific tool pocket on the machine. On machines having multiple tool holding devices with duplicate pocket numbers, specify the pocket's toolaxis ID to uniquely identify it.
The COPY form of the $FMSTOOL function always returns the value 1.
