如何检查数组中的值是否更高。 我的情况是Designpoints计数= 12,FromNode值= 11。问题是DesignPoints(12)不存在,因为Designpoints从0开始计数。我在“ If Designpoints(FromNode + 1).tag =” WALL“ then” 中收到错误 获取和错误 “索引超出范围。必须为非负数,并且小于集合的大小。 参数名称:索引”
For gcount = 0 To GroundPoints.Count - 2
For Dcount = 0 To Designpoints.Count - 2
If Designpoints(FromNode + 1).tag = "WALL" Then
polygon.PolyGonType = XpolyType.StructureCut
customPolygon.Add(polygon)
Else
有什么方法可以检查FromNode值是否始终小于Designpoints值。 我试图检查类似情况
If Designpoints.count > FromNode + 1 And Designpoints(FromNode + 1).tag = "WALL" Then
还尝试将“ Designpoints(FromNode + 1).tag =“ WALL”“放入“ If Designpoints.count> FromNode + 1”循环中