internal static SelectionIntentRule[] CreateSelectionIntentRule(params Snap.NX.ICurve[] icurves) { List <SelectionIntentRule> list = new List <SelectionIntentRule>(); for (int i = 0; i < icurves.Length; i++) { if (icurves[i] is Snap.NX.Curve) { NXOpen.Curve[] curves = new NXOpen.Curve[] { icurves[i] as Snap.NX.Curve }; CurveDumbRule rule = Globals.NXOpenWorkPart.ScRuleFactory.CreateRuleCurveDumb(curves); SelectionIntentRule[] ruleArray = new SelectionIntentRule[] { rule }; for (int j = 0; j < ruleArray.Length; j++) { list.Add(ruleArray[j]); } } else { NXOpen.Edge[] edges = new NXOpen.Edge[] { icurves[i] as Snap.NX.Edge }; EdgeDumbRule rule2 = Globals.NXOpenWorkPart.ScRuleFactory.CreateRuleEdgeDumb(edges); SelectionIntentRule[] ruleArray2 = new SelectionIntentRule[] { rule2 }; for (int k = 0; k < ruleArray2.Length; k++) { list.Add(ruleArray2[k]); } } } return(list.ToArray()); }
internal static Snap.NX.NXObject CreateNXObject(TaggedObject nxopenTaggedObject) { Snap.NX.NXObject obj2 = null; NXOpen.NXObject nxopenObject = nxopenTaggedObject as NXOpen.NXObject; if (nxopenObject != null) { obj2 = new Snap.NX.NXObject(nxopenObject); NXOpen.Curve nxopenCurve = nxopenObject as NXOpen.Curve; if (nxopenCurve != null) { obj2 = Snap.NX.Curve.CreateCurve(nxopenCurve); } switch (GetTypeFromTag(nxopenObject.Tag)) { case ObjectTypes.Type.Point: obj2 = new Snap.NX.Point((NXOpen.Point)nxopenObject); break; case ObjectTypes.Type.DatumPlane: obj2 = new Snap.NX.DatumPlane((DatumPlaneFeature)nxopenObject); break; case ObjectTypes.Type.DatumAxis: obj2 = new Snap.NX.DatumAxis((DatumAxisFeature)nxopenObject); break; case ObjectTypes.Type.CoordinateSystem: obj2 = new Snap.NX.CoordinateSystem((NXOpen.CoordinateSystem)nxopenObject); break; case ObjectTypes.Type.Body: obj2 = new Snap.NX.Body((NXOpen.Body)nxopenObject); break; case ObjectTypes.Type.Face: obj2 = Snap.NX.Face.CreateFace((NXOpen.Face)nxopenObject); break; case ObjectTypes.Type.Edge: obj2 = Snap.NX.Edge.CreateEdge((NXOpen.Edge)nxopenObject); break; case ObjectTypes.Type.Feature: obj2 = Snap.NX.Feature.CreateFeature((NXOpen.Features.Feature)nxopenObject); break; case ObjectTypes.Type.Component: return(new Snap.NX.Component((NXOpen.Assemblies.Component)nxopenObject)); } } return(obj2); }
public static Snap.NX.Curve Wrap(Tag nxopenCurveTag) { if (nxopenCurveTag == Tag.Null) { throw new ArgumentException("Input tag is NXOpen.Tag.Null"); } NXOpen.Curve objectFromTag = Snap.NX.NXObject.GetObjectFromTag(nxopenCurveTag) as NXOpen.Curve; if (objectFromTag == null) { throw new ArgumentException("Input tag doesn't belong to an NXOpen.Curve object"); } return(objectFromTag); }
internal static Snap.NX.Curve CreateCurve(NXOpen.Curve nxopenCurve) { Snap.NX.Curve curve = new Snap.NX.Curve(nxopenCurve); ObjectTypes.Type objectType = curve.ObjectType; ObjectTypes.SubType objectSubType = curve.ObjectSubType; switch (objectType) { case ObjectTypes.Type.Line: return(new Snap.NX.Line((NXOpen.Line)nxopenCurve)); case ObjectTypes.Type.Arc: return(new Snap.NX.Arc((NXOpen.Arc)nxopenCurve)); case ObjectTypes.Type.Spline: return(new Snap.NX.Spline((NXOpen.Spline)nxopenCurve)); } if (objectSubType == ObjectTypes.SubType.ConicEllipse) { curve = new Snap.NX.Ellipse((NXOpen.Ellipse)nxopenCurve); } return(curve); }
public Snap.NX.Curve Copy(Transform xform) { NXOpen.Curve nXOpenTaggedObject = (NXOpen.Curve)Snap.NX.NXObject.Wrap(this.NXOpenCurve.Tag).Copy(xform).NXOpenTaggedObject; return(CreateCurve(nXOpenTaggedObject)); }