示例#1
0
        private static void InitializeVariables()
        {
            FeatureCAM.FMSetup setup = null;

            Variables.ncsimul_path = FCToNCSIMUL.GetNCDelcamPath();
            if (Variables.ncsimul_md_files_dir == "")
            {
                Variables.ncsimul_md_files_dir = @"C:\Data\Spring Technologies\NCSimul8\Users\Demo\Machines";
            }

            if (fc != null)
            {
                Variables.doc = (FeatureCAM.FMDocument)fc.ActiveDocument;
            }
            if (Variables.doc == null)
            {
                Variables.prev_doc_name  = "";
                Variables.output_dirpath = "";
            }
            else
            {
                Variables.stock       = Variables.doc.Stock;
                Variables.setup_names = new List <string>();
                for (int i = 1; i <= Variables.doc.Setups.Count; i++)
                {
                    setup = (FeatureCAM.FMSetup)Variables.doc.Setups.Item(i);
                    if (setup != null)
                    {
                        Variables.setup_names.Add(setup.Name);
                        /* Have to subtract 1 b/c setups are 1-based and combobox values are 0-based */
                        if (Variables.doc.ActiveSetup.Name == setup.Name)
                        {
                            Variables.selected_setup_id = i - 1;
                        }
                        if (setup.Type != FeatureCAM.tagFMSetupType.eST_Milling)
                        {
                            Variables.are_all_setups_milling = false;
                        }
                    }
                }
                Variables.file_dirpath = Variables.doc.path;

                Variables.orig_single_stock = Variables.stock.SingleProgramWithProgramStop;

                if (Variables.prev_doc_name != Variables.doc.Name)
                {
                    Variables.doc.ActiveSetup.GetMachineSimLocation(out Variables.offset_x, out Variables.offset_y, out Variables.offset_z);
                }
                Variables.clamps = new List <SolidInfo>();
                foreach (FeatureCAM.FMSolid solid in Variables.doc.Solids)
                {
                    Variables.clamps.Add(new SolidInfo(solid, solid.UseAsClamp));
                }

                Variables.prev_doc_name = Variables.doc.Name;
            }
        }
示例#2
0
        private static void InitializeVariables()
        {
            FeatureCAM.FMSetup setup = null;

            if (fc != null)
            {
                Variables.doc = (FeatureCAM.FMDocument)fc.ActiveDocument;
            }
            if (Variables.doc == null)
            {
                Variables.prev_doc_name  = "";
                Variables.output_dirpath = "";
            }
            else
            {
                Variables.stock       = Variables.doc.Stock;
                Variables.setup_names = new List <string>();
                for (int i = 1; i <= Variables.doc.Setups.Count; i++)
                {
                    setup = (FeatureCAM.FMSetup)Variables.doc.Setups.Item(i);
                    if (setup != null)
                    {
                        Variables.setup_names.Add(setup.Name);
                        /* Have to subtract 1 b/c setups are 1-based and combobox values are 0-based */
                        if (Variables.doc.ActiveSetup.Name == setup.Name)
                        {
                            Variables.selected_setup_id = i - 1;
                        }
                    }
                }
                Variables.orig_single_stock = Variables.stock.SingleProgramWithProgramStop;

                Variables.clamps = new List <SolidInfo>();
                foreach (FeatureCAM.FMSolid solid in Variables.doc.Solids)
                {
                    Variables.clamps.Add(new SolidInfo(solid, solid.UseAsClamp));
                }

                if (Variables.stock.IndexType != FeatureCAM.tagFMIndexType.eIT_None)
                {
                    Variables.output_dirpath = Path.Combine(Variables.doc.path, Variables.doc.PartName);
                }
                else
                {
                    Variables.output_dirpath = Path.Combine(Variables.doc.path, Variables.doc.PartName) + "_" + Variables.setup_names[Variables.selected_setup_id];
                }

                Variables.doc.ActiveSetup.GetMachineSimLocation(out Variables.offset_x, out Variables.offset_y, out Variables.offset_z);

                Variables.prev_doc_name = Variables.doc.Name;
            }
        }
 public SetupInfo(FeatureCAM.FMSetup setup)
 {
     this.name         = setup.Name;
     this.enabled      = setup.Enabled;
     this.num_features = setup.Features.Count;
     this.tool_fpath   = "";
     this.nc_fpath     = "";
     if (this.ucss == null)
     {
         this.ucss = new List <UCS>();
     }
     this.ucss.Add(new UCS(setup.ucs));
     this.first_ucs_name = setup.ucs.Name;
 }
示例#4
0
        private static void InitializeVariables()
        {
            FeatureCAM.FMSetup setup      = null;
            Eureka.Application eureka_app = null;
            string             eureka_template_name;

            Variables.eureka_path = FCToEUREKA.GetEUREKAPath();
            if (Variables.eureka_template_files_dir == "")
            {
                eureka_app = FCToEUREKA.StartEUREKA();
                if (eureka_app != null)
                {
                    Variables.eureka_template_files_dir = eureka_app.TemplateDirectory;
                    eureka_app.Quit();
                    eureka_app = null;
                }
            }

            if (fc != null)
            {
                Variables.doc = (FeatureCAM.FMDocument)fc.ActiveDocument;
            }
            if (Variables.doc == null)
            {
                Variables.prev_doc_name  = "";
                Variables.output_dirpath = "";
            }
            else
            {
                Variables.stock       = Variables.doc.Stock;
                Variables.setup_names = new List <string>();
                for (int i = 1; i <= Variables.doc.Setups.Count; i++)
                {
                    setup = (FeatureCAM.FMSetup)Variables.doc.Setups.Item(i);
                    if (setup != null)
                    {
                        Variables.setup_names.Add(setup.Name);
                        /* Have to subtract 1 b/c setups are 1-based and combobox values are 0-based */
                        if (Variables.doc.ActiveSetup.Name == setup.Name)
                        {
                            Variables.selected_setup_id = i - 1;
                        }
                    }
                }
                if (Variables.stock.IndexType != FeatureCAM.tagFMIndexType.eIT_None)
                {
                    Variables.output_dirpath = Path.Combine(Variables.doc.path, Variables.doc.PartName);
                }
                else
                {
                    Variables.output_dirpath = Path.Combine(Variables.doc.path, Variables.doc.PartName) + "_" + Variables.setup_names[Variables.selected_setup_id];
                }

                Variables.orig_single_stock = Variables.stock.SingleProgramWithProgramStop;
                if (Variables.prev_doc_name != Variables.doc.Name)
                {
                    Variables.clamps = new List <SolidInfo>();
                    foreach (FeatureCAM.FMSolid solid in Variables.doc.Solids)
                    {
                        Variables.clamps.Add(new SolidInfo(solid, false));
                    }
                }
                Variables.doc.ActiveSetup.GetMachineSimLocation(out Variables.offset_x, out Variables.offset_y, out Variables.offset_z);
            }
        }