suppress

hi,

i want to know how to suppress multiple features in same part file (like blend(2), blend(3), blend(4)) etc this can be any i dont know the number
i was trying to have a loop but it didnt work

' Dim features1(0) As Features.Feature
' Dim edgeBlend1 As Features.EdgeBlend = CType(workpart.Features.FindObject("BLEND" & i.ToString), Features.EdgeBlend)

' features1(0) = edgeBlend1
' workpart.Features.SuppressFeatures(features1)

thanks in advance

If you are looking to suppress all the blends in the model, here is one way to do it (no error checking).


Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpen.Features

Module Module1

Sub Main()

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work

Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()

Dim featArray() As Feature = theSession.Parts.Work.Features.GetFeatures()
Dim blends As New List(Of Feature)

'lw.WriteLine("*** All Features ***")
For Each myFeature As Feature In featArray
'lw.WriteLine(myFeature.GetFeatureName)
'lw.WriteLine(myFeature.FeatureType)
If myFeature.FeatureType = "BLEND" Then
blends.Add(myFeature)
End If
'lw.WriteLine("")
Next
lw.Close()

Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Suppress Blends")

workPart.Features.SuppressFeatures(blends.ToArray)

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

End Function

End Module

thanks alot....