internal static MCSManager Instance() { if (self == null) { self = new MCSManager(); } return(self); }
public NXSessionInfo(Session session, UFSession ufsession) { theSession = session; theUFSession = ufsession; workPart = theSession.Parts.Work; displayPart = theSession.Parts.Display; part_tag = theUFSession.Part.AskDisplayPart(); theUFSession.Part.AskPartName(part_tag, out part_name); OperationCollection opers = displayPart.CAMSetup.CAMOperationCollection; NCGroupCollection ncgrc = displayPart.CAMSetup.CAMGroupCollection; MCSManager.Instance().McsListClear(); foreach (CAMObject camobj in ncgrc.ToArray()) { if (camobj is OrientGeometry) { mcsobj = camobj; mcs_name = camobj.Name; mcs_geometry.Add(mcs_name); workpice_geometry.Add(mcs_name); MillOrientGeomBuilder millOrientGeom = displayPart.CAMSetup.CAMGroupCollection.CreateMillOrientGeomBuilder(mcsobj); CartesianCoordinateSystem cartesianCoordinateSystem; cartesianCoordinateSystem = millOrientGeom.Mcs; nmx = cartesianCoordinateSystem.Orientation; origin = cartesianCoordinateSystem.Origin; MCSManager.Instance().AddValue(nmx, mcs_name, origin); } if (camobj is FeatureGeometry) { workpice_geometry.Add(camobj.Name); } if (camobj is NXOpen.CAM.Operation) { opName.Add(camobj.Name); // NXSessionManager.Instance.OperationList.Add(camobj) ; // MessageBox.Show(camobj.Name); } } RaisePropertyChanged("GetMcsGeometry"); RaisePropertyChanged("GetWorkPiceGeometry"); RaisePropertyChanged("TheSession"); }