Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal Update all drawings

Status
Not open for further replies.

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
 
Replies continue below

Recommended for you

The .UpdateViews method has various options to update all the views, only the out of date views, or only the specified views. Check out the help file on .UpdateViews, it probably has an option that will work for your needs.

www.nxjournaling.com
 
ok thnx


Lars
NX11.0.2.7 native
Solid Edge
Inventor
 
Cowski,

Where can I find this file on UpdateViews?

Lars

Lars
NX11.0.2.7 native
Solid Edge
Inventor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor