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:
With best regards
Michael
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