#2
HVB62017-10-17 11:08
回复 楼主 Mountisky
|
程序代码:
'需要中surfaceBodies.Face 中找出所有类型为kPlanesurFace的面,For语句应该如何用
Dim i As Integer
Dim oCylFace1(i) As Face
oCylFace1(i) = Nothing
For i = 0 To 2 Step 1
For Each oFace In oCylinder1.SurfaceBodies(1).Faces
If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then
oCylFace1(i) = oFace
End If
Next
Next
Dim i As Integer
Dim oCylFace1(i) As Face
oCylFace1(i) = Nothing
For i = 0 To 2 Step 1
For Each oFace In oCylinder1.SurfaceBodies(1).Faces
If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then
oCylFace1(i) = oFace
End If
Next
Next
我希望能在oCylinder1.SurfaceBodies(1).Faces ,找出SurfaceType 为kPlaneSurface 的面,我知道有3个面。,应该如何找出来,,不是应该用for next语句么。请大家帮我看看哪里不对。
异常信息为
“System.IndexOutOfRangeException”类型的未经处理的异常在 TEST3.exe 中发生
其他信息: 索引超出了数组界限。