Barnon
Mechanical
- Jul 23, 2016
- 97
Is there any way to grab the Drawing Revision show in the attached pic to a variable in GRIP?
Thanks for any help.
Thanks for any help.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpen.UF
Module Module2
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim theUI As UI = UI.GetUI()
Dim lw As ListingWindow = theSession.ListingWindow
Sub Main()
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "NXJ")
lw.Open()
Dim dwgSheets As New List(Of Drawings.DrawingSheet)
For Each temp As Drawings.DrawingSheet In theSession.Parts.Work.DrawingSheets
dwgSheets.Add(temp)
Next
For Each temp As Drawings.DrawingSheet In dwgSheets
lw.WriteLine("sheet name: " & temp.Name)
Dim sheetNum As Integer
Dim sheetRev As String
Dim theSheetBuilder As Drawings.DrawingSheetBuilder = theSession.Parts.Work.DrawingSheets.DrawingSheetBuilder(temp)
sheetNum = theSheetBuilder.Number
sheetRev = theSheetBuilder.Revision
theSheetBuilder.Destroy()
lw.WriteLine(" sheet number: " & sheetNum.ToString)
lw.WriteLine(" sheet revision: " & sheetRev)
lw.WriteLine("")
Next
' Roll back to avoid marking the part as Modified
theSession.UndoToMark(markId1, "NXJ")
theSession.DeleteUndoMark(markId1, "NXJ")
lw.Close()
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module