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!

Reading Drawing Revision with GRIP? 1

Status
Not open for further replies.
Replies continue below

Recommended for you

I doubt it. GRIP has not been enhanced since that 'Revision' option was added to NX, however, if that revision is actually captured as an attribute, GRIP might be able to access it.

That being said, it might be better to use a Journal for something like this.

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA
Siemens PLM:
UG/NX Museum:

The secret of life is not finding someone to live with
It's finding someone you can't live without
 
Thanks for the quick reply. The title block definition has "$SH_SHEET_REVISION" for the variable. Any way to see that from GRIP? I guess I have to learn UFUNC again... It's been a while.
 
The "$sh_sheet_revision" is probably not available as an attribute that GRIP can read.
A journal program may be able to retrieve it and less trouble than Ufunc to create.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Here is a quick journal that reports the sheet name, number, and revision of each drawing sheet in the current work part.

Code:
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

www.nxjournaling.com
 
Thanks Cowski! I've been using your code and learning Journaling.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor