I've combined a portion of Lee Mac's StrikethroughV1-1.lsp with a routine to copy a piece of text and turn the original text red...
It only runs once, then I have to for now, drag and drop to run again. If I hit an Enter after the first run through ACAD executes the last issued AutoCAD command.
What I'm trying to achieve.
User selects text to copy
User places copied text at new point and the original text is turned to RED
Routine draws a line through the copied text with the line being put on the "Cloud" layer.
Tedit command selects the original piece of text for user to edit. I haven't added this yet.
Repeats for user to select another piece of text to copy/change/strike and edit.
;; Single Strikethrough
'(
(0.0 0.1)
)
)
)
)
)
;; Strikethrough Text - Lee Mac
;; Generates polylines through the supplied text object, with spacing & width given by the supplied parameter list.
;; ent - [ent] Text or MText entity
;; par - [lst] List of ((<Spacing Factor> <Width Factor>) ... ) for each polyline
;; Returns: [lst] List of created polyline entities
(defun LM:strikethrough
( ent par
/ ang enx hgt lst md1 md2 rtn
) )
'( (000 . "LWPOLYLINE")
(100 . "AcDbEntity")
(100 . "AcDbPolyline")
(008 . "CLOUD")
(090 . 1)
(070 . 0)
)
;(LM:defaultprops enx)
)
)
)
rtn
)
)
)
)
)
rtn
)
;; Midpoint - Lee Mac
;; Returns the midpoint of two points
)
;; Default Properties - Lee Mac
;; Returns a list of DXF properties for the supplied DXF data,
;; substituting default values for absent DXF groups
(defun LM:defaultprops
( enx
) '(
(006 . "BYLAYER")
(008 . "0")
(039 . 0.0)
(048 . 0.0)
(062 . 256)
(370 . -1)
)
)
)
;; Text Box - gile / Lee Mac
;; Returns an OCS point list describing a rectangular frame surrounding the supplied Text or MText entity
;; enx - [lst] Text or MText DXF data list
(defun mytextbox
( enx
/ bpt hgt jus lst ocs org rot wid
) )
)
(cond ((member jus '
(1 2 3)) (- hgt
)) ((member jus '
(4 5 6)) (/ hgt
-2.0)) (0.0)) )
)
)
)
'(0.0 0.0 1.0)
)
)
)
)
;; Matrix x Vector - Vladimir Nesterovsky
;; Args: m - nxn matrix, v - vector in R^n
)
(defun RedText
( / ENT S SS
) (command "_.copy" s
"" pause pause
) )
(command "_.chprop" s
"" "_C" "1" "") )
)
)
)
(REDTEXT)
(STRIKE)
It's not possible in it's current state, but my original idea was...
User selects text to copy.
Text is copied and placed by user and line on "cloud" layer is drawn through text
User continues copy/strike through as many times as they want.
Routine remembers the order the original text was selected, changes all original text to red and executes the TEdit command in original selected order.
J. Logan
ACAD 2015