How to quickly Draw a Frame Around Text in AutoCAD?
If you are working with text objects in AutoCAD, you may want to add a frame around them to make them stand out or highlight them. However, drawing a frame manually can be tedious and inaccurate, especially if you have many text objects with different sizes and orientations.
Fortunately, there is a way to quickly draw a frame around text in AutoCAD using a simple LISP code. In this post, I will show you how to use a LISP code that can draw a frame around any text object in your drawing with one click.
What is the AutoCAD LISP and how do you upload it to AutoCAD?
This program enables the user to create an associative textbox surrounding a Text or MText object in the drawing. The size, position, orientation & rotation of the resulting textbox will be automatically updated following modification to the associated Text or MText object.
The user may create an associative textbox by issuing the 'tbox' command at the AutoCAD command line. Upon calling the program, the user is prompted to specify an Offset Factor for the textbox and the shape of the textbox to be created.
The Offset Factor controls the dimensions of the textbox relative to the size of the associated annotation object and is a function of the text height. To provide an example, specifying an Offset Factor of 0.35 will result in a textbox that is offset from the text object by 0.35 multiplied by the text height of the object.
Upon entering a valid Offset Factor, the user may choose from three types of textbox: Circle, Rectangle, or Slot. The circular textbox will have a diameter equal to the length of the diagonal of the rectangular textbox. The Slot textbox will have dimensions equal to the rectangular textbox, however, the vertical edges (relative to the text object) will be semi-circular.
The program will remember the previously used settings for both the offset factor & textbox type, and these settings will be available as default options at both prompts throughout the active drawing session.
The user will then be prompted to select either a Text or MText object to enclose with the textbox. At this prompt, the user will be notified if the selected Text or MText object already possesses an associative textbox.
Textbox associativity may be removed at any time using by issuing the 'rtbox' (Remove Textbox) command at the AutoCAD command line. When called, the user is prompted to select either a text or textbox object to remove the associativity between the pair. At this prompt, the user also has the option to remove associativity from all textboxes in the drawing.
Note that this program will only remove the associative nature of the textbox - the user may subsequently delete the text or textbox object if required.
After you have uploaded the LISP file, you need to type 'TBOX' to activate it.
Specify the offset factor of the box.
Then choose what will enclose the text (Circle, Slot, Rectangle).
You can download the lisp from here.
Benefits of Quickly Drawing a Frame Around Text in AutoCAD
By using this LISP code, you can save a lot of time and effort when working with text objects in AutoCAD. You can easily draw a frame around any text object with one click, without having to measure, draw, and trim the frame manually. You can also use this LISP code to enhance the appearance and readability of your text objects, especially if they are overlapping or crowded with other objects.
This LISP code is also very flexible and versatile. You can use it on any type of text object, regardless of its size, orientation, or alignment. You can also use it on any layer, color, or line type of text. You can even use it on text objects that are part of blocks or groups, as long as they are not nested or locked.
Comments
Post a Comment
Write a comment