NX Journal Processing for assembly child parts
2019/12/02 categories:NX Journal| tags:NX Journal|VB|
I have created a program when I want to process the child parts of an assembly. The code displays the part number of the child part.
VB Code
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim child As Assemblies.Component
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open
For Each child In workPart.ComponentAssembly.RootComponent.GetChildren()
lw.WriteLine(child.GetStringAttribute("DB_PART_NO"))
Next
End Sub
End Module