Esempio n. 1
0
 public void ReverseDirection()
 {
     Session.UndoMarkId undoMark = Globals.Session.SetUndoMark(Session.MarkVisibility.Invisible, "");
     NXOpen.Features.DatumPlaneBuilder datumPlaneBuilder = this.DatumPlaneBuilder;
     datumPlaneBuilder.GetPlane().SetFlip(true);
     Snap.NX.Feature.CommitFeature(datumPlaneBuilder);
     datumPlaneBuilder.Destroy();
     Globals.Session.UpdateManager.DoUpdate(undoMark);
     Globals.Session.DeleteUndoMark(undoMark, null);
 }
Esempio n. 2
0
        internal static Snap.NX.DatumPlane CreateDatumPlane(Position position, Vector direction)
        {
            NXOpen.Part workPart = (NXOpen.Part)Globals.WorkPart;
            NXOpen.Features.DatumPlaneBuilder featureBuilder = workPart.Features.CreateDatumPlaneBuilder(null);
            NXOpen.Plane plane = featureBuilder.GetPlane();
            plane.SetMethod(PlaneTypes.MethodType.PointDir);
            Direction direction2 = Globals.NXOpenWorkPart.Directions.CreateDirection((Point3d)position, (Vector3d)direction, SmartObject.UpdateOption.WithinModeling);

            NXOpen.NXObject[] geom = new NXOpen.NXObject[] { workPart.Points.CreatePoint((Point3d)position), direction2 };
            plane.SetGeometry(geom);
            plane.Evaluate();
            DatumPlaneFeature datumPlaneFeature = (DatumPlaneFeature)Snap.NX.Feature.CommitFeature(featureBuilder);

            featureBuilder.Destroy();
            return(new Snap.NX.DatumPlane(datumPlaneFeature));
        }
Esempio n. 3
0
        internal static Snap.NX.DatumPlane CreateDatumPlane(Snap.NX.ICurve curve, Snap.Number arcLength)
        {
            NXOpen.Features.DatumPlaneBuilder featureBuilder = Globals.WorkPart.NXOpenPart.Features.CreateDatumPlaneBuilder(null);
            NXOpen.Plane plane = featureBuilder.GetPlane();
            plane.SetMethod(PlaneTypes.MethodType.Frenet);
            NXOpen.NXObject[] geom = new NXOpen.NXObject[] { (NXOpen.NXObject)curve.NXOpenICurve };
            plane.SetGeometry(geom);
            plane.SetFrenetSubtype(PlaneTypes.FrenetSubtype.Tangent);
            plane.SetPercent(true);
            plane.SetExpression(arcLength.ToString());
            plane.Evaluate();
            DatumPlaneFeature datumPlaneFeature = (DatumPlaneFeature)Snap.NX.Feature.CommitFeature(featureBuilder);

            featureBuilder.Destroy();
            return(new Snap.NX.DatumPlane(datumPlaneFeature));
        }