Example #1
0
 internal static Snap.NX.Cone CreateConeFromArcs(Snap.NX.ICurve baseArc, Snap.NX.ICurve topArc)
 {
     NXOpen.Features.ConeBuilder featureBuilder = Globals.WorkPart.NXOpenPart.Features.CreateConeBuilder(null);
     featureBuilder.BooleanOption.Type = BooleanOperation.BooleanType.Create;
     featureBuilder.Type          = NXOpen.Features.ConeBuilder.Types.TwoCoaxialArcs;
     featureBuilder.BaseArc.Value = baseArc.NXOpenICurve;
     featureBuilder.TopArc.Value  = topArc.NXOpenICurve;
     NXOpen.Features.Cone cone = (NXOpen.Features.Cone)Snap.NX.Feature.CommitFeature(featureBuilder);
     featureBuilder.Destroy();
     return(new Snap.NX.Cone(cone));
 }
Example #2
0
        internal static Snap.NX.Cone CreateConeFromDiametersHeight(Position axisPoint, Vector direction, Snap.Number baseDiameter, Snap.Number topDiameter, Snap.Number height)
        {
            NXOpen.Part workPart = (NXOpen.Part)Globals.WorkPart;
            NXOpen.Features.ConeBuilder featureBuilder = workPart.Features.CreateConeBuilder(null);
            featureBuilder.BooleanOption.Type = BooleanOperation.BooleanType.Create;
            featureBuilder.Type = NXOpen.Features.ConeBuilder.Types.DiametersAndHeight;
            Direction direction2 = workPart.Directions.CreateDirection((Point3d)axisPoint, (Vector3d)direction, SmartObject.UpdateOption.WithinModeling);

            NXOpen.Axis axis = featureBuilder.Axis;
            axis.Direction = direction2;
            axis.Point     = workPart.Points.CreatePoint((Point3d)axisPoint);
            featureBuilder.BaseDiameter.RightHandSide = baseDiameter.ToString();
            featureBuilder.TopDiameter.RightHandSide  = topDiameter.ToString();
            featureBuilder.Height.RightHandSide       = height.ToString();
            NXOpen.Features.Cone cone = (NXOpen.Features.Cone)Snap.NX.Feature.CommitFeature(featureBuilder);
            featureBuilder.Destroy();
            return(new Snap.NX.Cone(cone));
        }