The following documentation describes the constants and functions which give the VB Script programmer access to Mastercam functionality. If you need to view documentation regarding the VB Script language itself, please refer to SCRIPT56.CHM in the ‘Help’ sub-directory of your Mastercam installation.
Links:
Constants (
Classes (
Functions (
///////////////////////////////////////////////////////////////////////////////
CONSTANTS
///////////////////////////////////////////////////////////////////////////////
Links:
Entity types
Entity ‘bit’ flags
Milling tool types
Drilling tool types
File Access modes
Others
//// Entity types
//Point:
mc_pointtype
//Line:
mc_linetype
// Arc:
mc_arctype
// Rectangle:
mc_recttype
//// Entity ‘bit’ flags
//Entity is ‘alive’ (not deleted)?:
mc_alive
//Entity is part of the system group?:
mc_group
//Entity is currently selected?:
mc_selected
//Entity is part of the system result?:
mc_result
//Entity is only temporary?:
mc_temporary
//Entity is blanked?
mc_blanked
//// Milling tool types
// tool has a flat end
mctool_flat
// tool has a spherical end
mctool_ball
// tool has a “bull-nose” (non-zero corner radius)
mctool_bull
//// Drilling tool types
// a center drill
mctool_centerdrill
// a spot drill
mctool_spotdrill
// a standard drill
mctool_drill
// a left handed tap
mctool_lhtap
// a right handed tap
mctool_rhtap
// a reaming tool
mctool_reamer
// a boring bar
mctool_boringbar
// a counterbore tool
mctool_counterbore
// a countersink tool
mctool_countersink
//// Others
// current system tolerance – two reals less than this close together are identical
mc_tol
// current chaining tolerace – chaining will jump gaps that are smaller than this
mc_chaintol
// SIM number
mc_simnumber
// is the current Mastercam session in Metric (millimeter) mode?
mc_metric
// toolpath operation was not successfully made
mcOPERATION_INVALID
// geometry creation was not successful
mcENTITY_INVALID
// Cutter Compensation Flags
mcCUTTER_COMP_OFF
mcCUTTER_COMP_LEFT
mcCUTTER_COMP_RIGHT
// Contour Corner Roll Flags
mcCUTTER_ROLL_NONE
mcCUTTER_ROLL_SHARP
mcCUTTER_ROLL_ALL
// Pocketing Style Flags
mcPOCKET_ZIGZAG
mcPOCKET_ONEWAY
mcPOCKET_CONSTOVERLAPSPIRAL
mcPOCKET_PARSPIRAL
mcPOCKET_PARSPIRAL_CLEANCORNERS
mcPOCKET_TRUESPIRAL
// -- MarkWindow Input
mcWINDOW_INSIDE
mcWINDOW_INSIDE_INTR
mcWINDOW_INTERSECT
mcWINDOW_OUT_INTR
mcWINDOW_OUT
// Entity Construction
mcCONSTRUCTION_COLOR_CURRENT
mcCONSTRUCTION_LEVEL_CURRENT
// message box returns
mcMSG_CANCEL
mcMSG_NO
mcMSG_YES
// chaining constants
mcCHAIN_UNCLEAR
mcCHAIN_CW
mcCHAIN_CCW
mcCHAIN_ALL_NUMBERED_LEVELS
mcCHAIN_ALL_NAMED_LEVELS
// file access modes
mcFILE_ACCESS_READ
mcFILE_ACCESS_WRITE
mcFILE_ACCESS_TEXT
mcFILE_ACCESS_BINARY
// colors
mcCOLOR_BLACK
mcCOLOR_DARKBLUE
mcCOLOR_GREEN
mcCOLOR_TEAL
mcCOLOR_DARKRED
mcCOLOR_PURPLE
mcCOLOR_BROWN
mcCOLOR_LIGHTGREY
mcCOLOR_DARKGREY
mcCOLOR_BLUE
mcCOLOR_LIGHTGREEN
mcCOLOR_LIGHTBLUE
mcCOLOR_RED
mcCOLOR_MAGENTA
mcCOLOR_YELLOW
mcCOLOR_WHITE
// clockwise/counterclockwise flags
mcCW_AND_CCW
mcCW
mcCCW
///////////////////////////////////////////////////////////////////////////////
CLASSES
///////////////////////////////////////////////////////////////////////////////
Links:
Point
Line
Arc
Rectangle
Leads
DepthCuts
//// Class to hold a Point's X, Y, Z co-ordinates
McPt
McPt.X = Point’s X co-ordinate
McPt.Y = Point’s Y co-ordinate
McPt.Z = Point’s Z co-ordinate
//// Class to hold a Line's endpoints X, Y, Z co-ordinates
McLn
McLn.X1 = Line’s startpoint X co-ordinate
McLn.Y1 = Line’s startpoint Y co-ordinate
McLn.Z1 = Line’s startpoint Z co-ordinate
McLn.X2 = Line’s endpoint X co-ordinate
McLn.Y2 = Line’s endpoint Y co-ordinate
McLn.Z2 = Line’s endpoint Z co-ordinate
//// Class to hold an arc's center point X,Y,Z co-ordinates, radius, and angles
McAr
McAr.X = Arc’s centerpoint X co-ordinate
McAr.Y = Arc’s centerpoint Y co-ordinate
McAr.Z = Arc’s centerpoint Z co-ordinate
McAr.R = Arc’s radius
McAr.SA = Arc’s start angle in degrees
McAr.SW = Arc’s sweep angle in degrees
McAr.View = Arc’s view number
//// Class to hold a Rectangle’s cornerpoints and Z co-ordinate
McRe
McRe.X1 = Rectangle’s startpoint X co-ordinate
McRe.Y1 = Rectangle’s startpoint Y co-ordinate
McRe.X2 = Rectangle’s endpoint X co-ordinate
McRe.Y2 = Rectangle’s endpoint Y co-ordinate
McRe.Z = Rectangle’s Z co-ordinate
//// Class to hold toolpath Lead-in and Lead-out information
McLeads
McLeads.Useline = Use a line for leading in/out
McLeads.LineLength = Length of lead in/out line
McLeads.LineTangent = Is the line Tangent or Perpendicular?
McLeads.LineRampHeight = Height of lead in/out Line (defining a ‘ramp’)
McLeads.Usearc = Use an arc for leading in/out
McLeads.ArcRadius = Radius of lead in/out arc
McLeads.ArcSweep = Angular sweep of lead in/out arc
McLeads.ArcHelixHeight = Height of lead in/out Arc (defining a helix)
//// Class to hold toolpath Depth Cut information
McDepthCuts
McDepthCuts.MaxStep = Maximum step down of roughing passes
McDepthCuts.FinalStep = Desired depth of final pass
///////////////////////////////////////////////////////////////////////////////
FUNCTIONS
///////////////////////////////////////////////////////////////////////////////
Links:
Script Debugging utilities
Prompt area message functions
Simple Input functions
Entity Prompt/Inquiries functions
Chaining functions
Database Search functions
Entity Creation functions
Excel File Read/Write functions
Utility functions
Toolpath Generation functions
//// Script debugging utilities
// pop up a window with a string and an integer value
Void ShowValue(
String, (Input: the string to place before integer value)
Integer (Input: the integer value to display)
)
// pop up a window with a string and a real (or double prec.) value
Void ShowDouble(
String, (Input: the string to place before real value)
Real (Input: the real value to display)
)
// pop up a window with a string
Void ShowString(
String (Input: the string to display)
)
//// Prompt area message functions |