Load all components fully and use the following code.
using System;
using NXOpen;
public class NXJournal
{
public static void Main(string[] args)
{
Session theSession = Session.GetSession();
Part workPart = theSession.Parts.Work;
Part displayPart = theSession.Parts.Display;
// ----------------------------------------------
// Menu: Format->Reference Sets...
// ----------------------------------------------
foreach (var eachPart in theSession.Parts.ToArray())
{
Session.UndoMarkId markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Edit Name of Reference Set");
ReferenceSet referenceSet1 = eachPart.CreateReferenceSet();
referenceSet1.SetName("MODEL");
int nErrs2 = theSession.UpdateManager.DoUpdate(markId4);
theSession.DeleteUndoMarksUpToMark(markId4, null, false);
}
// ----------------------------------------------
// Menu: Tools->Journal->Stop Recording
// ----------------------------------------------
}
public static int GetUnloadOption(string dummy) { return (int)Session.LibraryUnloadOption.Immediately; }
}
Mukundh