iCAx开思网

标题: VB.NET 给层命名问题-附源代码 [打印本页]

作者: zhaojianhong    时间: 2010-3-21 14:16
标题: VB.NET 给层命名问题-附源代码
大家好用NET给层随便命个名字,可是一直报错:如图,可找不出原因,那个高手请出手帮忙。我感觉函数引用没错呀[attach]998005[/attach]
下面是代码
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
作者: yl.fu    时间: 2010-3-21 19:12
e4w6ej9aHt2v7
作者: zhangcanwei    时间: 2010-3-23 07:17
估计是CategoryInfo类需要进行对象引用,需要声明为实例对象才行
作者: UG008    时间: 2010-3-23 19:22
对话“f”I窗体你要先创建好
mports NXOpen
Imports NXOpen.UF
Imports System.Text
Module Module1
    '  Explicit Activation
    '      This entry point is used to activate the application explicitly

        Dim theSession As Session = Session.GetSession()
        'Dim theUI As UI = NXOpen.UI.GetUI()
         Dim theUfSession As UFSession = UFSession.GetUFSession()
        Dim workPart As Part = theSession.Parts.Work
        Dim displayPart As Part = theSession.Parts.Display
    Sub Main()

        Dim f As New Form1
        f.ShowDialog()
        ' TODO: Add your application code here
    End Sub
Sub SXM()
         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
    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
    End Function
End Module
由常州众城模具设计公司提供资料QQ::119453418
作者: ugman    时间: 2010-4-17 19:16
学习了。YYYYY




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3