In NX open I would want to get the Variant Rule names like shown in the dialog.
SVR_SPhere and SVR_BLock. Is this possible in VBnet
How to get the values of the box below:
' NX 1980.1700
' Please NOTE that the sample code below is for reference only, please modify if necessary.
'
Imports System
Imports NXOpen
Module NXJournal
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Sub Echo(ByVal output As String)
theSession.ListingWindow.Open()
theSession.ListingWindow.WriteLine(output)
theSession.LogFile.WriteLine(output)
End Sub
Sub Main (ByVal args() As String)
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
' Menu: Assemblies->Variant Configuration...
Dim variantRulesConfigurationBuilder1 As NXOpen.PDM.VariantRulesConfigurationBuilder = Nothing
variantRulesConfigurationBuilder1 = theSession.ConfigurationManager.CreateVariantRulesConfigurationBuilder(workPart)
' Dialog Begin Select Product Assembly
Dim variantrules1() As String
variantrules1 = variantRulesConfigurationBuilder1.GetVariantRulesForProductAssembly("000069", "")
' ONLY PRINT 1 ENTRY for testing purpose, value are "4, BLUE", please refer to Information dialog above.
Echo(variantrules1.Length)
Echo(variantrules1(0))
End Sub
End Module
Notes