- Сообщения
- 23
- Реакции
- 0
Помогите допилить макрос
Sub Macro1()
Dim i As Long, t As Boolean
t = True
Do While t
t = False
For i = 1 To ActiveLayer.Shapes.Count - 1
S1 = Sqr((-100000 - ActiveLayer.Shapes.Item(i).CenterY) ^ 2 + (100000 - ActiveLayer.Shapes.Item(i).CenterX) ^ 2)
S2 = Sqr((-100000 - ActiveLayer.Shapes.Item(i + 1).CenterY) ^ 2 + (100000 - ActiveLayer.Shapes.Item(i + 1).CenterX) ^ 2)
If S1 < S2 Then
ActiveLayer.Shapes(i).OrderBackOf ActiveLayer.Shapes(i + 1)
t = True
End If
Next i
Loop
End Sub
Sub Macro1()
Dim i As Long, t As Boolean
t = True
Do While t
t = False
For i = 1 To ActiveLayer.Shapes.Count - 1
S1 = Sqr((-100000 - ActiveLayer.Shapes.Item(i).CenterY) ^ 2 + (100000 - ActiveLayer.Shapes.Item(i).CenterX) ^ 2)
S2 = Sqr((-100000 - ActiveLayer.Shapes.Item(i + 1).CenterY) ^ 2 + (100000 - ActiveLayer.Shapes.Item(i + 1).CenterX) ^ 2)
If S1 < S2 Then
ActiveLayer.Shapes(i).OrderBackOf ActiveLayer.Shapes(i + 1)
t = True
End If
Next i
Loop
End Sub