下面是代码
Imports NXOpen
Imports NXOpen.UF
Imports System.Text
Module Module1
' Explicit Activation
' This entry point is used to activate the application explicitly
Sub Main()
Dim f As New Form1
f.ShowDialog()
' TODO: Add your application code here
End Sub
Sub SXM()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
'Dim theUI As UI = NXOpen.UI.GetUI()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim SS As String
Dim categoy As Tag
Dim i As Integer
Dim cat As UFLayer.CategoryInfo
With cat
.name = ss
.descr = ss
For i = 1 To 255
.layer_mask(i) = False
Next
End With
theUfSession.Layer.CreateCategory(cat, categoy)
End Sub