PeterOliver
Mechanical
- Aug 10, 2012
- 4
I am writing a journal file which is designed to extract a composite curve from a selected edge (or group of edges), assign it some attributes, and also give it a bright color so the user knows they've already done the process on that edge, after the process. Everythiing runs flawlessly, with the exception of the color change.
The error I'm getting is this: "NXOpen.NXException: Null tag not allowed"
at NXOpen.DisplayModification.Apply(DisplayableObject[] objects)
at [tool name].ColorChange(CompositeCurve_curve3) in [file location]:line 625
at [tool name].apply_cb() in [file location]:line 277
Line 277 is where the function is called. Line 625 is where my issue is. Here's mycode:
.
.
.
ColorChange(compCurve)
.
.
.
Public Function ColorChange(ByRef curve3 As Features.CompositeCurve) ', ByRef WeldName As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim curves1() As Curve
curves1 = GetCurvesOfCompositeCurve(curve3) 'this extracts all the curve ibjects from the composite curve feature as an array of curves
Dim dispObjs(curves1.Length - 1) As DisplayableObject
For i As Integer = 0 To curves1.Length - 1
dispObjs(i) = CType(curves1(i), DisplayableObject)
Next
Dim displayModification1 As DisplayModification
displayModification1 = theSession.DisplayManager.NewDisplayModification()
displayModification1.NewColor = 3
displayModification1.Apply(dispObjs) 'this is line 625
displayModification1.Dispose()
End Function
I'd really appreciate any advice anyone can offer, I have almost no experience with programming and this specific function has given me lots of grief.
Please let me know if any more information.
Thank you,
Peter
The error I'm getting is this: "NXOpen.NXException: Null tag not allowed"
at NXOpen.DisplayModification.Apply(DisplayableObject[] objects)
at [tool name].ColorChange(CompositeCurve_curve3) in [file location]:line 625
at [tool name].apply_cb() in [file location]:line 277
Line 277 is where the function is called. Line 625 is where my issue is. Here's mycode:
.
.
.
ColorChange(compCurve)
.
.
.
Public Function ColorChange(ByRef curve3 As Features.CompositeCurve) ', ByRef WeldName As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim curves1() As Curve
curves1 = GetCurvesOfCompositeCurve(curve3) 'this extracts all the curve ibjects from the composite curve feature as an array of curves
Dim dispObjs(curves1.Length - 1) As DisplayableObject
For i As Integer = 0 To curves1.Length - 1
dispObjs(i) = CType(curves1(i), DisplayableObject)
Next
Dim displayModification1 As DisplayModification
displayModification1 = theSession.DisplayManager.NewDisplayModification()
displayModification1.NewColor = 3
displayModification1.Apply(dispObjs) 'this is line 625
displayModification1.Dispose()
End Function
I'd really appreciate any advice anyone can offer, I have almost no experience with programming and this specific function has given me lots of grief.
Please let me know if any more information.
Thank you,
Peter