效果:
代码:根据投影方向投影投影新曲线到面上
var pcb = workPart.Features.CreateProjectCurveBuilder(null);
pcb.CurveFitData.Tolerance = 0.001;
pcb.CurveFitData.AngleTolerance = 0.05;
pcb.SectionToProject.DistanceTolerance = 0.001;
pcb.SectionToProject.ChainingTolerance = 0.00095;
pcb.SectionToProject.AngleTolerance = 0.05;
pcb.SectionToProject.SetAllowedEntityTypes(NXOpen.Section.AllowTypes.CurvesAndPoints);
pcb.SectionToProject.AllowSelfIntersection(true);
var cdr = workPart.ScRuleFactory.CreateRuleBaseCurveDumb(new IBaseCurve[] { curve });
pcb.SectionToProject.AddToSection(new SelectionIntentRule[] { cdr }, curve, null, null, new Point3d(), NXOpen.Section.Mode.Create, false);
var plane = planeFace.CreatePlane();
pcb.PlaneToProjectTo = plane;
var nxobj = pcb.Commit();