Ehaviv
Computer
- Jul 2, 2003
- 1,012
Hi
The following example found in plm forum.
I follow its instruction the result its an error.
THANK YOU FOR ANY HELP.
THE ERROR:
THE JOURNAL:
Thank you.
The following example found in plm forum.
I follow its instruction the result its an error.
THANK YOU FOR ANY HELP.
THE ERROR:
Code:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly
'NXOpen, Version=11.0.0.33, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified.
File name: 'NXOpen, Version=11.0.0.33, Culture=neutral, PublicKeyToken=null'
at batch_2.Main(String[] args)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
THE JOURNAL:
Code:
'I don't see anyplace where you open a part. A batch program can open
' a part either by having it hard-coded in your program, or more commonly
' by passing it on the command line. If you have built the .EXE,
' something like this should work:
'Run the program from the command line like this:
'myProgram.exe D:\Path\to\Part\thePart.prt
Option Strict Off
Imports System
Imports NXOpen
Module open_part_from_command_line_argument
Sub Main(ByVal args As String())
Try
Dim theSession As Session = Session.GetSession()
Dim loadStatus As NXOpen.PartLoadStatus = Nothing
Dim thePart As Part = theSession.Parts.OpenDisplay(args(0), loadStatus)
Console.OpenStandardOutput()
Console.WriteLine()
Console.WriteLine("Part " + thePart.FullPath + " was opened successfully.")
Console.WriteLine()
theSession.Parts.CloseAll(BasePart.CloseModified.CloseModified, Nothing)
Catch ex As Exception
Console.OpenStandardOutput()
Console.WriteLine(ex.ToString)
Console.WriteLine()
End Try
End Sub
End Module
Thank you.