public static Snap.NX.Tube Wrap(Tag nxopenTubeTag) { if (nxopenTubeTag == Tag.Null) { throw new ArgumentException("Input tag is NXOpen.Tag.Null"); } NXOpen.Features.Tube objectFromTag = Snap.NX.NXObject.GetObjectFromTag(nxopenTubeTag) as NXOpen.Features.Tube; if (objectFromTag == null) { throw new ArgumentException("Input tag doesn't belong to an NXOpen.Features.Tube object"); } return(objectFromTag); }
internal static Snap.NX.Tube CreateTube(Snap.NX.Curve spine, Snap.Number outerDiameter, Snap.Number innerDiameter, bool createBsurface) { NXOpen.Features.TubeBuilder featureBuilder = Globals.WorkPart.NXOpenPart.Features.CreateTubeBuilder(null); featureBuilder.Tolerance = Globals.DistanceTolerance; featureBuilder.OuterDiameter.RightHandSide = outerDiameter.ToString(); featureBuilder.InnerDiameter.RightHandSide = innerDiameter.ToString(); featureBuilder.OutputOption = NXOpen.Features.TubeBuilder.Output.MultipleSegments; if (createBsurface) { featureBuilder.OutputOption = NXOpen.Features.TubeBuilder.Output.SingleSegment; } ((Snap.NX.Section)featureBuilder.PathSection).AddICurve(new Snap.NX.ICurve[] { spine }); featureBuilder.BooleanOption.Type = BooleanOperation.BooleanType.Create; NXOpen.Features.Tube tube = (NXOpen.Features.Tube)Snap.NX.Feature.CommitFeature(featureBuilder); featureBuilder.Destroy(); return(new Snap.NX.Tube(tube)); }
internal Tube(NXOpen.Features.Tube tube) : base(tube) { this.NXOpenTube = tube; }