浏览代码

Create cut_lines.bas

蘭雅sRGB 3 年之前
父节点
当前提交
5dbc9093e3
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24 0
      cut_lines.bas

+ 24 - 0
cut_lines.bas

@@ -0,0 +1,24 @@
+Sub cut_lines()
+    ActiveDocument.Unit = cdrMillimeter
+    Bleed = 2
+    line_len = 3
+    Dim s As Shape
+    Dim line As Shape
+    For Each s In ActiveSelection.Shapes
+       cx = s.CenterX
+       cy = s.CenterY
+       sw = s.SizeWidth
+       sh = s.SizeHeight
+       
+       If sw > sh Then
+        s.Delete
+        Set line = ActiveLayer.CreateLineSegment(0, cy, 0 + line_len, cy)
+       End If
+       
+       If sw < sh Then
+        s.Delete
+        Set line = ActiveLayer.CreateLineSegment(cx, 0, cx, 0 + line_len)
+       End If
+       
+    Next s
+End Sub