Twullf
Mechanical
- Jan 24, 2012
- 196
I need to convert my intersection curve to a displayable object, so far everything I have tried has failed.
The error says "System.NullReferenceException: Object reference not set to an instance of an object.
at ModelChecking.MeasureLineLength(IntersectionCurve moldInterLine, String strMoldLength, Boolean boolLength, Unit_unitMM) in" ... "line 676"
Line 676 is the line curves = moldInterLine.GetEntities()
Any help is greatly appreciated.
The error says "System.NullReferenceException: Object reference not set to an instance of an object.
at ModelChecking.MeasureLineLength(IntersectionCurve moldInterLine, String strMoldLength, Boolean boolLength, Unit_unitMM) in" ... "line 676"
Code:
Sub MeasureLineLength( ByRef moldInterLine As Features.IntersectionCurve, ByRef strMoldLength As String, _
ByRef boolLength As Boolean, ByRef unitMM As Unit )
Dim measureDistanceBuilder1 As MeasureDistanceBuilder
Dim measureLength1 As MeasureLength
Dim curves(-1) As NXObject
Dim nullNXObject As NXObject
nullNXObject = Nothing
measureDistanceBuilder1 = workPart.MeasureManager.CreateMeasureDistanceBuilder(nullNXObject)
curves = moldInterLine.GetEntities()
'Try
measureLength1 = workPart.MeasureManager.NewLength( unitMM, curves )
strMoldLength = measureLength1.value.ToString
msgbox("Mold length = " & strMoldLength )
'Catch
'strMoldLength = "Failed To Measure"
'End Try
End Sub
Line 676 is the line curves = moldInterLine.GetEntities()
Any help is greatly appreciated.