这个出错应该怎么处理?
<p><font face="Verdana"> Public Function CurveLength(ByVal ID As ObjectId, ByRef Len As Double) As Boolean<br/> CurveLength = True<br/> Dim DB As Database = HostApplicationServices.WorkingDatabase</font></p><p><font face="Verdana"> Using Trans As Transaction = DB.TransactionManager.StartTransaction<br/> Try<br/> Dim Ent As Entity = Trans.GetObject(ID, OpenMode.ForRead)<br/> Dim Cur As Curve = Ent '此处如果不是线,会出错,用了TRY了,为什么不能跳到CATCH 处执行<br/> Len = Cur.GetDistanceAtParameter(Cur.EndParam)<br/> Catch ex As Exception<br/> CurveLength = False<br/> MsgBox("不正常")<br/> End Try<br/> End Using<br/> End Function</font></p>
<p> </p>
<p>Dim Cur As Curve = Ent '此处如果不是线,会出错,用了TRY了,为什么不能跳到CATCH 处执行<br/></p> If Ent Is Curve Then <p>谢谢!我想问的是为什么此处出错,不跳到CATCH处执行呢?</p>
页:
[1]