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!

Interpart expression report

Status
Not open for further replies.

niedzviedz

Mechanical
Apr 1, 2012
307
Hello everyone,

I have some problem to solve - I have new assembly with some parts copied from different assembly with interpart link pointing to old one. Every time I open this assembly I receive error message, that NX cannot find some part, to update those links. We don't have advanced "wave link" license, so I wanna use NX journal to display which part in assembly has interpart link and where it points, and maybe link status. What I achieve right now is journal which display "owning part" but I would also have expression name and link status. Can someone can help with it. I looked in API doc, but can't find this two options. Below is some code for single part:
Code:
Imports System
Imports NXOpen
Imports System.Collections.Generic

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
dim lw As ListingWindow = theSession.ListingWindow

theSession.Preferences.Modeling.UpdatePending = False

Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")

theSession.SetUndoMarkName(markId1, "Expressions Dialog")

Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Expression")

Dim refparts() As String = workPart.Expressions.GetInterpartReferences()

For Each refpart As String In refparts
	lw.writeline(refpart)
Next


theSession.SetUndoMarkName(markId1, "Expressions")
theSession.DeleteUndoMark(markId2, Nothing)

End Sub
End Module

With best regards
Michael
 
Replies continue below

Recommended for you

This is NX version ..?
I think that the message shown in NX10( and later) is pretty self explanatory , once one has learnt to read the syntax.
Do you need this code ?


Regards,
Tomas


 
Hello Tomas, Sorry but I don't understand Your questions.

1. Yes this is NX version of code, or maybe You are asking of my NX version? Right now I'm using NX 10 and NX 11. In the future I will move to 12.

2. Message in NX 11 is not clear, it only shows that inter-part expression from some part (I don't know which one) point to some part, which is missing, because I copied it from different assembly.
I have a assembly with very large structure, and inter-part expressions are in almost every part, sometimes between main file and the others, and sometimes it's in the opposite direction. To be clear I have created my own Mould base, so it use expressions on many levels, to update when I change some parameters. To speed up designing process of mould I copy some elements from one mould to another, so the interpat expression can be not updated. That's why NX show messages.

3. Yes I need this code, to localize which part has expression with status "out of date" or something similar. In example above, I only process one part (workpart) to list which expressions are interpart, but the result is only "owning pat" so I wanna increase it to display more parameters like name of expression and it status.

If we have wave link license, it will be more easier.

Maybe there is some function in HD3D?

With best regards
Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor