What is Weed Box?

Weed Box is a macro for creating "weed boxes" and, optionally, "weed lines" for work such as vinyl cutting.

It can help get from something like this:

to something like this:

See Weed Box in Use:


Basic Workflow.

  • Select content.
  • Use Define Box to create an on-screen preview of the weed box.
  • Create and position Guidelines or 2-node lines that will define weed lines.
  • Use Create to create the weed box and weed lines.

Details: Weed Box & Lines Page.

    

Weed Box:

  • The Margin Size combobox sets the margin between the content and the weed box.
  • The Corner Radius combobox sets the corner radius for the weed box.
  • Clicking Define Box defines, from the selection, the content that is to participate in the creation of the weed box and weed lines. It also creates an on-screen preview of the weed box, and enables the Create button.
  • Clear removes the on-screen preview of the weed box, and disables the Create button.

Weed Lines:

  • The Gap Size combobox defines the gap to be left whenever a weed line is trimmed (either by an object in the box, or by the box itself).
  • The Min. Length combobox defines a minimum allowable length for weed line segments.
  • If Use Shape Boundaries is checked, then for each object in the selection, the boundary is used when trimming weed lines. The "hole" in a letter "O", for example, will not have a weed line segment present in it.

Define Weed LInes (Guidelines page)

  • Horizontal and Vertical create guidelines to be used for defining weed lines. If the on-screen preview of the weed box is visible, then the guideline is centered on that box. If the on-screen preview is not visible, then the guideline is centered to the view. These guidelines can be moved after creation.
  • Tag Selected Guides: In this context, "tag" means, "Take one or more regular guidelines - guidelines that were not created by the macro - and mark them as guidelines to be used when creating weed lines".
  • Hide Guides, Show Guides, and Delete All Guides apply only to guidelines that were created by the macro or have been tagged by the macro.
  • If Auto-delete Guides is checked, then the guides are deleted automatically when a Create action is carried out.

Define Weed Lines (2-node Lines page)

Items in this section allow weed lines to be defined using "2-node lines". In this context, "2-node line" means, "a Curve shape consisting of a single line segment". When weed lines are created, these obey the same rules (for being trimmed, gapped, etc.) as the lines that are defined by guidelines - except that they don't "go on forever" the way that guidelines do, so they allow a different level of control.

  • As with the guidelines, 2-node lines can be created by the macro using Horizontal or Vertical, or they can be created as regular lines, then marked for use by the macro using Tag Selected Lines
  • Hide Lines,Show Lines, and Delete All Lines apply only to 2-node lines that were created by the macro or have been tagged by the macro.
    • Selection of such lines does not have to be a fussy process. If other objects are selected at the same time, then the macro ignores them, and only processes those shapes that qualify as valid 2-node lines. So, it is easy to draw and position a number of 2-node lines, select everything by a rectangular marquee, and then tag all of those lines with one click.
  • If Auto-delete Lines is checked, then the 2-node lines are deleted automatically when a Create action is carried out.

Create creates the weed box and weed lines.

Details: Options Page.

    

Layer

  • if Create on Specified Layer is checked, then the weed box and weed lines are moved to the layer specified by the Layer Name combobox.
    • If no layer exists with the specified name, then the macro will create a layer with that name.

Color

  • If Use Specified Color is checked, then the weed box and weed lines are assigned an outline color as specified by the option buttons and comboboxes in this frame - Spot Color, CMYK Color, or RGB Color.
    • The color is specified by getting if from an object that has an outline of the desired color. Select such an object, use Get from Selection Outline, and a text string for that color should be loaded into the appropriate combobox and added to the list for that combobox.

Line Width

  • If Use Specified Line Width is checked, then the weed box and weed lines are assigned an outline width as specified by the Line Width combobox.
    • That value can be entered manually, or can be acquired by selecting an object with an outline, then using Get from Selection Outline.

Selection

  • Keep Original Objects Selected and Select Weed Box and Lines determine the content that is to be selected after a Create action is carried out.

Using the Comboboxes.

The boxes for numeric entry are comboboxes. The drop-down list for a combobox can contain values stored for convenient access. If a combobox is not locked, then when a value in that combobox is used by the macro, that value is added to the top of the list. If an existing value is used from the list, then that value is moved to the top of the list. Values can also be manually added to the list.

Ctrl+clicking on a combobox sets that combobox to its default value.

Right-clicking on a combobox brings up a menu of options for managing it.

    

These options may include:

  • Setting the combobox to its default value.
  • Defining the default value for the combobox.
  • Adding a value to the list.
  • Deleting a value from the list.
  • Sorting the list.
  • Clearing the list.
  • Locking or unlocking the list. When locked, new values are not added, and the order of values within the list is not changed when an existing value from the list is used.
  • Enabling or disabling Auto-select for the combobox. When Auto-select is enabled, then the text in the box is automatically selected when the box is entered.
  • Setting whether trailing zeros are shown.
  • Changing the number of decimal places used for values in the combobox.
  • Specifying the units.

Units of Distance.

For a combobox that represent a distance, values are applied by the macro in whatever units (inches, millimeters, etc.) are shown beside the combobox. Those units can be specified by the user through the right-click context menu.

If “Follow Horizontal Ruler Units” is chosen, then the units for the combobox are the same units that are in use in the document for the horizontal ruler. If those units are changed in the document, then the macro automatically changes the units in the combobox to match.

Although this documentation makes references to “the list” for the combobox, there is not necessarily only one list. The combobox maintains a separate list for any unit that is used in it. When units for the combobox are changed, then the list associated with those units is loaded. The number of decimal places, and also whether a list is locked or not, are things that are handled independently for each list.

A Video Describing and Demonstrating the Special Features of My ComboBoxes:

Weed Box Subs in the Macro Manager.

    

  • Start_Weed_Box launches the userform if it is not already open.
  • Toggle_Weed_Box launches the userform if it is not already open, and closes it if it is already open.
  • Remove_Weed_Box_Registry_Entries removes all Registry entries that have been created by the macro. The next time that the macro is used, these entries will be created again, so this sub can be used to get a “fresh start” with default values and settings.
  • The macro normally remembers the position of the form on the screen. If the computer display configuration has been changed in such a way that the remembered position is “off the screen”, then Reset_Weed_Box_StartUpPosition can be used to reset the position to “Center Owner”.

Compatibility.

Weed Box was put together in a CorelDRAW X7 environment, and should work in versions X7-2020.

OK, where's the macro?

JQ_Weed_Box_Current.zip (most recently updated 2021-07-15).

That includes the .GMS file and a simple icon that can be used on a CorelDRAW Toolbar.

Please note that, starting with the version released on 2020-05-04, this macro uses a different scheme for storing combobox value lists and some preferences in the Registry. If you have been using an older version of this macro, those "old" value lists and preferences will not be there when you use the newer version. If you want to "clean out" those old entries that are not used by the newer version of the macro, the best way to do so is to run the Remove_Weed_Box_Registry_Entries sub, which will set the macro back to its default values.

  • 4 comments
  • 0 members are here
Anonymous