It is sometimes necessary to place text over lines of an existing drawing and break those lines on either side of the text.
This can be done for a fixed length text string with a block consisting of either a rectangular trim boundary or a mask, used with a block-attribute text-place-holder that can be changed on each insertion of the block.
Procedure for the trim boundary method (masking is dealt with at the end):
(1) Create the entities for the block. (2) Create the block. (3) Insert the block in the drawing.
Create the Entities:
With Layer zero active, create a block attribute consisting of a series of "X's" (yes: UPPER case) -- one for each letter up to the maximum number that will be wanted in the fixed length text string. Set this to 1 unit high text (i.e. 1 mm for metric units using mm).
Click DRAW > BLOCK > DEFINE BLOCK ATTRIBUTES (or type MakeBlockAttribute).
In the block Attribute Definition window complete the boxes as follows:
- Name: Type place-holder text as described above.
- Caption: A name of your choice.
- Default Value: Type the text as before.
- Text Style: Leave as set or select the name of the required text style.
- Justification: Middle centre.
- Height: 1
- Rotation: Leave at zero degrees
- Lock in Block: Check the box - so that the text always stays with the box
- Insertion Point > Specify Later: Check the box - to allow positioning the block on insertion.
- Behaviour: Predefined - possibly already set to this.
- Select OK. -- the text attribute should now appear in the drawing space ready for positioning.
- Place it in a convenient clear space.
Zoom in on the text until it fills 50% to 75% of the screen.
With the rectangle tool draw a rectangle around the block attribute setting it visually to achieve boundary distances balanced with the text height.
(Optional) Precisely position the rectangle in relation to the text as follows:
- RIGHT-CLICK the Esnap button at the bottom of the page and select SETTINGS.
- Make sure the box is checked for "Enable EntitySnaps (ESnaps)" and on the same line select the "Clear All" button
- Check the boxes to set esnaps END and INSERT, and select OK.
- Select MODIFY > MOVE, select the rectangle, and press ENTER.
- Use SHIFT + RIGHT-CLICK to bring up the esnap over-rides selection box and select MID BETWEEN 2 POINTS.
- Select diagonally opposite corners of the rectangle which will establish the mid point between them.
- Select the text element to establish its insertion point and bring the two elements into perfect alignment.
Place the rectangle on its own layer:
- Select FORMAT > LAYER or select the LAYERS MANGER button.
- Select NEW and fill in the details for a new layer renaming it as "TrimBdy" (or other of your choice),
- In the PRINT column set the icon so that it is struck out (i.e.printing turned off for all entities on this layer).
- (Optional) Set a color for the layer.
- IMPORTANT: select OK to close the window or the new layer will not be created.
The new layer should now be available in the layers drop-down window.
Select the text boundary box and in the properties palette change its layer to "TrimBdy" and check that LineColor shows BYLAYER.
The bounding box will now be showing the color of the TrimBdy layer.
Create the Block:
Select DRAW > BLOCK > DEFINE or type MAKEBLOCK and follow the prompts in the "Block definition" window:
- Name: Select a short descriptive name of your choice
- Description: Optional
- Settings:
- Apply uniform scale: Check this box
- Allow block to explode Leave as is (normally checked – i.e. active)
- Attach hyperlink Ignore
- Units Leave as is unless it differs from the units you are using
- Base Point:
Click "Select in graphics area" button and ...
SHIFT + RIGHT-CLICK > INSERT then select the insertion point of the text. (A different base point may be selected if preferred.) - Block entities:
Click the "Select in graphics area" button and ...
Window-select the bounding box and text attribute and press ENTER. - Radio buttons: Select "Remove from drawing" so that block entities on layer zero are removed from the drawing.
- Select OK.
Select INSERT > BLOCK... and in the "Insert Block" window check that the new block is listed in the box or the associated drop down list. If it is your block is now ready to use.
Select CANCEL to close the window.
Insert the block:
On the layer where you want the text to appear, select INSERT > BLOCK...
and in the "Insert Block" window select your block from the drop-down list if it is not already showing in the "Name" box.
Complete the other choices by checking the top two "Specify Later" boxes, setting the "Rotate" choices according to your need, and select OK.
Remember that the text is only 1unit high so if you want 10 unit high text just specify that at the Specify scale>> prompt that comes up on the command line after you click to position the text.
See below for setting the text.
The bounding box can be used as a cutting edge for trimming any lines that lie behind the text box.
The bounding box is set so that it will not print. Change the setting on the "Trimbdy" layer to reverse that.
The on-screen visibility of the bounding box can be controlled by turning off/on the "Trimbdy" layer.
Some suggestions:
To make this block available in any new drawing from now on it needs to be included in your usual drawing template.
The most efficient way to repeat the text in multiple places is to copy the first-inserted item to other positions and then for each entry double-click the block and change the text value in the "Edit BlockAttribute Values" box.
If you want the same text to appear in several insertions change the first insertion to what is wanted before copying to the new position.
The principles outlined above can of course be adapted to a number of different situations with appropriate modification of those instructions. That's over to you.
Here's an example:
Mask instead of Trim
This has a similar visual effect to trimming the lines but actually leaves the lines intact.
It is possible to use a polyline equal in length and width to the length and height of the bounding box, set behind the text, to provide an opaque background panel, in place of the bounding box.
The polyline can be colored to match the workspace background or output medium and serve as a mask over any lines that lie behind the text rather than breaking those lines -- useful when the same lines are to appear in different paper-space views but the text is only wanted in some of them.
If the polyline is placed on its own layer with color “Bylayer” both its color and its printing status can be controlled by changing the layer properties.
When white causes a problem here (may show black in paper-space) use custom color RGB values of 254, 254, 254 instead of 255, 255, 255.
Have fun and enjoy!
