Run-time error when creating a WorkPoint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a subroutine which creates a WorkPoint with respect to some adjacent components in an assembly. As it happens, this subroutine is called twice; once for each of two different instances of a class. The particular snippet within the sub is:
Dim LowerYPt As WorkPoint = Nothing
Try
LowerYPt = AssyCompDef.WorkPoints.AddFixed(TG.CreatePoint(thisX, thisY, thisZ))
Catch ex As Exception
MsgBox(ex.ToString)
End Try
At least one of the X, Y and Z values are different for the two passes.
On the first pass, it runs fine. On the second pass, I get a runtime error:
“System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) at System.RuntimeType……….”
Any ideas why it won’t run the second time?
Software Programmer
Draper, Inc.