NX Retrieve latest revision using NXOpen

2021-11-10T21:17:01Z
NX Open NX System Administration

Summary


Details

How do you retrieve the latest revision of an item_id in NXOpen(CS)?

Solution

           ListingWindow lw = theSession.ListingWindow;          
           Tag partTag;
           Tag[] revs;
           int count;
           string revid;

           theUFSession.Ugmgr.AskPartTag("000108", out partTag);
           theUFSession.Ugmgr.ListPartRevisions(partTag, out count, out revs);
           theUFSession.Ugmgr.AskPartRevisionId(revs[count - 1], out revid);
           lw.Open();
           lw.WriteLine("Count="+count+" LATEST REV="+revid);

Output from information window

ItemRevision in RAC




Hardware/Software Configuration

Platform: AMD64
OS: windows
OS Version: 10-2004
Product: NX
Application: SYSENG
Version: V1926
Function: NXOPEN

Ref: 002-8594716

KB Article ID# PL8594716

Contents

SummaryDetails

Associated Components

Block/UI Interface Stylers Knowledge Fusion Menuscript NX Open - All Languages NX Open Python Open for C/C++ Open for CAE Open for GRIP Open for Java Pre-NX6 UI Styler SNAP UDO