Option Strict Off Imports System Imports NXOpen Imports NXOpenUI Imports NXOpen.UF Imports NXOpen.Selection Imports System.IO Imports System.Collections.Generic Imports NXOpen.Drawings Imports System.Windows.Forms Imports System.Math Module Module2 Sub Main() Dim theUfSession As UFSession = UFSession.GetUFSession() Dim theSession As Session = Session.GetSession() Dim WP As Part = theSession.Parts.Work Dim workPart As Part = theSession.Parts.Work Dim displayPart As Part = theSession.Parts.Display Dim nullFeatures_Feature As Features.Feature = Nothing Dim mySelectedObjects As NXObject() Dim lw As ListingWindow = theSession.ListingWindow lw.Open() If SelectObjects("Selektieren Sie die Kurven ", _ mySelectedObjects) = Selection.Response.Ok Then Dim i As Integer = 0 For Each mySelObj As NXObject In mySelectedObjects Dim Nummer As String Nummer = i Dim line1 As Curve = CType(mySelObj, Curve) line1.SetName("Senkrecht " & Nummer) i = i + 1 Next End If lw.Close() End Sub Function SelectObjects(ByVal prompt As String, _ ByRef selObj As NXObject()) As Selection.Response Dim theUI As UI = UI.GetUI Dim typeArray() As Selection.SelectionType = _ {Selection.SelectionType.All, _ Selection.SelectionType.Faces, _ Selection.SelectionType.Edges, _ Selection.SelectionType.Features} Dim resp As Selection.Response = theUI.SelectionManager.SelectObjects( _ prompt, "Selection", _ Selection.SelectionScope.AnyInAssembly, _ False, typeArray, selobj) If resp = Selection.Response.ObjectSelected Or _ resp = Selection.Response.ObjectSelectedByName Or _ resp = Selection.Response.OK Then Return Selection.Response.Ok Else Return Selection.Response.Cancel End If End Function End Module