Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create reference sets(Name: MODEL)for all the assemblies, sub-assemblies and parts in NX7.5?

Status
Not open for further replies.

naveen91ar

Mechanical
Joined
Oct 15, 2014
Messages
2
Location
FR
Please help me with a journal to create reference sets in the name "MODEL" for all the assemblies , sub-assemblies and components in NX-7.5.
 
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
 
Except that it's generally not recommended that you create Reference Sets in an Assembly file.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top