public override void CreateOperation(ElectrodeCAM eleCam, double inter)
 {
     this.Oper = ElectrodeOperationTemplate.CreateOperationOfCavityMilling(this.NameModel, eleCam);
     this.Oper.Create(this.NameModel.OperName);
     (this.Oper as CavityMillingModel).SetReferenceTool(eleCam.FindTool(this.ReferenceTool) as Tool);
     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);
     }
 }
        private static NCGroupModel GetNcGroupModelOfName(OperationNameModel model, ElectrodeCAM cam)
        {
            Part         workPart = Session.GetSession().Parts.Work;
            NCGroupModel group    = new NCGroupModel()
            {
                GeometryGroup = cam.FindGeometry("WORKPIECE"),
                MethodGroup   = cam.MethodGroup.Find(a => a.Name.ToUpper().Equals("CU")),
                ToolGroup     = cam.FindTool(model.ToolName)
            };
            NCGroup temp = cam.FindProgram(model.ProgramName);

            if (temp == null)
            {
                NXOpen.CAM.NCGroup nCGroup1 = (NXOpen.CAM.NCGroup)workPart.CAMSetup.CAMGroupCollection.FindObject("AAA");
                NXOpen.CAM.NCGroup nCGroup2 = workPart.CAMSetup.CAMGroupCollection.CreateProgram(nCGroup1, "electrode", "AAA_1", NXOpen.CAM.NCGroupCollection.UseDefaultName.True, model.ProgramName);
                group.ProgramGroup = nCGroup2;
            }
            else
            {
                group.ProgramGroup = temp;
            }
            return(group);
        }