Ejemplo n.º 1
0
 internal static Snap.NX.Cylinder CreateCylinder(Snap.NX.ICurve arc, Snap.Number height)
 {
     NXOpen.Features.CylinderBuilder featureBuilder = Globals.WorkPart.NXOpenPart.Features.CreateCylinderBuilder(null);
     featureBuilder.Type = NXOpen.Features.CylinderBuilder.Types.ArcAndHeight;
     featureBuilder.BooleanOption.Type   = BooleanOperation.BooleanType.Create;
     featureBuilder.Arc.Value            = arc.NXOpenICurve;
     featureBuilder.Height.RightHandSide = height.ToString();
     NXOpen.Features.Cylinder cylinder = (NXOpen.Features.Cylinder)Snap.NX.Feature.CommitFeature(featureBuilder);
     featureBuilder.Destroy();
     return(new Snap.NX.Cylinder(cylinder));
 }
Ejemplo n.º 2
0
 public static Snap.NX.Cylinder Wrap(Tag nxopenCylinderTag)
 {
     if (nxopenCylinderTag == Tag.Null)
     {
         throw new ArgumentException("Input tag is NXOpen.Tag.Null");
     }
     NXOpen.Features.Cylinder objectFromTag = Snap.NX.NXObject.GetObjectFromTag(nxopenCylinderTag) as NXOpen.Features.Cylinder;
     if (objectFromTag == null)
     {
         throw new ArgumentException("Input tag doesn't belong to an NXOpen.Features.Cylinder object");
     }
     return(objectFromTag);
 }
Ejemplo n.º 3
0
        internal static Snap.NX.Cylinder CreateCylinder(Position axisPoint, Vector axisVector, Snap.Number height, Snap.Number diameter)
        {
            NXOpen.Part workPart = (NXOpen.Part)Globals.WorkPart;
            NXOpen.Features.CylinderBuilder featureBuilder = workPart.Features.CreateCylinderBuilder(null);
            featureBuilder.Type = NXOpen.Features.CylinderBuilder.Types.AxisDiameterAndHeight;
            featureBuilder.BooleanOption.Type     = BooleanOperation.BooleanType.Create;
            featureBuilder.Diameter.RightHandSide = diameter.ToString();
            featureBuilder.Height.RightHandSide   = height.ToString();
            Position  origin    = Position.Origin;
            Direction direction = workPart.Directions.CreateDirection((Point3d)origin, (Vector3d)axisVector, SmartObject.UpdateOption.WithinModeling);

            featureBuilder.Axis.Direction = direction;
            featureBuilder.Axis.Point     = workPart.Points.CreatePoint((Point3d)axisPoint);
            NXOpen.Features.Cylinder cylinder = (NXOpen.Features.Cylinder)Snap.NX.Feature.CommitFeature(featureBuilder);
            featureBuilder.Destroy();
            return(new Snap.NX.Cylinder(cylinder));
        }
Ejemplo n.º 4
0
 internal Cylinder(NXOpen.Features.Cylinder cylinder) : base(cylinder)
 {
     this.NXOpenCylinder = cylinder;
 }