Try语句块可以用来保护出错。这是一段实例
Dim arcArray1() As Arc
Dim sketchConstraintArray1() As SketchConstraint
Try
arcArray1 = theSession.ActiveSketch.Fillet(obj1, obj2, obj3, helpPoint1, helpPoint2, helpPoint3, _
1.0, _
Sketch.TrimInputOption.False, _
Sketch.DeleteThirdCurveOption.False, _
Sketch.CreateDimensionOption.False, _
Sketch.AlternateSolutionOption.False, _
sketchConstraintArray1)
Catch exc As NXException
MessageBox.Show("Select 3 curves for tangential constaints " & exc.Message)
theSession.LogFile.WriteLine(exc.Message )
End Try |