Option Strict Off Imports System Imports System.Windows.Forms Imports NXOpen Imports NXOpenUI Imports NXOpen.UF Module NXJournal Sub Main() Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Dim theUISession As UI = UI.GetUI Dim displayPart As Part = theSession.Parts.Display Dim lw As ListingWindow = theSession.ListingWindow Dim mySelectedObjects as NXObject() Dim mySelectedObject as NXObject Dim oldName As String Dim newName As String = "" DIM counter As Integer counter = 1 For counter = 1 to 100 If SelectAnObject("Punkt auswaehlen", mySelectedObject) = Selection.Response.Cancel Then Exit Sub End if oldName = mySelectedObject.Name newName = InputBox("neuen Punktnamen eingeben", "Punktname", oldName) mySelectedObject.SetName(Nothing) mySelectedObject.SetName(newName) ' counter = counter + 1 Next End Sub Function SelectAnObject(ByVal prompt As String, byRef selObj as NXObject) As Selection.Response Dim theUI As UI = UI.GetUI Dim title As String = "Selection" Dim includeFeatures As Boolean = False Dim keepHighlighted As Boolean = False Dim selAction As Selection.SelectionAction = _ Selection.SelectionAction.ClearAndEnableSpecific Dim cursor As Point3d Dim scope As Selection.SelectionScope = Selection.SelectionScope.WorkPart Dim selectionMask_array(1) As Selection.MaskTriple With selectionMask_array(0) .Type = UFConstants.UF_solid_type .Subtype = 0 .SolidBodySubtype = UFConstants.UF_point_type End With With selectionMask_array(1) .Type = UFConstants.UF_point_type .Subtype = 0 .SolidBodySubtype = 0 End With Dim resp As Selection.Response = theUI.SelectionManager.SelectObject( _ prompt, title, scope, selAction, _ includeFeatures, keepHighlighted, selectionMask_array, selobj, cursor) If resp = Selection.Response.ObjectSelected OrElse _ resp = Selection.Response.ObjectSelectedByName Then Return Selection.Response.Ok Else Return Selection.Response.Cancel End If End Function Public Function GetUnloadOption(ByVal dummy As String) As Integer 'Unloads the image when the NX session terminates GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination End Function End Module