示例#1
0
        /// <summary>
        /// 创建刀路
        /// </summary>
        /// <param name="templateName">模板名</param>
        /// <param name="templateOperName">刀路模板名</param>
        /// <param name="name">程序名</param>
        /// <param name="groupModel">父程序组</param>
        /// <returns></returns>
        protected void CreateOperation(string templateOperName, string name, NCGroupModel groupModel)
        {
            Part workPart = Session.GetSession().Parts.Work;

            this.OperName = name;
            NXOpen.CAM.Operation operation1;
            try
            {
                operation1 = workPart.CAMSetup.CAMOperationCollection.Create(groupModel.ProgramGroup, groupModel.MethodGroup, groupModel.ToolGroup,
                                                                             groupModel.GeometryGroup, templateName, templateOperName, NXOpen.CAM.OperationCollection.UseDefaultName.False, name);
            }
            catch
            {
                try
                {
                    operation1 = workPart.CAMSetup.CAMOperationCollection.Create(groupModel.ProgramGroup, groupModel.MethodGroup, groupModel.ToolGroup,
                                                                                 groupModel.GeometryGroup, templateName, templateOperName, NXOpen.CAM.OperationCollection.UseDefaultName.True, name);
                }
                catch (NXException ex)
                {
                    throw ex;
                }
            }

            this.Oper = operation1;
        }
示例#2
0
 /// <summary>
 /// 创建刀路
 /// </summary>
 /// <param name="model"></param>
 /// <param name="templateName"></param>
 public AbstractOperationModel(NCGroupModel model, string templateName)
 {
     if (model == null)
     {
         throw new Exception("创建刀路父项为空!");
     }
     if (templateName == null || templateName == "")
     {
         throw new Exception("创建刀路模板名为空!");
     }
     this.GroupModel   = model;
     workPart          = Session.GetSession().Parts.Work;
     this.templateName = templateName;
 }
示例#3
0
 public AbstractOperationModel(NCGroupModel model, string templateName)
 {
     this.GroupModel   = model;
     workPart          = Session.GetSession().Parts.Work;
     this.templateName = templateName;
 }
示例#4
0
 public PlanarMillingModel(NCGroupModel model, string templateName, string templateOperName) : base(model, templateName)
 {
     this.templateOperName = templateOperName;
 }
示例#5
0
 public SurfaceContourModel(NCGroupModel model, string templateName, string templateOperName) : base(model, templateName)
 {
     this.templateOperName = templateOperName;
 }