Ram K
Mechanical
- Apr 17, 2018
- 56
Hi
I am trying to learn NX Open by using VB. I have made simple code to bring up a message box and listing window. I have compiled it thru Visual Studio and executed the dll file. Attached error message is occurring after running the dll. When same code is executed via NX journal player it gave proper result. Is there any settings required to compile via Visual Studio. Please help me in this. Any kind of help is highly appreciate.
I got same kind of error message with C# code also. I have attached both images.
Below is the VB code.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpenUI
Public Class Class1
Sub Main(ByVal args() As String)
Dim myses As Session = Session.GetSession()
Dim myui As UI = UI.GetUI()
Dim lw As ListingWindow = myses.ListingWindow
lw.Open()
lw.WriteLine("best wishes")
Dim mymes As NXMessageBox = myui.NXMessageBox
mymes.Show("Title", NXMessageBox.DialogType.Information, "Best Wishes")
End Sub
Public Shared Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = Session.LibraryUnloadOption.Immediately
End Function
End Class
I am trying to learn NX Open by using VB. I have made simple code to bring up a message box and listing window. I have compiled it thru Visual Studio and executed the dll file. Attached error message is occurring after running the dll. When same code is executed via NX journal player it gave proper result. Is there any settings required to compile via Visual Studio. Please help me in this. Any kind of help is highly appreciate.
I got same kind of error message with C# code also. I have attached both images.
Below is the VB code.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpenUI
Public Class Class1
Sub Main(ByVal args() As String)
Dim myses As Session = Session.GetSession()
Dim myui As UI = UI.GetUI()
Dim lw As ListingWindow = myses.ListingWindow
lw.Open()
lw.WriteLine("best wishes")
Dim mymes As NXMessageBox = myui.NXMessageBox
mymes.Show("Title", NXMessageBox.DialogType.Information, "Best Wishes")
End Sub
Public Shared Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = Session.LibraryUnloadOption.Immediately
End Function
End Class