ThisMacroStorage.cls 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. VERSION 1.0 CLASS
  2. BEGIN
  3. MultiUse = -1 'True
  4. END
  5. Attribute VB_Name = "ThisMacroStorage"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = False
  8. Attribute VB_PredeclaredId = True
  9. Attribute VB_Exposed = True
  10. Private Sub GlobalMacroStorage_SelectionChange()
  11. On Error GoTo ErrorHandler
  12. Dim n As Long
  13. Dim nr As NodeRange
  14. Dim sh As Shape
  15. If ActiveSelection.Shapes.Count > 0 Then
  16. n = 0
  17. For Each sh In ActiveSelection.Shapes
  18. If sh.Type = cdrCurveShape Then
  19. Set nr = sh.Curve.Selection
  20. n = n + nr.Count
  21. End If
  22. Next sh
  23. If n > 2 Then
  24. LinesForm.Caption = "Nodes: " & n
  25. ElseIf ActiveSelection.Shapes.Count > 1 Then
  26. LinesForm.Caption = "Select: " & ActiveSelection.Shapes.Count
  27. End If
  28. Else
  29. LinesForm.Caption = "LinesForm By Lanya"
  30. End If
  31. If ActiveSelection.Shapes.Count > 2 And AutoDistribute_Key Then
  32. Dim sr As ShapeRange
  33. Set sr = ActiveSelectionRange
  34. sr.Sort "@shape1.left<@shape2.left"
  35. If first_StaticID <> sr.FirstShape.StaticID Then
  36. Average_Distance
  37. End If
  38. End If
  39. ErrorHandler:
  40. End Sub