Esempio n. 1
0
        public override List <string> CreateOperation()
        {
            List <string> err = new List <string>();

            this.template = new ElectrodeCAMTemplateModel();
            if (this.nameModel == null)
            {
                throw new Exception("请现创建刀具路径所需要的路径!");
            }
            try
            {
                this.operModel = ElectrodeOperationTemplate.CreateOperationOfCavityMilling(this.nameModel, template);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            try
            {
                this.operModel.Create(this.nameModel.OperName);
            }
            catch (NXException ex)
            {
                throw ex;
            }
            try
            {
                if ((0.05 - this.Inter) > 0)
                {
                    if (0.03 - this.Inter > 0)
                    {
                        this.operModel.SetStock(0.05 - this.Inter, 0.03 - this.Inter);
                    }
                    else
                    {
                        this.operModel.SetStock(0.05 - this.Inter, 0);
                    }
                }
                else
                {
                    this.operModel.SetStock(0, 0);
                }
            }
            catch (NXException ex)
            {
                err.Add("设置余量错误!            " + ex.Message);
            }
            return(err);
        }
 public override void CreateOperation(ElectrodeCAM eleCam, double inter)
 {
     this.Oper = ElectrodeOperationTemplate.CreateOperationOfCavityMilling(this.NameModel, eleCam);
     this.Oper.Create(this.NameModel.OperName);
     if ((0.05 - inter) > 0)
     {
         if (0.03 - inter > 0)
         {
             this.Oper.SetStock(0.05 - inter, 0.03 - inter);
         }
         else
         {
             this.Oper.SetStock(0.05 - inter, 0);
         }
     }
     else
     {
         this.Oper.SetStock(0, 0);
     }
 }
        public override List <string> CreateOperation()
        {
            List <string> err = new List <string>();

            this.template = new ElectrodeCAMTemplateModel();
            if (this.nameModel == null)
            {
                throw new Exception("请现创建刀具路径所需要的路径!");
            }
            try
            {
                this.operModel = ElectrodeOperationTemplate.CreateOperationOfCavityMilling(this.nameModel, template);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            try
            {
                this.operModel.Create(this.nameModel.OperName);
            }
            catch (NXException ex)
            {
                throw ex;
            }
            try
            {
                NCGroup toolGroup = template.FindTool(ReferenceTool);
                if (toolGroup == null)
                {
                    err.Add("设置参考刀具错误!           " + "无法在模板中找到参考刀具");
                }
                else
                {
                    (this.operModel as CavityMillingModel).SetReferenceTool(toolGroup as Tool);
                }
            }
            catch (NXException ex)
            {
                err.Add("设置参考刀具错误!           " + ex.Message);
            }
            try
            {
                if ((0.05 - this.Inter) > 0)
                {
                    if (0.03 - this.Inter > 0)
                    {
                        this.operModel.SetStock(0.05 - this.Inter, 0.03 - this.Inter);
                    }
                    else
                    {
                        this.operModel.SetStock(0.05 - this.Inter, 0);
                    }
                }
                else
                {
                    this.operModel.SetStock(0, 0);
                }
            }
            catch (NXException ex)
            {
                err.Add("设置余量错误!            " + ex.Message);
            }
            return(err);
        }