1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- '
- Sub SelectLine_to_Cropline()
- '
- Application.Optimization = True
- ActiveDocument.Unit = cdrMillimeter
-
- '
- px = ActiveDocument.Pages.First.CenterX
- py = ActiveDocument.Pages.First.CenterY
- Bleed = 2
- line_len = 3
-
- Dim s As Shape
- Dim line As Shape
-
- '
- For Each s In ActiveSelection.Shapes
-
- lx = s.LeftX
- rx = s.RightX
- by = s.BottomY
- ty = s.TopY
-
- cx = s.CenterX
- cy = s.CenterY
- sw = s.SizeWidth
- sh = s.SizeHeight
-
- '
- If sh < sw Then
- s.Delete
- If cx < px Then
- Set line = ActiveLayer.CreateLineSegment(0, cy, 0 + line_len, cy)
- Else
- Set line = ActiveLayer.CreateLineSegment(px * 2, cy, px * 2 - line_len, cy)
- End If
- End If
-
- '
- If sh > sw Then
- s.Delete
- If cy < py Then
- Set line = ActiveLayer.CreateLineSegment(cx, 0, cx, 0 + line_len)
- Else
- Set line = ActiveLayer.CreateLineSegment(cx, py * 2, cx, py * 2 - line_len)
- End If
- End If
-
- line.Outline.SetProperties 0.1
- line.Outline.SetProperties Color:=CreateRegistrationColor
- Next s
-
- '
- Application.Optimization = False
- ActiveWindow.Refresh
- Application.Refresh
- End Sub
|