Macro Language Reference > Macros > Graphic > tgnsplit
  
tgnsplit
Description
Splits a selected shape into sections, either horizontally, vertically, or both. The precise behaviour of tgnsplit depends on what sort of shape is selected; the results for boxes, circles and grouped objects being very different.
 
Example 153. Split an object graphic box into smaller boxes
The macro below splits a box shape measuring 100mm×50mm into four equal-sized smaller boxes measuring 25mm×50mm:
tgnsplit (1,1,1,1)
The example below creates one box 40mm×50mm and 3 boxes 20mm×50mm from the same original box size as above:
tgnsplit (20mm+1,1,1,1)
Percentage-size and proportional components can be used together:
tgnsplit (2,3,30%)
tgnsplit (1+3mm+2,2,3+10%,10mm+5%+2,4mm+2pt+0.5in)
The example below expands the box from the top left:
tgnsplit (150%)
The example below sets the box size from the top left:
tgnsplit (150mm),(40mm)
From these last examples it can be seen that if there are no proportional components then the overall size of the new box(es) can be different to the original box size.
Syntax
tgnsplit num cols:n? ( ratio:n ) num rows:n? colour:c?
tgnsplit
[no parameter]
Invoke the Number Split dialog box.
num cols
The number of rows into which to split the shape vertically.
ratio
The proportion in which each column would relate to each other. The ratio proportion can consist of up to three components: a proportional component, a fixed-size component and a percentage-size component. Each ratio portion will have its components separated by + signs. Fixed-size components must have a suffix indicating the units to be used (mm, in, pt, etc.).
* 
The default units of measurement do not apply in this case since numbers without a suffix are treated as proportional components.
num rows
The number of rows into which to split the shape horizontally.
colour
The names of one or more colours to apply to each split, in order from the top left box to the bottom right box moving from left to right. If the number of boxes exceeds the number of colours specified the colour sequence will automatically be repeated until all the boxes are filled.
Additional Information
When a group of objects is selected tgnsplit can be used to make multiple copies of the entire group within the bounding box of the original. This can be a good way of making patterns such as borders. The macro shown below was used to turn the group object on the left into a border pattern (the centre groups were then selected and cut):
tgnsplit 8,8
tgnsplit can also be used to scale a selected graphic shape: for example, the macro shown below scales the selected shape to 50 per cent of its size.
tgnsplit (50%)(50%)
* 
This does not work on circles or ellipses, which should be grouped with tggroup before being scaled in this way.
Related Links