DHuskic
Computer
- Dec 18, 2012
- 114
So I have a simple journal to give me a name attribute for each component. The reason I do not want to use the one that comes standard in the navigator is because it gives me the Original layer instead of a number. However, this journal does not give me numbers either. Any ideas how to get around the Original layer settings?
Denis Huskic
Data Prep NX7.5
Kettering University
Class of '17
Code:
Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen
Imports NXOpen.Utilities
Imports NXOpen.Assemblies
Module LayerName
Dim theSession As Session = Session.GetSession()
Dim theUFSession As UFSession = UFSession.GetUFSession()
Sub Main()
Dim displaypart As Part = theSession.Parts.Display
Dim c As Component = displaypart.ComponentAssembly.RootComponent
Dim children As Component() = c.GetChildren()
For Each comp As Component In children
Comp.SetAttribute("LayerName", comp.layer)
Next
End Sub
End Module
Denis Huskic
Data Prep NX7.5
Kettering University
Class of '17