×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Close NX Part in VB ?

Close NX Part in VB ?

Close NX Part in VB ?

(OP)

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 ?

S. TYTGAT,

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

Imports System

which implements exception handling.

Is this missing, perhaps?

Regards, Joe

RE: Close NX Part in VB ?

(OP)
Hello,

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 ?

I'm not sure about the close function since I typically use the CloseAll function

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 ?

Your error information indicates line 425, would you be so kind as to highlight line 425 for us?

www.nxjournaling.com

RE: Close NX Part in VB ?

(OP)

Line 425 :

MYPart.Close(BasePart.CloseWholeTree.True, BasePart.CloseModified.CloseModified, Nothing)

Thx and best regards,

S. TYTGAT

RE: Close NX Part in VB ?

I made a quick test journal based on your code, run it and see if you get any errors.

CODE

Option Strict Off Imports System Imports NXOpen Module Module1 Sub Main() Dim theSession As Session = Session.GetSession() Dim lw As ListingWindow = theSession.ListingWindow lw.Open() Dim tempPart As String tempPart = IO.Path.GetTempPath tempPart = IO.Path.Combine(tempPart, "test.prt") Try Dim myPart As Part = theSession.Parts.NewDisplay(tempPart, Part.Units.Millimeters) MsgBox("part created") myPart.Close(BasePart.CloseWholeTree.True, BasePart.CloseModified.CloseModified, Nothing) MsgBox("part closed") Catch ex As Exception lw.WriteLine(ex.GetType.ToString & " : " & ex.Message) Finally lw.Close() End Try End Sub End Module

www.nxjournaling.com

RE: Close NX Part in VB ?

(OP)
Hi,

Always the same error message :


System.NotImplementedException : The method or operation is not implemented.

Thanks,

S. TYTGAT

RE: Close NX Part in VB ?

What operating system and version of NX are you running?

www.nxjournaling.com

RE: Close NX Part in VB ?

Are you sure you have you imported the NXOpen namespace?

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 ?

(OP)
NX 7.5.4.4 on Win XP64 bits.
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,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources