I just starting with NXOpen and trying to run some basic scripts. In this one I would like to select all views of current drawing sheet and set color of visible lines. Actual (not working) code is below. It looks like there is problem with selection of all views.
' NX 22.214.171.124 ' Journal created by hm1535 on Fri Aug 18 10:18:40 2017 Central Europe Daylight Time ' Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Imports NXOpenUI Module NXJournal Sub Main (ByVal args() As String) Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Dim displayPart As Part = theSession.Parts.Display Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "View Style") Dim startSheet As Drawings.DrawingSheet = theSession.Parts.Work.DrawingSheets.CurrentDrawingSheet Dim viewsToSelect() As Drawings.DraftingView = startSheet.GetDraftingViews For Each viewsToSelect in startSheet Style.VisibleLines.VisibleColor = 2 workPart.DraftingViews.SuppressViewBreaks(viewsToSelect) viewsToSelect.Commit() workPart.DraftingViews.RestoreViewBreaks(viewsToSelect) next End Sub End Module