Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK 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
Oct 15, 2014
2
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.
 
Replies continue below

Recommended for you

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