Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpen.UF
Module Module1
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
Dim displayModification1 As DisplayModification
Dim facecolor as integer = 160
Sub Main()
lw.Open()
Dim threadFeatures As New List(Of Features.Feature)
Dim threadFaces As New List(Of Face)
For Each myFeature As Features.Feature In workPart.Features
If myFeature.FeatureType.ToUpper = "SYMBOLIC_THREAD" Then
threadFeatures.Add(myFeature)
End If
Next
Dim myThreadParameters As UFModl.SymbThreadData
For Each myFeature As Features.Feature In threadFeatures
theUfSession.Modl.AskSymbThreadParms(myFeature.Tag, myThreadParameters)
Dim threadedFace As Face
threadedFace = Utilities.NXObjectManager.Get(myThreadParameters.cyl_face)
threadFaces.Add(threadedFace)
Next
displayModification1 = theSession.DisplayManager.NewDisplayModification()
With displayModification1
.ApplyToAllFaces = False
.NewColor = facecolor
.Apply(threadFaces.toarray)
.Dispose()
End With
lw.Close()
End Sub
End Module