Ejemplo n.º 1
0
        /// <summary>
        /// 获取电极CAM
        /// </summary>
        /// <returns></returns>
        private ElectrodeCAMInfo GetEleCamInfo()
        {
            ElectrodeCAMInfo cam = new ElectrodeCAMInfo();

            cam.CamTemplate = this.comboBox_cam.Text;
            cam.EleHeadDis  = condition.ExpAndMatr.Matr.GetHeadDis();
            cam.EleMinDim   = condition.AskMinDim();
            return(cam);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///获取有电极程序模板的电极
        /// </summary>
        /// <returns></returns>
        private List <Part> GetElePartForCamInfo()
        {
            List <Part> elePart = new List <Part>();

            Session theSession = Session.GetSession();

            foreach (Part pt in theSession.Parts)
            {
                if (ParentAssmblieInfo.IsElectrode(pt))
                {
                    ElectrodeCAMInfo cam = ElectrodeCAMInfo.GetAttribute(pt);
                    if (cam.CamTemplate == null || cam.CamTemplate != "")
                    {
                        elePart.Add(pt);
                    }
                }
            }
            return(elePart);
        }
Ejemplo n.º 3
0
        private static List <string> CreateBuider(string partPath)
        {
            List <string> err   = new List <string>();
            Tag           ptTag = Tag.Null;

            UFPart.LoadStatus load;
            ElectrodeCAMFile  file    = new ElectrodeCAMFile();
            List <string>     newPath = file.CopyFile(partPath);

            try
            {
                theUfSession.Part.Open(newPath[0], out ptTag, out load);
            }
            catch (NXException ex)
            {
                err.Add("打开文件失败!           " + ex.Message);
                return(err);
            }
            Part   pt   = NXObjectManager.Get(ptTag) as Part;
            string name = pt.Name;

            if (pt != null)
            {
                UserModel                 user    = UserModel.GetAttribute(pt);
                ElectrodeCAMInfo          cam     = ElectrodeCAMInfo.GetAttribute(pt);
                CreateElectrodeCAMBuilder builder = new CreateElectrodeCAMBuilder(pt, user);
                builder.CreateOperationNameModel(GetTemplate(cam.CamTemplate));
                err.AddRange(builder.CreateOperationExe());
                builder.SetGenerateToolPath(true);
                string path = file.GetSaveFilePath();
                if (path != null && path != "")
                {
                    builder.ExportFile(path, false);
                }
                else
                {
                    builder.ExportFile("C:\\temp\\Electrode\\", false);
                }
                err.Add("电极" + name + "*************导出成功!");
            }
            return(err);
        }