Lars1978
Mechanical
- Dec 30, 2015
- 327
Cowski,
I'd like to change the code beneath. So when I run the journal all drawing and drawing views are updated.
Can you tell mee how to do this?
ub Main (ByVal args() As String)
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Update Views")
Dim views1(1) As NXOpen.Drawings.DraftingView
Dim projectedView1 As NXOpen.Drawings.ProjectedView = CType(workPart.DraftingViews.FindObject("ORTHO@2"), NXOpen.Drawings.ProjectedView)
views1(0) = projectedView1
Dim baseView1 As NXOpen.Drawings.BaseView = CType(workPart.DraftingViews.FindObject("Front@1"), NXOpen.Drawings.BaseView)
views1(1) = baseView1
workPart.DraftingViews.UpdateViews(views1)
' ----------------------------------------------
' Menu: Edit->View->Update...
' ----------------------------------------------
Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
Dim updateViewsBuilder1 As NXOpen.Drawings.UpdateViewsBuilder = Nothing
updateViewsBuilder1 = workPart.DraftingViews.CreateUpdateViewsBuilder()
theSession.SetUndoMarkName(markId2, "Update Views Dialog")
updateViewsBuilder1.Destroy()
theSession.UndoToMark(markId2, Nothing)
theSession.DeleteUndoMark(markId2, Nothing)
Lars
NX11.0.2.7 native
Solid Edge
Inventor
I'd like to change the code beneath. So when I run the journal all drawing and drawing views are updated.
Can you tell mee how to do this?
ub Main (ByVal args() As String)
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Update Views")
Dim views1(1) As NXOpen.Drawings.DraftingView
Dim projectedView1 As NXOpen.Drawings.ProjectedView = CType(workPart.DraftingViews.FindObject("ORTHO@2"), NXOpen.Drawings.ProjectedView)
views1(0) = projectedView1
Dim baseView1 As NXOpen.Drawings.BaseView = CType(workPart.DraftingViews.FindObject("Front@1"), NXOpen.Drawings.BaseView)
views1(1) = baseView1
workPart.DraftingViews.UpdateViews(views1)
' ----------------------------------------------
' Menu: Edit->View->Update...
' ----------------------------------------------
Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
Dim updateViewsBuilder1 As NXOpen.Drawings.UpdateViewsBuilder = Nothing
updateViewsBuilder1 = workPart.DraftingViews.CreateUpdateViewsBuilder()
theSession.SetUndoMarkName(markId2, "Update Views Dialog")
updateViewsBuilder1.Destroy()
theSession.UndoToMark(markId2, Nothing)
theSession.DeleteUndoMark(markId2, Nothing)
Lars
NX11.0.2.7 native
Solid Edge
Inventor