Esempio n. 1
0
        private static void AllToolsToFile_Debug(FeatureCAM.FMDocument doc)
        {
            string all_tools = "";
            List <FeatureCAM.FMBoringBar>    bbars   = new List <FeatureCAM.FMBoringBar>();
            List <FeatureCAM.FMChamferMill>  cmills  = new List <FeatureCAM.FMChamferMill>();
            List <FeatureCAM.FMCounterBore>  cbores  = new List <FeatureCAM.FMCounterBore>();
            List <FeatureCAM.FMCounterSink>  csinks  = new List <FeatureCAM.FMCounterSink>();
            List <FeatureCAM.FMEndMill>      emills  = new List <FeatureCAM.FMEndMill>();
            List <FeatureCAM.FMFaceMill>     fmills  = new List <FeatureCAM.FMFaceMill>();
            List <FeatureCAM.FMPlungeMill>   pmills  = new List <FeatureCAM.FMPlungeMill>();
            List <FeatureCAM.FMRoundingMill> rmills  = new List <FeatureCAM.FMRoundingMill>();
            List <FeatureCAM.FMSideMill>     smills  = new List <FeatureCAM.FMSideMill>();
            List <FeatureCAM.FMSpotDrill>    sdrills = new List <FeatureCAM.FMSpotDrill>();
            List <FeatureCAM.FMTap>          taps    = new List <FeatureCAM.FMTap>();
            List <FeatureCAM.FMThreadMill>   thmills = new List <FeatureCAM.FMThreadMill>();
            List <FeatureCAM.FMTwistDrill>   tdrills = new List <FeatureCAM.FMTwistDrill>();

            foreach (FeatureCAM.FMToolCrib crib in doc.ToolCribs)
            {
                foreach (FeatureCAM.FMBoringBar tool in crib.BoringBars)
                {
                    bbars.Add(tool);
                }
                foreach (FeatureCAM.FMChamferMill tool in crib.ChamferMills)
                {
                    cmills.Add(tool);
                }
                foreach (FeatureCAM.FMCounterBore tool in crib.CounterBores)
                {
                    cbores.Add(tool);
                }
                foreach (FeatureCAM.FMCounterSink tool in crib.CounterSinks)
                {
                    csinks.Add(tool);
                }
                foreach (FeatureCAM.FMEndMill tool in crib.EndMills)
                {
                    emills.Add(tool);
                }
                foreach (FeatureCAM.FMFaceMill tool in crib.FaceMills)
                {
                    fmills.Add(tool);
                }
                foreach (FeatureCAM.FMPlungeMill tool in crib.PlungeRoughers)
                {
                    pmills.Add(tool);
                }
                foreach (FeatureCAM.FMRoundingMill tool in crib.RoundingMills)
                {
                    rmills.Add(tool);
                }
                foreach (FeatureCAM.FMSideMill tool in crib.SideMills)
                {
                    smills.Add(tool);
                }
                foreach (FeatureCAM.FMSpotDrill tool in crib.SpotDrills)
                {
                    sdrills.Add(tool);
                }
                foreach (FeatureCAM.FMTap tool in crib.Taps)
                {
                    taps.Add(tool);
                }
                foreach (FeatureCAM.FMThreadMill tool in crib.ThreadMills)
                {
                    thmills.Add(tool);
                }
                foreach (FeatureCAM.FMTwistDrill tool in crib.TwistDrills)
                {
                    tdrills.Add(tool);
                }
            }
            all_tools += "/* Boring bars */";
            foreach (FeatureCAM.FMBoringBar tool in bbars)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Chamfer mills */";
            foreach (FeatureCAM.FMChamferMill tool in cmills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Counter bores */";
            foreach (FeatureCAM.FMCounterBore tool in cbores)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Counter sinks */";
            foreach (FeatureCAM.FMCounterSink tool in csinks)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Endmills */";
            foreach (FeatureCAM.FMEndMill tool in emills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Facemills */";
            foreach (FeatureCAM.FMFaceMill tool in fmills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Plungemills */";
            foreach (FeatureCAM.FMPlungeMill tool in pmills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Roundingmills */";
            foreach (FeatureCAM.FMRoundingMill tool in rmills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Sidemills */";
            foreach (FeatureCAM.FMSideMill tool in smills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Spotdrills */";
            foreach (FeatureCAM.FMSpotDrill tool in sdrills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Taps */";
            foreach (FeatureCAM.FMTap tool in taps)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Threadmills */";
            foreach (FeatureCAM.FMThreadMill tool in thmills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }
            all_tools += "/* Twistdrills */";
            foreach (FeatureCAM.FMTwistDrill tool in tdrills)
            {
                all_tools += Tool.AllToolsToString((FeatureCAM.FMTool)tool, null) + Environment.NewLine;
            }

            File.WriteAllText("C:\\all_tools1.txt", all_tools);
        }