×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Reading Drawing Revision with GRIP?

Reading Drawing Revision with GRIP?

RE: Reading Drawing Revision with GRIP?

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

RE: Reading Drawing Revision with GRIP?

(OP)
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.

RE: Reading Drawing Revision with GRIP?

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

RE: Reading Drawing Revision with GRIP?

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

RE: Reading Drawing Revision with GRIP?

(OP)
Thanks Cowski! I've been using your code and learning Journaling.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources