Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX open code execution error

Status
Not open for further replies.

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
 
Replies continue below

Recommended for you

At a guess, try changing

Code:
Sub Main(ByVal args() As String)

to

Code:
Public Shared Sub Main(ByVal args() As String)

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor