Color and Style Settings Different than the Company Master

This example is for master part. I need help to modify it to be for non-master part, so I can have my own color and style settings.

Option Strict Off

Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpenUI
Imports NXOpen.Utilities

Module create_new_nxmanager_part_from_template

Public s As Session = Session.GetSession()
Public ufs As UFSession = UFSession.GetUFSession()
Public lw As ListingWindow = s.ListingWindow

Sub Main()

  Dim encodedName As String = ""

  Dim encodedTemplateName As String = "@DB/Metric/A"

  Dim partFileName As String = ""
  Dim partTag As NXOpen.Tag = NXOpen.Tag.Null

  Dim partNumber As String = ""
  Dim partRev As String = ""
  Dim partType As String = "Item"

  partNumber = NXInputBox.GetInputString("Part Number:", _
                                 "User Input:", "Part Number")

  partRev = NXInputBox.GetInputString("Revision:", _
                                 "User Input:", "A")

  partType = NXInputBox.GetInputString("Part Type:", _
                                 "User Input:", partType)

  encodedName = "@DB/" + partNumber + "/" + partRev

  ufs.Ugmgr.NewPartFromTemplate(encodedName, partType, _
                                     encodedTemplateName, partTag)

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

  Return Session.LibraryUnloadOption.Immediately

End Function

End Module


The creation of a non-master would need to be changed from your example

encodedName = "@DB/" + partNumber + "/" + partRev

to include the “specification” for file type and the dataset name (of the non-master).

encodedName = "@DB/" + partNumber + "/" + partRev + "/specification/" + datasetName

The item revision (of the master) must already exist.

Above is a snippet.