Escolar Documentos
Profissional Documentos
Cultura Documentos
Links:
Constants <#Constants>
Classes <#Classes>
Functions <#Functions>
*///////////////////////////////////////////////////////////////////////////////*
*CONSTANTS*
*///////////////////////////////////////////////////////////////////////////////*
* *
Links:
Operation <#Operation>
View <#View>
Others <#Others>
* *
*mc_appmodule*
*mc_applevel*
*mc_appversion*
*mcMILL_EXE *
*mcLATHE_EXE*
*mcWIRE_EXE *
*mcDESIGN_EXE*
*mcDRAFT_EXE *
*mcROUTER_EXE *
*mcAPPLEVEL_ENTRY*
*mcAPPLEVEL_1 *
*mcAPPLEVEL_2 *
*mcAPPLEVEL_3 *
* *
//Point:
*mc_pointtype*
//Line:
*mc_linetype*
// Arc:
*mc_arctype*
// Rectangle:
*mc_recttype*
*mc_alive*
*mc_group*
*mc_selected*
*mc_result*
*mc_temporary*
//Entity is blanked?
*mc_blanked*
* *
*mctool_flat*
*mctool_ball*
*mctool_bull*
*mctool_centerdrill*
// a spot drill
*mctool_spotdrill*
// a standard drill
*mctool_drill*
*mctool_lhtap*
*mctool_rhtap*
// a reaming tool
*mctool_reamer*
// a boring bar
*mctool_boringbar*
*mctool_counterbore*
*mctool_countersink*
* *
*mcOPERATION_INVALID*
*mcOPERATION_CONTOUR *
*mcOPERATION_DRILL *
*mcOPERATION_POCKET *
*mcOPERATION_ROUTER_POCK *
*mcOPERATION_ROUTER_CUTOFF *
*mcOPERATION_ROUTER_BLOCK_DRILL *
*mcOPERATION_SRF_RGH_PARALLEL *
*mcOPERATION_SRF_RGH_RADIAL *
*mcOPERATION_SRF_RGH_PROJECT *
*mcOPERATION_SRF_RGH_FLOWLINE *
*mcOPERATION_SRF_RGH_CONTOUR *
*mcOPERATION_SRF_RGH_POCKET *
*mcOPERATION_SRF_FIN_PARALLEL *
*mcOPERATION_SRF_FIN_RADIAL *
*mcOPERATION_SRF_FIN_PROJECT *
*mcOPERATION_SRF_FIN_FLOWLINE *
*mcOPERATION_SRF_FIN_CONTOUR *
*// *5-Axis drill* *operation type**
*mcOPERATION_5AX_DRILL *
*mcOPERATION_5AX_CURVE *
*mcOPERATION_SRF_FIN_PENCIL *
*mcOPERATION_SRF_FIN_LEFTOVER *
*mcOPERATION_SRF_FIN_STEEP *
*mcOPERATION_SRF_FIN_SHALLOW *
*mcOPERATION_SRF_FIN_CONSCALOP *
*mcOPERATION_SRF_RGH_PLUNGE *
*mcOPERATION_SRF_FLOW5AX *
*mcOPERATION_SRF_4AX *
*mcOPERATION_MERGED_NCI *
*mcOPERATION_5AX_SWARF *
*mcOPERATION_5AX_ROLLDIE *
*mcOPERATION_FACE *
* *
*//// View *
*mcVIEW_TOP *
*mcVIEW_FRONT *
*mcVIEW_BACK *
*mcVIEW_BOTTOM *
*mcVIEW_SIDE** *
*mcVIEW_LSIDE *
*mcVIEW_ISO *
// x plus, y plus
*mcSORT_XpYp*
// x plus, y minus
*mcSORT_XpYm*
// x minus, y plus
*mcSORT_XmYp*
// x minus, y minus
*mcSORT_XmYm*
*mcSORT_XzpYp*
*mcSORT_XzpYm*
*mcSORT_XzmYp*
*mcSORT_XzmYm*
// y plus, x plus
*mcSORT_YpXp*
// y plus, x minus
*mcSORT_YpXm*
// y minus, x plus
*mcSORT_YmXp*
// y minus, x minus
*mcSORT_YmXm*
*mcSORT_YzpXp*
*mcSORT_YzpXm*
*mcSORT_YzmXp*
*mcSORT_YzmXm*
*mcSORT_PP*
*mcSORT_INVALID*
*//// 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*
*mcENTITY_INVALID*
* *
*mcCUTTER_COMP_OFF *
*mcCUTTER_COMP_LEFT *
*mcCUTTER_COMP_RIGHT *
* *
*mcCUTTER_ROLL_NONE*
*mcCUTTER_ROLL_SHARP*
*mcCUTTER_ROLL_ALL*
* *
*mcPOCKET_ZIGZAG*
*mcPOCKET_ONEWAY*
*mcPOCKET_CONSTOVERLAPSPIRAL*
*mcPOCKET_PARSPIRAL*
*mcPOCKET_PARSPIRAL_CLEANCORNERS*
*mcPOCKET_TRUESPIRAL*
* *
*mcWINDOW_INSIDE*
*mcWINDOW_INSIDE_INTR*
*mcWINDOW_INTERSECT*
*mcWINDOW_OUT_INTR*
*mcWINDOW_OUT *
* *
*//* Entity Construction
*mcCONSTRUCTION_COLOR_CURRENT*
*mcCONSTRUCTION_LEVEL_CURRENT*
* *
*mcMSG_CANCEL *
*mcMSG_NO*
*mcMSG_YES*
* *
*mcCHAIN_UNCLEAR*
*mcCHAIN_CW*
*mcCHAIN_CCW*
*mcCHAIN_ALL_NUMBERED_LEVELS*
*mcCHAIN_ALL_NAMED_LEVELS*
* *
*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*
* *
*// *linestyles
*mcLINESTYLE_SOLID*
*mcLINESTYLE_HIDDEN*
*mcLINESTYLE_CENTER*
*mcLINESTYLE_PHANTOM*
*mcLINESTYLE_ZBREAK*
* *
*// *pointstyles
*mcPOINTSTYLE_3DSTAR*
*mcPOINTSTYLE_DOT*
*mcPOINTSTYLE_CROSS*
*mcPOINTSTYLE_X*
*mcPOINTSTYLE_CIRCLE*
*mcPOINTSTYLE_SQUARE*
* *
*mcCW_AND_CCW*
*mcCW***
*mcCCW***
* *
*
*
* *
*///////////////////////////////////////////////////////////////////////////////*
*CLASSES*
*///////////////////////////////////////////////////////////////////////////////*
* *
Links:
Point <#McPt>
Line <#mcLn>
Arc <#McAr>
Rectangle <#McRe>
Leads <#McLeads>
DepthCuts <#McDepthCuts>
Overrides <#McOverride>
McPt
*McLn*
McAr
*McRe*
*McLeads*
*McDepthCuts*
*McOverride*
*///////////////////////////////////////////////////////////////////////////////*
*FUNCTIONS*
*///////////////////////////////////////////////////////////////////////////////*
* *
Links:
Script Debugging utilities <#Debugging>
* *
* *
Void *ShowValue*(
// pop up a window with a string and a real (or double prec.) value
Void *ShowDouble*(
// erase the Mastercam prompt area at the bottom of the Mastercam window
Void *ClearPromptLines*()
Void *ClearMenu*()
Void *ClearMenuAndPrompts*()
Void *WriteString*(
Void *WriteNumber*(
Void *WriteValue*(
)
*//// Simple Input functions *
Bool *askPoint*(
// ask for an angle in degrees � note that the passed value will be the
default value
Bool *askAngle*(
// ask for an integer number � note that the passed value will be the
default value
Bool *askNumber*(
// ask for a real (or double prec.) number � note that the passed value
will be the default value
Bool *askValue*(
)
// ask for a text string
String *askString*(
// ask for a color � note that the passed value will be the default value
Bool *askColor*(
// ask for a level � note that the passed value will be the default value
Bool *askLevel*(
Integer *askYesNo*(
Integer *askYesNoCancel*
Bool *AskForEntity*(
Bool *SetEntityFromEptr*(
// get the eptr of the current active entity (see colors <#Colors> above)
Integer *GetEntityEptr*()
Integer *GetEntityType*()
Integer *GetEntityColor*()
Void *SetEntityColor*(integer)
Integer *GetEntityLevel*()
Void *SetEntityLevel*(integer)
// get the style of the current active entity (see linestyles <#Styles>
above)
Integer *GetEntityStyle*()
Void *SetEntityStyle*(integer)
Integer *GetEntityBits*()
Bool *GetPointData*(
Bool *GetLineData*(
Bool *GetArcData*(
Bool *GetRectangleData*(
Void *UnselectEntity*()
Bool *MarkWindow*(
Void *SelectAll*()
Void *UnselectAll*()
Void *FitToChains*(
Void *FitToCorners*(
)
// Delete the specified entity
Bool *DeleteEntity*(
Bool *DeleteAllSelectedEntities*( )
// make the 1st entity on the 1st chain the current active entity
Bool *AskForChain*(
// 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*()
Void *FreeChains*()
Bool *GetChainFromFile*(
String, (Input: file name)
Bool (Input: use input string as a default and prompt for a file)
Bool *ChainAll*(
// return false if the last chain had been un-linked � i.e. there is no
current chain
Bool *UnlinkCurrentChain*()
Integer *IsChainClockwise*()
Bool *IsChainClosed*()
Bool *IsChainFlat*()
Real *FlatChainDepth*()
// if the current chain is flat, get it�s view number
Integer *FlatChainViewNumber*()
Void *ReverseChain*()
Bool *StartDBSearch*(
// get the first or next entity in the database and make it the current
active entity
Bool *NextDBSearch*()
Integer *CreatePoint*(
)
// create a Mastercam Line given an McLn class
Integer *CreateLine*(
Integer *CreateArc*(
Integer *CreateRectangle*(
Integer *CreateRectangleWithFillets*(
Void *MakeFilletFromTwoCurves*(
Void *MakeFilletFromChain*(
Bool *Rotate(*
Bool *Mirror(*
Bool *Scale(*
Bool *Translate(*
Bool *OpenExcelFile*(
Void *CloseExcelFile*()
Void *SaveExcelFile*(
Void *WriteExcelString*(
)
// write an integer string to an excel file cell
Void *WriteExcelNumber*(
Void *WriteExcelValue*(
Bool *AskExcelString*(
Bool *AskExcelNumber*(
Bool *AskExcelValue*(
)
*//// Utility functions *
Bool *AskForFileName*(
String *GetCurrentFileName*()
Void *SetCurrentFileName*(
String *GetPath*()
String *GetPathOfThisScript*()
String *GetPathFromExtension*(
Void *RepaintScreen*(
Bool (input: fit the screen to it�s contents?)
String *GetLevelName*(
Void *SetLevelName*(
Integer *GetLevelNumberFromName*(
Bool *SetLevelByName* (
Bool *SetLevelByNumber* (
)
// set the named level visible by entering its name
Bool *SetLevelVisibleByName* (
Bool *SetLevelVisibleByNumber* (
// import a DXF (or DWG) file into the current Mastercam session
Bool *ReadDXF*(
Bool *WriteDXF*(
Bool *WriteIGES*(
// Import ANY file type (IGES, STEP, DWG, DXF, Pro/E, Inventor, etc)
Bool *ImportFile*(
String (Input: the file name)
Bool *ImportNCI*(
Bool *SaveMC*(
Bool (Input: save the current screen image inside the file?)
Bool *SaveMCAs*(
Bool (Input: save the current screen image inside the file?)
Bool *OpenMC*(
String (Input: the path and name of the Mastercam file name)
Bool *MergeMC*(
String (Input: the path and name of the Mastercam file name)
)
// reinitialize the database and/or the OpMgr so it�s empty
Void *NewMC*(
Void *ShellAndWait*(
Void *EditFile*(
// Run almost any Mastercam command - this gives access to every function
Void *RunMastercamCommand*(
Void *RunMastercamChook*(
Bool *DoMetafile*(
)
// create a bitmap from the mc9 file
Bool *DoBitmapfile*(
Bool *MakeNestedSheetBMP*(
Integer *GetNestedSheetCount*( )
Integer *GetGViewNumber*(void)
// set the current view to a new number & repaint the screen
Void *SetGViewNumber*(
Integer *GetCPlaneNumber*(void)
Void *SetCPlaneNumber*(
)
// get the current tool plane view number
Integer *GetTPlaneNumber*(void)
Void *SetTPlaneNumber*(
// get the current construction plane & tool plane to the graphics view
flag
// set the current construction plane & tool plane to the graphics view flag
Void *SetCPlaneEqualGView *(
Bool *AddCurrentEntToGroup*(
Bool *RemoveCurrentEntFromGroup*(
Bool) (Input: if this is the last entity in the group, delete the group)
Void *CreateGroup*();
Bool *SetCurrentGroupFromName(*
Bool *SetCurrentGroupFromNumber(*
Bool *SetActiveMachine(*
String ) (Input: machine definition name)
BSTR *GetActiveMachine()*
Bool *ChangeMachineType(** *
Integer *GetBackGroundColor*()
Void *SetBackGroundColor*(integer)
// Formats the real (or double prec.) to the precision specified and
returns a string
BSTR *FormatValue*(
Void *InitParameters*()
Void *UpdateOperationParameters*(
Void *SetClearancePlane*(
Void *SetRetractPlane*(
Void *SetTopOfStock*(
Void *SetDepth*(
Void *SetPlaneNormal*(
Void *SetEntry*(
Void *SetExit*(
Void *SetDepthCuts*(
Bool *RegenOp*(
)
// display the chain manager with the chains of an existing operation
Void *RunChainManager*(
// display the point manager with the points of an existing drill operation
Void *RunPointManager*(
Void *EditOperationParameters*(
Void *EditOperationGeometry*(
String *GetToolLibraryName*()
Void *SetToolLibraryName*(
)
// get the name of the current lathe tool library
String *GetLatheToolLibraryName*()
Void *SetLatheToolLibraryName*(
String *GetBlockDrillLibraryName*()
Void *SetBlockDrillLibraryName*(
String *GetPostName*()
Void *SetPostName*(
Bool *RunPost*(
// run all the operations in the current file through the post-processor
void *RunPostAll*(
// make a Contour operation using the current chains and some tool
dimensions
Integer *MakeContour*(
Integer, (Input: tool number � or use 0 and just search on tool dia & rad)
// 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
Integer *MakeContourWithKnownTool*(
// make a Pocket operation using the current chains and some tool dimensions
Integer *MakePocket*(
Integer, (Input: tool number � or use 0 and just search on tool dia & rad)
// 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
Integer *MakePocketWithKnownTool*(
Void *AddDrillPoint* (
// to add a point to the drill point list, specifying a drill depth for
this point
Void *AddDrillPointToDepth* (
Void *ZeroPts*()
// set the drilling jump height for any points to added after this call
Void *SetDrillJumpHeight*(
// set the drilling break through depth for any points to added after
this call
Void *SetDrillBreakThrough* (
// set the drilling sort method for drilling and block drilling operations
Void *SetDrillSortMethod* (
// Get the drilling sort method from the drilling and block drilling
operations in a file
// This function returns the drill sort method See Drill sort methods
<#Sort> above or *mcSORT_INVALID*
Integer *GetDrillSortMethod* (
int *GetOperationTypeFromName* (
// make a Drill operation using the current point(s) and some tool
dimensions
Integer *MakeDrill*(
Integer, (Input: tool number � or use 0 and just search on tool dia &
tipangle)
)
// make a Drill operation using the current point(s) and a known tool ID
Integer *MakeDrillWithKnownTool*(
// make a �Block Drill� operation using the current point(s) and current
Integer *MakeBlockDrill*(
Integer *DefineNewTool*(
Void *EditTool*(
Real *GetToolDiameter*(
Real *GetToolCornerRadius*(
Integer *GetToolNumber*(
// get the type of a tool (see the milling <#MillTools> and drilling
<#DrillTools> tool types)
Integer *GetToolType*(
BSTR *GetToolComment*(
Real *GetToolLength*(
Real *GetToolFluteLength*(
Integer (Input: tool number)
Integer *GetToolLengthOffsetNumber*(
Integer *GetToolDiameterOffsetNumber*(
BSTR *GetToolName*(
Stringr *GetJobSetupMaterial*( )
Real *GetJobSetupStockSizeX*( )
Real *GetJobSetupStockSizeY*( )
Real *GetJobSetupStockSizeZ*( )
// get the job setup stock origin x dimension
Real *GetJobSetupStockOriginX*( )
Real *GetJobSetupStockOriginY*( )
Real *GetJobSetupStockOriginZ*( )
// get the number of operations in the currently open MC9 file or from
Integer *GetOperationCount *(
// get the name of the 1^st operation in the currently open MC9 file or from
String *GetFirstOperationName*(
// get the name of the next operation from the currently open MC9 file
or from
String *GetNextOperationName*()
// import an operation by name and apply it to the currently selected
points or chains
Integer *MakeOperationFromName *(
// get the ID number of the 1^st operation in the currently open MC9
file or from
Integer *GetFirstOperationID*(
// get the ID number of the next operation in the currently open MC9
file or from
Integer *GetNextOperationID*(void)
Integer *GetContourOperationSideFromName*(
Bool *SetContourOperationSideFromName*(
Integer *GetContourOperationSideFromID*(
Bool *SetContourOperationSideFromID*(
Integer *MakeOperationFromID *(
// get the name of an operation in the currently open MC9 file or from
String *GetOperationNameFromID*(
integer *GetOperationTypeFromName* (
integer *GetOperationTypeFromID* (
integer *GetOperationGroupFromID* (
bool S*etOperationGroupFromID* (
bool *GetOperationToolDisplayFromID* (
bool S*etOperationToolDisplayFromID* (
bool *GetOperationLockedFromID* (
bool S*etOperationLockedFromID* (
)
// get the operation posting flag from the id of the operation
bool *GetOperationPostingFromID* (
bool S*etOperationPostingFromID* (
bool *GetOperationDirtyFromID* (
bool S*etOperationDirtyFromID* (
bool *GetOperationSelectedFromID* (
bool S*etOperationSelectedFromID* (
integer *GetOperationIDFromSheet*(
integer *GetToolNumberFromOperationID* (
String ( Input: name of external MC9 or OP9 file containing toolpath
operations )
// get the nci file name and path from the supplied id of the operation
string *GetNciNameFromOperationID* (
Bool *SetNciNameFromOperationID* (
// get the minimum z value from nci of the supplied id of the operation
Real *GetNciMinZFromOperationID* (
// get the maximum z value from nci of the supplied id of the operation
Real *GetNciMaxZFromOperationID* (
)
Bool *MillToolExists*(
search))
in the search))
search))
long *GetMillToolPtr*(
search))
in the search))
search))
Bool *DrillToolExists*(
search))
in the search))
search))
long *GetDrillToolPtr*(
search))
in the search))
search))
Bool *DoNest*(
(see NESTING_EXAMPLE.VBS))