Option Strict On Imports System Imports System.Windows.Forms Imports NXOpen Module NXJournal Sub Main () Dim sess As Session = Session.GetSession() Dim wp As Part = sess.Parts.Work If wp Is Nothing Then Exit Sub Dim u1 As Unit = wp.UnitCollection.GetBase("Area") Dim u2 As Unit = wp.UnitCollection.GetBase("Length") Dim resp As Selection.Response Dim fac As TaggedObject = Nothing Dim mf As MeasureFaces Do resp = UI.GetUI.SelectionManager.SelectTaggedObject("Select a Face to analyse", "Face Selection", Selection.SelectionScope.WorkPart, False, {Selection.SelectionType.Faces}, fac, Nothing) If resp <> Selection.Response.ObjectSelected Then Exit Do mf = wp.MeasureManager.NewFaceProperties(u1, u2, 0.99, {CType(fac, Face)}) MessageBox.Show("Area is " & mf.Area.ToString("F2") & " " & u1.Abbreviation) mf.Dispose() Loop While resp = Selection.Response.ObjectSelected End Sub End Module