Академический Документы
Профессиональный Документы
Культура Документы
CONSTANTS
////////////////////////////////////////////////////////////////////////////////////////////////////////
//Point:
mc_pointtype
//Line:
mc_linetype
// Arc:
mc_arctype
// Rectangle:
mc_recttype
// 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
// 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
// -- MarkWindow Input
mcWINDOW_INSIDE
mcWINDOW_INSIDE_INTR
mcWINDOW_INTERSECT
mcWINDOW_OUT_INTR
mcWINDOW_OUT
// Entity Construction
mcCONSTRUCTION_COLOR_CURRENT
mcCONSTRUCTION_LEVEL_CURRENT
// chaining constants
mcCHAIN_UNCLEAR
mcCHAIN_CW
mcCHAIN_CCW
mcCHAIN_ALL_NUMBERED_LEVELS
mcCHAIN_ALL_NAMED_LEVELS
// 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
// operation results
mcOPERATION_INVALID
////////////////////////////////////////////////////////////////////////////////////////////////////////
CLASSES
////////////////////////////////////////////////////////////////////////////////////////////////////////
//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 start & sweep 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
////////////////////////////////////////////////////////////////////////////////////////////////////////
FUNCTIONS
////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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)
)
// erase the Mastercam prompt area at the bottom of the Mastercam window
Void ClearPromptLines()
// ask for an angle in degrees – note that the passed value will be the default value
Bool askAngle(
Real (Input/Output: the angle)
)
// ask for an integer number – note that the passed value will be the default value
Bool askNumber(
String, (Input: Prompt area text)
Integer, (Input: Lower bound on number)
Integer, (Input: Upper bound on number)
Integer (Input/Output: the number)
)
// ask for a real (or double prec.) number – note that the passed value will be the default
value
Bool askValue(
String, (Input: Prompt area text)
Real, (Input: Lower bound on number)
Real, (Input: Upper bound on number)
Real (Input/Output: the real number)
)
// ask for a color – note that the passed value will be the default value
Bool askColor(
Integer (Input/Output: the color number)
)
// ask for a level – note that the passed value will be the default value
Bool askLevel(
Integer (Input/Output: the level number)
)
// make the 1st entity on the 1st chain the current active entity
Bool RewindChains()
// make the next entity on the current chain the current active entity
Bool MoveForwardOnChain()
// make the 1st entity on the next chain the current active entity
Bool MoveToNextChain()
// get the first or next entity in the database and make it the current active entity
Bool NextDBSearch()
// import a DXF (or DWG) file into the current Mastercam session
Void ReadDXF(
String (Input: the file name)
)
Void SetPlaneNormal(
Real, (Input: X co-ordinate of tool plane normal vector)
Real, (Input: Y co-ordinate of tool plane normal vector)
Real (Input: Z co-ordinate of tool plane normal vector)
)
// display the point manager with the points of an existing drill operation
Void RunPointManager(
Integer (Input: operation ID #)
)
// make a Contour operation using the current chains and some tool dimensions
// if you don’t call one or more of the depth/plane initialization functions, reasonable
// defaults will be used
// this function returns an operation ID # or mcOPERATION_INVALID
Integer MakeContour(
String, (Input: operation comment)
Real, (Input: tool diameter – or use 0 and just search on tool # & rad)
Real, (Input: tool corner radius if tool type is mcTOOL_BULL
- or use 0 and just search on tool dia & #)
Integer, (Input: tool number – or use 0 and just search on tool dia & rad)
Integer, (Input: see Mill tool types)
Integer (Input: see Cutter compensation flags above)
)
// make a Contour operation using the current chains and a specific tool ID
// if you don’t call one or more of the depth/plane initialization functions, reasonable
// defaults will be used
// this function returns an operation ID # or mcOPERATION_INVALID
Integer MakeContourWithKnownTool(
String, (Input: operation comment)
Integer (Input: tool ID)
Integer (Input: see Cutter compensation flags above)
)
// make a Pocket operation using the current chains and some tool dimensions
// if you don’t call one or more of the depth/plane initialization functions, reasonable
// defaults will be used
// this function returns an operation ID # or mcOPERATION_INVALID
Integer MakePocket(
String, (Input: operation comment)
Real, (Input: tool diameter – or use 0 and just search on tool # & rad)
Real, (Input: tool corner radius if tool type is mcTOOL_BULL
- or use 0 and just search on tool dia & #)
Integer, (Input: tool number – or use 0 and just search on tool dia & rad)
Integer, (Input: see Mill tool types)
Integer (Input: see {Pocket styles)
Real, (Input: step over value)
)
// make a Pocket operation using the current chains and a specific tool ID
// if you don’t call one or more of the depth/plane initialization functions, reasonable
// defaults will be used
// this function returns an operation ID # or mcOPERATION_INVALID
Integer MakePocketWithKnownTool(
String, (Input: operation comment)
Integer (Input: tool ID)
Integer (Input: see Pocket styles)
Real, (Input: step over value)
)
// to add a point to the drill point list, specifying a drill depth for this point
Void AddDrillPointToDepth (
Real, (Input: X co-ordinate of point to add to current drill point list)
Real, (Input: X co-ordinate of point to add to current drill point list)
Real, (Input: X co-ordinate of point to add to current drill point list)
Real (Input: depth to drill to)
)
// set the drilling jump height for any points to added after this call
Void SetDrillJumpHeight(
Real (Input: Drilling “jump” height)
)
// set the drilling break through depth for any points to added after this call
Void SetDrillBreakThrough (
Real (Input: Drilling break through distance)
)
// make a Drill operation using the current point(s) and some tool dimensions
// if you don’t call one or more of the depth/plane initialization functions, reasonable
// defaults will be used
// this function returns an operation ID # or mcOPERATION_INVALID
Integer MakeDrill(
String, (Input: operation comment)
Real, (Input: tool diameter – or use 0 and just search on tool # & tipangle)
Real, (Input: tool tip angle)
Integer, (Input: tool number – or use 0 and just search on tool dia & tipangle)
Integer (Input: See Drilling tool types above)
)
// make a Drill operation using the current point(s) and a known tool ID
// if you don’t call one or more of the depth/plane initialization functions, reasonable
// defaults will be used
// this function returns an operation ID # or mcOPERATION_INVALID
Integer MakeDrillWithKnownTool(
String, (Input: operation comment)
Integer (Input: tool ID)
)
// let the user define a new tool with a dialog
// this function returns a tool ID #
Integer DefineNewTool(
Bool drillTool (Input: will it be a drilling tool?)
)
// get the type of a tool (see the milling and drilling tool types)
Integer GetToolType(
Integer (Input: tool ID #)
)