|
发表于 2010-1-23 22:03:55
|
显示全部楼层
圆心(点)是数组,得分别比较三个坐标才行.- 1 |6 N- ]: \; n4 Y* C
- Dim SS As AcadSelectionSet, FT(0) As Integer, FD(0) As Variant, C1 As AcadCircle, C2 As AcadCircle, I As Long, J As Long
" U# E( O8 L% b* b; f! z - FT(0) = 0: FD(0) = "Circle"1 u8 J4 i" r2 l3 }6 ~* W/ H, M6 C
- Set SS = ThisDrawing.SelectionSets.Add("SS")
0 B0 W) i# B$ S- d - SS.Select acSelectionSetAll, , , FT, FD
[% P9 c/ o$ j# b0 V - If SS.Count > 1 Then
: _! P5 _! v9 N9 }( Z4 O - For I = SS.Count - 1 To 1 Step -1
2 ^" G4 Z& t/ W) k - Set C1 = SS.Item(I)- z7 J1 _+ N, w3 S8 u
- For J = I - 1 To 0 Step -19 M, `) u( C S% E# H% ]
- Set C2 = SS.Item(J)
& [; s( K! e) f- }# i8 j& a - If C1.Center(0) = C2.Center(0) And C1.Center(1) = C2.Center(1) And C1.Center(2) = C2.Center(2) And C1.Radius = C2.Radius Then( K4 ~/ Q4 f0 t- J2 J* ?5 q
- C1.Delete- \, V4 A' a2 f$ M: Z9 A# I
- Exit For* e( S, |/ Q: M, `. l& d4 S
- End If: ?& G# r) P' d W$ D& L
- Next
8 ]8 W- l7 g) i6 V( i - Next
& ^) r' d& X9 W. U - End If# k+ E' h4 |/ p
- SS.Delete
8 b6 x# B4 ~- g" A3 ]. w/ M f4 V# J
复制代码 |
|