Hi,
To check in a display part the following code would help.But need to add few more checks for identifying interpart exps, geometric exps ....
Try executing this as a journal
Imports System
Imports System.Windows.Forms
Imports System.Collections
Imports NXOpen
Imports NXOpen.Assemblies
Imports NXOpenUI
Imports NXOpen.Utilities
Imports NXOpen.UF
Public Module query
Public UFS As UFSession = UFS.getufsession
Public NTS As Session = NTS.getsession
Sub Main()
Try
' / Get the displayed part /
Dim dispPart As Part = NTS.Parts.Display
' / Retrieve part expressions /
Dim partExps As ExpressionCollection = dispPart.Expressions
Dim unusedExps As New ArrayList
Dim t_expn As Expression
' / Iterate through the expressions in the part /
For Each t_expn In partExps
If (t_expn.GetOwningFeature Is Nothing) Then
' / Add the unused expression into arraylist /
unusedExps.Add(t_expn)
' / Direct the information to window /
writeToWindow(t_expn.Name + " : " + t_expn.Value.ToString)
End If
Next
Catch ex As Exception
MessageBox.Show("Retrieving expression not sucessful", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Sub writeToWindow(ByVal strContent As String)
Try
' / Check for the status of the listing window /
If Not (NTS.ListingWindow.IsOpen) Then
NTS.ListingWindow.Open()
End If
NTS.ListingWindow.WriteLine(strContent)
Catch ex As Exception
MessageBox.Show("Unable to write to listing output device", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub