Close NX Part in VB ?
Close NX Part in VB ?
Hello,
I am novice in VB and I search to understand why my programm generate an error when i want to close a NX part.
See below a small programm test and the message information about the error.
My small prg test :
Try
Dim MYPart As Part = theSession.Parts.NewDisplay("G:\Temp\Test.prt", Part.Units.Millimeters)
MYPart.Close(BasePart.CloseWholeTree.True, BasePart.CloseModified.CloseModified, Nothing)
Catch ex As Exception
Dim MyWindows As NXOpen.ListingWindow = theSession.ListingWindow
MyWindows.Open()
MyWindows.WriteLine(ex.ToString)
End Try
The error information :
Close part System.NotImplementedException: The method or operation is not implemented.
at Repertoire_STD.Module1.Main() in C:\1_DELPHI\Programmation\VB\Repertoires\Repertoire_STD\Module1.vb:line 425
thanks for your help and best regards,
S. TYTGAT





RE: Close NX Part in VB ?
Your code executes without error when pasted into a new journal in the NX journal editor and it is "run" - so the syntax is fine.
The boilerplate for an NX journal includes the directive
CODE
which implements exception handling.
Is this missing, perhaps?
Regards, Joe
RE: Close NX Part in VB ?
Thanks for your answer but unfortunately, the CODE "Imports System" is already add.
If you have other information to support me, it would be appreciate.
Best regards,
S. TYTGAT
RE: Close NX Part in VB ?
C#:
MainSession.Parts.CloseAll(BasePart.CloseModified.CloseModified, null);
Are you sure that your error is being thrown by the close operation?
RE: Close NX Part in VB ?
www.nxjournaling.com
RE: Close NX Part in VB ?
Line 425 :
MYPart.Close(BasePart.CloseWholeTree.True, BasePart.CloseModified.CloseModified, Nothing)
Thx and best regards,
S. TYTGAT
RE: Close NX Part in VB ?
CODE
www.nxjournaling.com
RE: Close NX Part in VB ?
Always the same error message :
System.NotImplementedException : The method or operation is not implemented.
Thanks,
S. TYTGAT
RE: Close NX Part in VB ?
www.nxjournaling.com
RE: Close NX Part in VB ?
Are you running any other NX functions in your script that execute just fine, or is the Close operation the only thing your script does?
RE: Close NX Part in VB ?
I have imported the NXOpen.
I execute differents function without problem in my script. It's only the close operation which don't execute correctly.
But i found another mistake : my script execute correctly on my machine (except the Close function) but do not execute on other computer with error message in attached file.
I am completly lost!
Best regards,