Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Imports NXOpen.UI Imports NXOpen.Annotations Module Haupt Dim s As Session = Session.GetSession() Dim ui As UI = UI.GetUI() Dim ufs As UFSession = UFSession.GetUFSession() Dim workPart As Part = s.Parts.Work Sub Main() Dim selecteddim As NXObject = Nothing Dim response1 As Selection.Response = Selection.Response.Cancel HauptStart: response1 = Select_dim(selecteddim) If response1 = Selection.Response.Cancel Then GoTo HauptEnde EditAnsichtSub(selecteddim) GoTo HauptStart HauptEnde: End Sub ' ##################### Editieren ##################### Sub EditAnsichtSub(ByVal selecteddim As NXObject) Dim markId3 As Session.UndoMarkId Dim dimname1 As String = selecteddim.ToString msgbox (dimname1) If dimname1.Contains("Base") = True Then msgbox("Grundansicht") Dim objectGeneralPropertiesBuilder1 As ObjectGeneralPropertiesBuilder objectGeneralPropertiesBuilder1 = workPart.PropertiesManager.CreateObjectGeneralPropertiesBuilder(selecteddim) objectGeneralPropertiesBuilder1.Name = "xxx" Dim nXObject1 As NXObject nXObject1 = objectGeneralPropertiesBuilder1.Commit() ElseIf dimname1.Contains("Section") = True Then msgbox("Schnittansicht") end if End Sub ' ##################### Auswahl-Funktion ##################### Function Select_dim(ByRef obj As NXObject) As Selection.Response Dim resp As Selection.Response = Selection.Response.Cancel Dim prompt As String = "Select dimensions" Dim message As String = "Select dimensions" Dim title As String = "Selection" Dim scope As Selection.SelectionScope = Selection.SelectionScope.WorkPart Dim selAction As Selection.SelectionAction = Selection.SelectionAction.ClearAndEnableSpecific Dim selectionMask_array(0) As Selection.MaskTriple Dim includeFeatures As Boolean = False Dim keepHighlighted As Boolean = False With selectionMask_array(0) 'alle Ansichten .Type = UFConstants.UF_view_type .Subtype = UFConstants.UF_all_subtype End With Dim cursor As Point3d = New Point3d resp = ui.SelectionManager.SelectTaggedObject(prompt, message, _ scope, selAction, includeFeatures, keepHighlighted, selectionMask_array, obj, cursor) If resp = Selection.Response.ObjectSelected Or _ 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 GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately End Function End Module