Create and Modify Tool Change
To create and modify a tool change.
- /* Create a Tool Change under the program */
Set MToolChange= program.AppendOperation("ToolChange", false)
- /* Change the name of the created Tool Change */
MToolChange.Name = "My Tool Change"
- /* Affect a tool */
MToolChange.SetTool(tool, false) - /* Get the tool or assembly associated
*/
Set MTool = MToolChange.GetTool()
MToolChange.GetToolAndAssembly(MTool,
MToolAssembly) - /* Modify attribute of Tool Change
*/
MToolChange.MFG_PPWORDS = "My PPWORDS"
MToolChange.MfgCmdSequenceNum = 6
Create and Modify PP Instruction
To create and modify a PP Instruction.
- /* Create a PPInstruction */
Set MPPInstruction = program.AppendOperation("PPInstruction", false)
- /* Modify the PPInstruction */
MPPInstruction.MFG_PPWORDS = "My PP Words"
Create and Modify Manufacturing Operations
To create and modify manufacturing operations.
- /* Create a Sweeping */
Set SweepingOp = program.AppendOperation("M3xSweeping", false)
- /* Change the name */
SweepingOp.Name = “Operation finition”
- /* Modify the operation */
SweepingOp.MfgMachiningTolerance = 10 - /* Create a copy transformation */
Set CopyOrderOpe= program.AppendOperation("MfgCopyOrder", false) - /* Change the name */
CopyOrderOpe.Name = “Replication”
- /* Set the list of operation */
CopyOrderOpe.SetListOfRefMOs(ListOperation) - /* Modify attributes */
CopyOrderOpe.MfgNbOfCopy = 1
CopyOrderOpe.MfgTransformationType= MfgScaling
CopyOrderOpe.MfgScaleFact= 2.0
Manage Machining Process
instantiation
To manage machining process instantiation (Same method than CAA).
- /* Create a Tool Change under the program */
Set MMachiningProcess = NCMTemplate.CreateMachiningProcess()
- /* Insert new operation */
Set MOperation =MMachiningProcess.InsertActivity("Drilling", NULL)
MOperation.SetToolRequirement(NULL)
- /* Insert new operation */
Set MOperation =MMachiningProcess.InsertActivity("Tapping", NULL)
MOperation.SetToolRequirement(NULL)
- /* Instantiate the machining process after an operation from ListFeatures */
MMachiningProcess.Instantiate(MPPInstruction, ListFeatures) - /* Get the operation instantiated */
MMachiningProcess.GetInstantiatedActivities(listInstantiatedActivities, listToolsList)
Manage Macro
To manage macros.
- /* Get Macro */
MOperation.GetMacroMotion("MfgApproachMacro", MacroMotions)
- /* Disable Macro */
MacroMotions.SetInactiveMacro()
- /* Enable Macro */
MacroMotions.SetActiveMacro() /* Check State Macro */
MacroMotions.IsActive() /* Get Macro motion */
MacroMotions.GetMacroMotion(MacroMotion, 1, false)
/* Insert elementary Macro */
MacroMotion.InsertElementaryMotion2(1, "MfgMacroPPWord", 1)
/* Get number of elementary Macro */
MacroMotion.GetNumberOfElementaryMotions() /* Get elementary macro motion */ Set MacroElementaryMotion = MacroMotion.GetElementaryMotion(1) /* Insert elementary macro motion */
MacroMotion.InsertElementaryMotion(2, MacroElementaryMotion, 1)
Geometry
Using geometry.
/* Get geometry */ MFeature.AddGeometry (“Body”, geom) /* Set geometry */ MFeature.GetGeometricElements(“Checks”, listGeometries) /* Remove geometry */ MFeature.RemoveGeometries (“Checks”) /* Create Drilling operation */ Set MOperation = program.AppendOperation("Drilling", false)
Set MFeature = CreateMachiningFeature("MfgHole")
MOperation.SetFeature(MFeature, NULL)
/* Set and remove geometry */ MFeature.AddGeometry("Checks", Plane, PlaneProduct, 0, 0)
MFeature.GetGeometricElements("Checks", listGeometries, false, false)
MFeature.RemoveGeometries("Checks")
/* Set geometry to operations with a machinable area feature (profile contouring, pocketing)*/ Set MPCOperation = program.AppendOperation("ProfileContouring", false)
Set MPCFeature = CreateMachiningFeature("MfgProfileContouringFeature")
MPCOperation.SetFeature(MFeature, NULL)
Let M2DMAFeature(Mfg2DMAFeature)
Set M2DMAFeature = CreateMachiningFeature("Mfg2DMAFeature")
M2DMAFeature.AddGeometry("MfgContour", Edge1, PlaneProduct,0,0)
M2DMAFeature.AddGeometry("PartBottom", Face1, PlaneProduct,0,0)
M2DMAFeature.AddGeometry("RelimitingPlane", Face2, PlaneProduct,0,0)
MPCFeature.SetMachinableFeature(M2DMAFeature)
Pattern
Using pattern.
/* Add new point to drilling operation */ MOperation.GetPatternUsage(MPattern)
MPattern.AddPosition(point, product)
MPattern.SetLocalToolAxis(1, vector)
Tool Axis
Point to Point
Using point to point.
/* Add and remove a goto point to the point to point operation */ MOperation.GetFeatureInContext(MPtToPtFeature)
MPtToPtFeature.GetSites(ListSites)
MPtToPtFeature.AddPosition(point, 1)
MPtToPtFeature.RemovePosition(1)
Probing Multi Point
Using probing multi point.
/* Add a new point to probe */ MOperation.GetFeatureInContext(MProbingFeature)
MProbingFeature.AddGeometry("ProbingMultiPointsElement", point)
MProbingFeature.AddGeometry("ProbingMultiPointsNormal", direction)
|