/// <summary> Creates the tool. </summary> /// /// <returns> The new tool. </returns> internal static EndMillFlatTool CreateTool() { // Define a new tool var endMill = new EndMillFlatTool(.375, 0, 3, 3, 3, 4, 2, 3, "0.375 Flat End Mill") { Coolant = CoolantMode.COOL_FLOOD, Flutes = 2, MfgToolCode = "My Custom Code 1234", PlungeFeed = 12, RetractFeed = 12 }; // Commit the tool to the database return(!endMill.Commit() ? null : endMill); }
/// <summary> Creates contour operation. </summary> /// /// <param name="tool"> The tool. </param> /// <param name="chains"> The chains. </param> /// /// <returns> The new contour operation. </returns> internal static ContourOperation CreateContourOperation(EndMillFlatTool tool, Chain[] chains) { // Throw a contour around the chains var contourOp = new ContourOperation { OperationTool = tool, CutterComp = { Direction = CutterCompDir.CutterCompLeft, RollCorners = CutterCompRoll.CutterCompRollAll }, Linking = { Depth = -.25, Retract = 1, RetractOn = true, TopStock = 0 }, SpindleSpeed = 2500, FeedRate = 12, NCIName = "Contour #1", Name = "Contour operation created via API" }; ChainManager.StartChainAtLongest(chains); ChainManager.SortChains(chains, ChainManager.SortType.Area, ChainManager.SortOrder.Ascending); contourOp.SetChainArray(chains); if (!contourOp.Commit()) { return(null); } contourOp.Regenerate(); return(contourOp); }