12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- Sub start()
-
- Application.Optimization = True
- ActiveDocument.BeginCommandGroup
-
- ActiveDocument.Unit = cdrMillimeter
- Bleed = 2
- line_len = 3
- Dim OrigSelection As ShapeRange
- Set OrigSelection = ActiveSelectionRange
-
-
- Dim s1 As Shape
- For Each Target In OrigSelection
- Set s1 = Target
- lx = s1.LeftX: rx = s1.RightX
- by = s1.BottomY: ty = s1.TopY
- cx = s1.CenterX: cy = s1.CenterY
- sw = s1.SizeWidth: sh = s1.SizeHeight
-
-
- Dim s2, s3, s4, s5, s6, s7, s8, s9 As Shape
- Set s2 = ActiveLayer.CreateLineSegment(lx - Bleed, by, lx - (Bleed + line_len), by)
- Set s3 = ActiveLayer.CreateLineSegment(lx, by - Bleed, lx, by - (Bleed + line_len))
- Set s4 = ActiveLayer.CreateLineSegment(rx + Bleed, by, rx + (Bleed + line_len), by)
- Set s5 = ActiveLayer.CreateLineSegment(rx, by - Bleed, rx, by - (Bleed + line_len))
- Set s6 = ActiveLayer.CreateLineSegment(lx - Bleed, ty, lx - (Bleed + line_len), ty)
- Set s7 = ActiveLayer.CreateLineSegment(lx, ty + Bleed, lx, ty + (Bleed + line_len))
- Set s8 = ActiveLayer.CreateLineSegment(rx + Bleed, ty, rx + (Bleed + line_len), ty)
- Set s9 = ActiveLayer.CreateLineSegment(rx, ty + Bleed, rx, ty + (Bleed + line_len))
-
- ActiveDocument.AddToSelection s2, s3, s4, s5, s6, s7, s8, s9
- ActiveSelection.Group
- ActiveSelection.Outline.SetProperties 0.1
- ActiveSelection.Outline.SetProperties Color:=CreateRegistrationColor
-
- Next Target
- ActiveDocument.EndCommandGroup
-
- Application.Optimization = False
- ActiveWindow.Refresh
- Application.Refresh
- End Sub
|