|
发表于 2010-1-23 22:03:55
|
显示全部楼层
圆心(点)是数组,得分别比较三个坐标才行.- + c2 g2 d: Z$ y& c# U9 M: O9 D7 t( B( O
- Dim SS As AcadSelectionSet, FT(0) As Integer, FD(0) As Variant, C1 As AcadCircle, C2 As AcadCircle, I As Long, J As Long+ F$ D7 d% |. K7 h
- FT(0) = 0: FD(0) = "Circle"$ f# T! p+ u0 c8 e: n6 r- x
- Set SS = ThisDrawing.SelectionSets.Add("SS")
/ d" \- J, v8 K, i0 n: f9 a- ] - SS.Select acSelectionSetAll, , , FT, FD
* D7 r: D" }$ O% @2 a6 E7 } - If SS.Count > 1 Then
, t: p% `5 Q8 G - For I = SS.Count - 1 To 1 Step -1/ q8 E9 G8 Q9 m# _% ^4 K
- Set C1 = SS.Item(I)3 y2 M$ j8 N* S- d, d' G G
- For J = I - 1 To 0 Step -1
; p% T# E* H p0 N( x U3 m: d - Set C2 = SS.Item(J)
5 Q& h' {# l/ i* @ - 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+ t8 y( F0 w+ l, L8 m2 k# P# Z% ], X
- C1.Delete
% t: r1 f1 U& m: l - Exit For, U; ]" ?/ S+ j. P+ t$ l ^7 n
- End If6 T- B4 e, s8 l! P' _3 W
- Next! P. W4 z0 k" ~% h, ^, K
- Next
( ~- f6 g3 p. y* F0 E& H, Y/ }, D( z - End If) @4 ]7 r' s- g
- SS.Delete
4 `; {3 u+ M7 A- }0 ^% o6 _* A1 ~7 D
复制代码 |
|