Example #1
0
        /// <summary>
        /// 设置边界
        /// </summary>
        /// <param name="conditions"></param>
        public void SetBoundary(params BoundaryModel[] conditions)
        {
            NXOpen.CAM.FaceMillingBuilder builder1;
            builder1 = workPart.CAMSetup.CAMOperationCollection.CreateFaceMillingBuilder(this.Oper);
            builder1.FeedsBuilder.SetMachiningData();
            Boundary                  boundary    = builder1.BlankBoundary;
            BoundarySetList           list        = boundary.BoundaryList;
            List <BoundaryMillingSet> boundarySet = new List <BoundaryMillingSet>();

            foreach (BoundaryModel bc in conditions)
            {
                boundarySet.Add(OperationUtils.CreateBoundaryMillingSet(bc.ToolSide, bc.Types,
                                                                        bc.BouudaryPt, boundary, bc.Edges.ToArray()));
            }
            list.Append(boundarySet.ToArray());
            try
            {
                NXOpen.NXObject nXObject1;
                nXObject1 = builder1.Commit();
            }
            catch (NXException ex)
            {
                LogMgr.WriteLog("PlanarMillingModel.SetBoundary 错误" + ex.Message);
            }
            finally
            {
                builder1.Destroy();
            }
        }