I want a code which can entmake a polyline some flag to destination.
I´m not sure if it haves code in forum here. But I´m testing a code which I have little manipulate. It works but if have a rotate text so rotate the text after selection. That´s not my intention.
(defun c:STR (/ foo ss r)
;; Strike through MText/Text (draw line through middle of selected text objects)
;; Alan J. Thompson, 09.20.10
(defun foo (o / a b)
(vla-getboundingbox o 'a 'b)
(mapcar 'set '(a b) (mapcar 'vlax-safearray->list (list a b)))
(list o
(vlax-ename->vla-object
(entmake
(list
(cons 0 "LWPOLYLINE")
(cons 100 "AcDbEntity")
(cons 8 (getvar "clayer"))
(cons 100 "AcDbPolyline")
(cons 90 4)
(list 10 (car b) (cadr a))
(list 10 (car a) (cadr a))
(cons 10 (getpoint "\nDestination: "))
)
)
)
)
)
(if (setq ss (ssget "_:E" '((0 . "MTEXT,TEXT"))))
(progn
(vlax-for x (setq ss (vla-get-activeselectionset
(cond (*AcadDoc*)
((setq *AcadDoc* (vla-get-activedocument
(vlax-get-acad-object)
)
)
)
)
)
)
(setq r (vla-get-rotation x))
(vla-put-rotation x 0.)
(foreach i (foo x) (vla-rotate i (vla-get-insertionpoint x) r))
)
(vla-delete ss)
)
)
(princ)
)