admin 发表于 2018-10-1 17:42:25

NX二次开发源码分享: 判断程序是外部运行方式还是内部?



NX二次开发源码分享: 判断程序是外部运行方式还是内部?


Imports NXOpen

Module NXJournal

    Dim theSession As Session = Session.GetSession()

    Sub Main

      If theSession.IsBatch
      Echo("This is being run in Command Line (Batch) Mode NX")
      Else
      Echo("This is being run in Interactive Mode NX")
      End If

    End Sub


    Sub Echo(ByVal output As String)
      theSession.ListingWindow.Open()
      theSession.ListingWindow.WriteLine(output)
      theSession.LogFile.WriteLine(output)
    End Sub

End Module
页: [1]
查看完整版本: NX二次开发源码分享: 判断程序是外部运行方式还是内部?