Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Find the top of the assembly by journal

Status
Not open for further replies.

rafl

Mechanical
May 30, 2011
41
0
0
PL
Is there a way to find and make display part the main assembly using journal?
 
Replies continue below

Recommended for you

Try something like this:

Code:
Option Strict Off

Imports System
Imports NXOpen

Module NXJournal

Sub Main (ByVal args() As String) 

	Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
	Dim workPart As NXOpen.Part = theSession.Parts.Work

	Dim displayPart As NXOpen.Part = theSession.Parts.Display

	Dim markId1 As NXOpen.Session.UndoMarkId
	markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Make Work Part")

	Dim nullNXOpen_Assemblies_Component As NXOpen.Assemblies.Component = Nothing

	Dim partLoadStatus1 As NXOpen.PartLoadStatus
	theSession.Parts.SetWorkComponent(nullNXOpen_Assemblies_Component, NXOpen.PartCollection.RefsetOption.Current, NXOpen.PartCollection.WorkComponentOption.Visible, partLoadStatus1)

	workPart = theSession.Parts.Work
	partLoadStatus1.Dispose()
	theSession.SetUndoMarkName(markId1, "Make Work Part")

End Sub

End Module

With best regards
Michael
 
Status
Not open for further replies.
Back
Top