Hi Ram K
Here I have edited your C# Journal above, become vb.net. Maybe someone needs it in vb.
Once again, Thank you.
Regards,
Maryadi
'****************************************************************
'By: Maryadi - Edited from C# Journal by. Ram K *
'****************************************************************
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports NXOpen.Assemblies
Module NXJournal
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = theSession.ListingWindow
Sub Main()
try
Dim wp As Part = theSession.Parts.Work
Dim dp As Part = theSession.Parts.Display
Dim pt As Component = dp.ComponentAssembly.RootComponent
Dim null As System.DBNull
Dim theUI As UI = UI.GetUI()
if Not String.IsNullOrEmpty(pt.ToString)
Dim parent As BasePart = pt.OwningPart
Dim at_val As String = parent.GetStringUserAttribute("Project Number", -1)
wp.SetUserAttribute("Project Number", -1, at_val, Update.Option.Now)
lw.Open()
lw.WriteFullline(pt.OwningPart.Leaf + " Attribute value: "+at_val+ " is copied to " + wp.Leaf)
else
theUI.NXMessageBox.Show("NXAttribute Tool", NXMessageBox.DialogType.Information, "This is not a valid Assembly")
End If
Catch ex As Exception
Dim theUI As UI = UI.GetUI()
theUI.NXMessageBox.Show("NXAttributes", NXMessageBox.DialogType.Error, ex.ToString())
End Try
End Sub
End Module