I have created one drafting view with few notes containing some text value.
I am trying to delete that View through journal and it is working good sometime and sometime not.
I have used below code.
Option Strict OffImports SystemImports NXOpen
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()Dim workPart As Part = theSession.Parts.WorkDim displayPart As Part = theSession.Parts.Display
Dim markId1 As Session.UndoMarkIdmarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Delete")
Dim notifyOnDelete1 As BooleannotifyOnDelete1 = theSession.Preferences.Modeling.NotifyOnDelete
theSession.UpdateManager.ClearErrorList()Dim markId2 As Session.UndoMarkIdmarkId2 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Delete")
Dim objects1(0) As NXObjectDim drawingView1 As Drawings.DrawingView = CType(workPart.DraftingViews.FindObject("Example"), Drawings.DrawingView)
objects1(0) = drawingView1Dim nErrs1 As IntegernErrs1 = theSession.UpdateManager.AddToDeleteList(objects1)
Dim notifyOnDelete2 As BooleannotifyOnDelete2 = theSession.Preferences.Modeling.NotifyOnDelete
Dim nErrs2 As IntegernErrs2 = theSession.UpdateManager.DoUpdate(markId2)
End SubEnd Module