NX二次开发(C#)-建模-三点创建圆弧曲线

Posted NX二次开发专注者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NX二次开发(C#)-建模-三点创建圆弧曲线相关的知识,希望对你有一定的参考价值。

            NXOpen.Unit unit1 = (NXOpen.Unit)workPart.UnitCollection.FindObject("MilliMeter");
            NXOpen.Expression expression_11;
            expression_11 = workPart.Expressions.CreateSystemExpressionWithUnits("pp11_x=-181.109000000", unit1);

            NXOpen.Scalar scalar11;
            scalar11 = workPart.Scalars.CreateScalarExpression(expression_11, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Expression expression_12;
            expression_12 = workPart.Expressions.CreateSystemExpressionWithUnits("pp12_y=32.850700000", unit1);

            NXOpen.Scalar scalar12;
            scalar12 = workPart.Scalars.CreateScalarExpression(expression_12, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Expression expression_13;
            expression_13 = workPart.Expressions.CreateSystemExpressionWithUnits("pp13_z=0", unit1);

            NXOpen.Scalar scalar13;
            scalar13 = workPart.Scalars.CreateScalarExpression(expression_13, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Point point1;
            point1 = workPart.Points.CreatePoint(scalar11, scalar12, scalar13, NXOpen.SmartObject.UpdateOption.WithinModeling);

            point1.SetVisibility(NXOpen.SmartObject.VisibilityOption.Visible);

            NXOpen.Expression expression_21;
            expression_21 = workPart.Expressions.CreateSystemExpressionWithUnits("pp21_x=-33.180112807 ", unit1);

            NXOpen.Scalar scalar21;
            scalar21 = workPart.Scalars.CreateScalarExpression(expression_21, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Expression expression_22;
            expression_22 = workPart.Expressions.CreateSystemExpressionWithUnits("pp22_y=-167.294495853 ", unit1);

            NXOpen.Scalar scalar22;
            scalar22 = workPart.Scalars.CreateScalarExpression(expression_22, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Expression expression_23;
            expression_23 = workPart.Expressions.CreateSystemExpressionWithUnits("pp23_z=0", unit1);

            NXOpen.Scalar scalar23;
            scalar23 = workPart.Scalars.CreateScalarExpression(expression_23, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Point point2;
            point2 = workPart.Points.CreatePoint(scalar21, scalar22, scalar23, NXOpen.SmartObject.UpdateOption.WithinModeling);

            point2.SetVisibility(NXOpen.SmartObject.VisibilityOption.Visible);

            NXOpen.Expression expression_31;
            expression_31 = workPart.Expressions.CreateSystemExpressionWithUnits("pp31_x=204.938000000 ", unit1);

            NXOpen.Scalar scalar31;
            scalar31 = workPart.Scalars.CreateScalarExpression(expression_31, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Expression expression_32;
            expression_32 = workPart.Expressions.CreateSystemExpressionWithUnits("pp32_y=-239.688000000 ", unit1);

            NXOpen.Scalar scalar32;
            scalar32 = workPart.Scalars.CreateScalarExpression(expression_32, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Expression expression_33;
            expression_33 = workPart.Expressions.CreateSystemExpressionWithUnits("pp33_z=0", unit1);

            NXOpen.Scalar scalar33;
            scalar33 = workPart.Scalars.CreateScalarExpression(expression_33, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);

            NXOpen.Point point3;
            point3 = workPart.Points.CreatePoint(scalar31, scalar32, scalar33, NXOpen.SmartObject.UpdateOption.WithinModeling);

            point3.SetVisibility(NXOpen.SmartObject.VisibilityOption.Visible);




            NXOpen.Features.AssociativeArc nullNXOpen_Features_AssociativeArc = null;

            NXOpen.Features.AssociativeArcBuilder associativeArcBuilder1;
            associativeArcBuilder1 = workPart.BaseFeatures.CreateAssociativeArcBuilder(nullNXOpen_Features_AssociativeArc);

            associativeArcBuilder1.Limits.StartLimit.Distance.RightHandSide = "0";
            associativeArcBuilder1.Limits.EndLimit.Distance.RightHandSide = "0";

            associativeArcBuilder1.StartPoint.Value = point1;

            associativeArcBuilder1.StartPointOptions = NXOpen.Features.AssociativeArcBuilder.StartOption.Point;

            associativeArcBuilder1.EndPoint.Value = point3;

            associativeArcBuilder1.EndPointOptions = NXOpen.Features.AssociativeArcBuilder.EndOption.Point;

            associativeArcBuilder1.MidPoint.Value = point2;

            associativeArcBuilder1.MidPointOptions = NXOpen.Features.AssociativeArcBuilder.MidOption.Point;

    
            nXObject = associativeArcBuilder1.Commit();

            associativeArcBuilder1.Destroy();

以上是关于NX二次开发(C#)-建模-三点创建圆弧曲线的主要内容,如果未能解决你的问题,请参考以下文章

UG NX二次开发(C#)-建模-创建填充曲面(CreateFillHoleBuilder)

NX二次开发(C#)-建模-通过起始点终止点圆弧半径创建圆弧

NX二次开发(C#)-建模-圆弧边对象转化为圆弧对象

NX二次开发-UFUN三点创建圆弧UF_CURVE_create_arc_thru_3pts

UG NX二次开发(C#)-建模-判断一条曲线是不是封闭

UG NX二次开发(C#)-建模-判断一条曲线是不是封闭