Twullf
Mechanical
- Jan 24, 2012
- 196
X-posted to GTAC Support Forums.
I have an automation I use very frequently. I have made no changes to it and have not updated NX, currently version 7.5. However now suddenly the program just cycles away and never achieves anything. I have managed to narrow down where the code is failing. This is a while statement I haven't changed since the first iteration of the program.
I have no idea why this is suddenly a problem, any help would be greatly appreciated.
UPDATE: I have tried multiple different Do / While Loops all of them just continue to run without ever accomplishing anything. While in Modeling this is a problem.
However things seem to work just fine if run in Drafting.
I have an automation I use very frequently. I have made no changes to it and have not updated NX, currently version 7.5. However now suddenly the program just cycles away and never achieves anything. I have managed to narrow down where the code is failing. This is a while statement I haven't changed since the first iteration of the program.
Code:
While Not line is Nothing
If Len( Trim( line )) > 0 then
Try
strings = line.Split( vbTab )
pt1.x = Double.Parse( strings(0) )
pt1.y = Double.Parse( strings(1) )
pt1.z = Double.Parse( strings(2) )
Catch
MessageBox.Show( "Spline data file " & strFile & " must be tab deliminted," & _
" and located in " & strDir, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error )
Exit Sub
End Try
'------------------------------------------------------------------------------------------
' Create an array of points, each array value containing a single point
'------------------------------------------------------------------------------------------
ReDim Preserve ArrayofPoints( count )
ArrayOfPoints( count ) = workPart.Points.createPoint(pt1)
'------------------------------------------------------------------------------------------
' Increase count value by 1, Read the next line of the file and continue While statement
'------------------------------------------------------------------------------------------
count = count + 1
line = sr.ReadLine()
End If
End While
UPDATE: I have tried multiple different Do / While Loops all of them just continue to run without ever accomplishing anything. While in Modeling this is a problem.
However things seem to work just fine if run in Drafting.