我是这么搞得,好像太繁了,不知道有没有更好的方法,大家一起讨论一下
Dim Min_pt(0 To 2) As Double, Max_pt(0 To 2) As Double Dim Min_t(0 To 2) As Double, Max_t(0 To 2) As Double
For Each sobj In myss
sobj.GetBoundingBox minExt, maxExt Min_pt(0) = minExt(0): Min_pt(1) = minExt(1): Min_pt(2) = minExt(2) Max_pt(0) = maxExt(0): Max_pt(1) = maxExt(1): Max_pt(2) = maxExt(2)
Min_t(0) = minExt(0): Min_t(1) = minExt(1): Min_t(2) = minExt(2) Max_t(0) = maxExt(0): Max_t(1) = maxExt(1): Max_t(2) = maxExt(2) If Min_t(0) < Min_pt(0) Then Min_pt(0) = Min_t(0) If Min_t(1) < Min_pt(1) Then Min_pt(1) = Min_t(1) If Max_t(0) > Max_pt(0) Then Max_pt(0) = Max_t(0) If Max_t(1) > Max_pt(1) Then Max_pt(1) = Max_t(1) End If Next |