3dr
Automotive
- Jul 10, 2004
- 456
I'm trying to use the code below to test if a part is already open in the session.
If False, Show message box and don't execute the code.
If True, Execute the rest of the journal.
But I'm getting a "MessageBox is not declared" error
What am I missing here??
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
----------------------------------------------
Menu: Assemblies->Components->Add Component...
----------------------------------------------
Dim pfile As String = "Proj Data.prt"
For each openPart as part in theSession.Parts
if openPart.FullPath = pfile then
MessageBox.Show ("part is already open")
else
MessageBox.Show ("code to open part")
end if
next
Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures
NX1851, Win 10 Pro
If False, Show message box and don't execute the code.
If True, Execute the rest of the journal.
But I'm getting a "MessageBox is not declared" error
What am I missing here??
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
----------------------------------------------
Menu: Assemblies->Components->Add Component...
----------------------------------------------
Dim pfile As String = "Proj Data.prt"
For each openPart as part in theSession.Parts
if openPart.FullPath = pfile then
MessageBox.Show ("part is already open")
else
MessageBox.Show ("code to open part")
end if
next
Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures
NX1851, Win 10 Pro