1
1

cut_lines.bas 561 B

123456789101112131415161718192021222324
  1. Sub cut_lines()
  2. ActiveDocument.Unit = cdrMillimeter
  3. Bleed = 2
  4. line_len = 3
  5. Dim s As Shape
  6. Dim line As Shape
  7. For Each s In ActiveSelection.Shapes
  8. cx = s.CenterX
  9. cy = s.CenterY
  10. sw = s.SizeWidth
  11. sh = s.SizeHeight
  12. If sw > sh Then
  13. s.Delete
  14. Set line = ActiveLayer.CreateLineSegment(0, cy, 0 + line_len, cy)
  15. End If
  16. If sw < sh Then
  17. s.Delete
  18. Set line = ActiveLayer.CreateLineSegment(cx, 0, cx, 0 + line_len)
  19. End If
  20. Next s
  21. End Sub