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!

Find the top of the assembly by journal

Status
Not open for further replies.

rafl

Mechanical
Joined
May 30, 2011
Messages
41
Location
PL
Is there a way to find and make display part the main assembly using journal?
 
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.

Part and Inventory Search

Sponsor

Back
Top