Strikethrough Text

Function Syntax strike / strike2 / strike3 / ... (customisable)
Current Version 1.2
Download StrikethroughV1-2.lsp
View HTML Version StrikethroughV1-2.html
Donate

Program Description

This application provides a function to allow the user to create custom programs for generating any number of lines above, below or through selected text or attribute objects, in order to create strikethrough, underline or overline text effects.

The core function LM:strikethrough accepts two arguments (parameters): the entity name of a Text, MText, or Attribute object, and a list of lists in which each item defines a polyline to be created through the supplied text object.

The function has the following syntax:

(LM:strikethrough <Entity-Name> '((<Spacing-Factor> <Width-Factor>) ... ))

Here, the Spacing Factor is a numerical value which determines the vertical position of the polyline through the text object as a factor of the text height. A Spacing Factor of zero will result in a polyline through the centre of the text object, giving a strikethrough effect; a positive value will position the line above centre, and a negative value below centre.

The Width Factor is a positive numerical value which determines the width or thickness of the polyline through the text object, again as a factor of the text height.

I have included twelve example programs (six with a single selection, six with multiple selection) which are demonstrated below as examples of how to evaluate the core function with the required parameters.

The program will perform successfully with supplied Single-line Text (DText) objects, Multiline Text (MText) objects with a single line of text, Single-line Attribute objects, or Multiline Attribute objects with a single line of text, at any rotation, drawn in any plane, under all UCS & View settings.

The ability to strikethrough MText is of course now available in more recent versions of AutoCAD, however, this application will hopefully prove useful to those without access to newer versions of the software, or who wish to create multiple strikethrough, underline or overline effects.

Example Programs

I have included the following twelve example programs with the application to demonstrate how the main function may be evaluated with the required parameters to achieve various results:

Strikethrough

;; Single Strikethrough - Single
(defun c:strike ( )
    (LM:strikethrough:single
       '(
            (0.0 0.1)
        )
    )
)

;; Single Strikethrough - Multiple
(defun c:mstrike ( )
    (LM:strikethrough:selection
       '(
            (0.0 0.1)
        )
    )
)

Strikethrough

Double Strikethrough

;; Double Strikethrough - Single
(defun c:strike2 ( )
    (LM:strikethrough:single
       '(
            ( 0.15 0.1)
            (-0.15 0.1)
        )
    )
)

;; Double Strikethrough - Multiple
(defun c:mstrike2 ( )
    (LM:strikethrough:selection
       '(
            ( 0.15 0.1)
            (-0.15 0.1)
        )
    )
)

Double Strikethrough

Triple Strikethrough

;; Triple Strikethrough - Single
(defun c:strike3 ( )
    (LM:strikethrough:single 
       '(
            ( 0.2 0.1)
            ( 0.0 0.1)
            (-0.2 0.1)
        )
    )
)

;; Triple Strikethrough - Multiple
(defun c:mstrike3 ( )
    (LM:strikethrough:selection 
       '(
            ( 0.2 0.1)
            ( 0.0 0.1)
            (-0.2 0.1)
        )
    )
)

Triple Strikethrough

Underline

;; Underline - Single
(defun c:under ( )
    (LM:strikethrough:single 
       '(
            (-0.8 0.1)
        )
    )
)

;; Underline - Multiple
(defun c:munder ( )
    (LM:strikethrough:selection 
       '(
            (-0.8 0.1)
        )
    )
)

Underline

Double Underline

;; Double Underline - Single
(defun c:under2 ( )
    (LM:strikethrough:single 
       '(
            (-0.8  0.05)
            (-1.0  0.05)
        )
    )
)

;; Double Underline - Multiple
(defun c:munder2 ( )
    (LM:strikethrough:selection 
       '(
            (-0.8  0.05)
            (-1.0  0.05)
        )
    )
)

Double Underline

Double Overline & Underline

;; Double Overline & Underline - Single
(defun c:overunder2 ( )
    (LM:strikethrough:single 
       '(
            ( 1.0 0.05)
            ( 0.8 0.05)
            (-0.8 0.05)
            (-1.0 0.05)
        )
    )
)

;; Double Overline & Underline - Multiple
(defun c:moverunder2 ( )
    (LM:strikethrough:selection 
       '(
            ( 1.0 0.05)
            ( 0.8 0.05)
            (-0.8 0.05)
            (-1.0 0.05)
        )
    )
)

Double Overline & Underline

Instructions for Running

Please refer to How to Run an AutoLISP Program.

textsize

increase · reset · decrease

Designed & Created by Lee Mac © 2010