/// <summary>
/// 创建基准面和实体的交线(合并交线) /// </summary> /// <param name="body"></param> /// <param name="dPlane"></param> /// <param name="iCurve"></param> public void CreateIntersectionCurveOfBodyAndDatumPlane(Body body, DatumPlane dPlane, out Curve iCurve) { try { NXOpen.Features.Feature nullFeatures_Feature = null;NXOpen.Features.SectionCurveBuilder sectionCurveBuilder1;
sectionCurveBuilder1 = workPart.Features.CreateSectionCurveBuilder(nullFeatures_Feature);sectionCurveBuilder1.Associative = true;
sectionCurveBuilder1.Tolerance = 0.0254; sectionCurveBuilder1.CurveFitJoinOptions.CurveJoinMethod = NXOpen.GeometricUtilities.CurveFitJoin.JoinMethod.Genernal; bool added1; added1 = sectionCurveBuilder1.ObjectsToSection.Add(body);bool added2;
added2 = sectionCurveBuilder1.SectionPlanes.Add(dPlane);NXObject nXObject1;
nXObject1 = sectionCurveBuilder1.Commit();iCurve = (Curve)((SectionCurve)nXObject1).GetEntities()[0];
sectionCurveBuilder1.Destroy();
}
catch (Exception ex) { UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.Error, ex.Message); iCurve = null; } }