static void SuppressedAllConstraintAndFeature(bool bSuppress) { try { Session theSession = Session.GetSession(); UFSession theUfSession = UFSession.GetUFSession(); UFUi theUFUi = theUfSession.Ui; string path = @"D: est_model\_model1.prt"; NXOpen.Tag obj = NXOpen.Tag.Null; UFPart.LoadStatus LoadStatus; theUfSession.Part.Open(path, out obj, out LoadStatus); NXOpen.Part part = theSession.Parts.Display; Feature[] features = part.Features.ToArray(); if (bSuppress) { part.Features.SuppressFeatures(features); } else { part.Features.UnsuppressFeatures(features); } ComponentAssembly componentAssembly = part.ComponentAssembly; ComponentPositioner componentPositioner = componentAssembly.Positioner; ConstraintCollection constraintCollection = componentPositioner.Constraints; foreach (Constraint c in constraintCollection) { c.Suppressed = bSuppress; } part.Save(BasePart.SaveComponents.True, BasePart.CloseAfterSave.True); } catch (Exception ex) { Console.WriteLine(ex.Message); } }