niedzviedz
Mechanical
- Apr 1, 2012
- 307
Hello,
I wanna process all detail views to change label on it. Below is my code, but I receive an error "cannot convert detailview to 1-dimensional array view."
Any tips how to repair it?
With best regards
Michael
I wanna process all detail views to change label on it. Below is my code, but I receive an error "cannot convert detailview to 1-dimensional array view."
Code:
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
Sub Main (ByVal args() As String)
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
'Dim views1(0) As NXOpen.View
'Dim detailView1 As NXOpen.Drawings.DetailView
Dim startSheet As Drawings.DrawingSheet = theSession.Parts.Work.DrawingSheets.CurrentDrawingSheet
'for each views1 as Drawings.DraftingView in startSheet.SheetDraftingViews
for each dview as NXOpen.Drawings.DetailView in startSheet.SheetDraftingViews
'views1(0) = detailView1
'If views1.Name.Contains("DETAIL") Then
'for each dview as NXOpen.Drawings.DetailView in views1
Dim editViewSettingsBuilder1 As NXOpen.Drawings.EditViewSettingsBuilder = Nothing
editViewSettingsBuilder1 = workPart.SettingsManager.CreateDrawingEditViewSettingsBuilder(dview)
theSession.SetUndoMarkName(markId1, "Settings Dialog")
Dim editsettingsbuilders1(0) As NXOpen.Drafting.BaseEditSettingsBuilder
editsettingsbuilders1(0) = editViewSettingsBuilder1
workPart.SettingsManager.ProcessForMultipleObjectsSettings(editsettingsbuilders1)
'editViewSettingsBuilder1.ViewDetailLabel.LabelParentDisplay = NXOpen.Drawings.ViewDetailLabelBuilder.LabelParentDisplayTypes.LabelOnBoundary
editViewSettingsBuilder1.ViewDetailLabel.LabelParentDisplay = NXOpen.Drawings.ViewDetailLabelBuilder.LabelParentDisplayTypes.Label
Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Settings")
theSession.DeleteUndoMark(markId2, Nothing)
Dim markId3 As NXOpen.Session.UndoMarkId = Nothing
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Settings")
Dim nXObject1 As NXOpen.NXObject = Nothing
nXObject1 = editViewSettingsBuilder1.Commit()
theSession.DeleteUndoMark(markId3, Nothing)
theSession.SetUndoMarkName(markId1, "Settings")
editViewSettingsBuilder1.Destroy()
'next
'End If
next
End Sub
End Module
Any tips how to repair it?
With best regards
Michael