still messin around on this one. . . tear it up lol
(defun c:halo ( / idx obj sel src sty tab )
(setq sty "Halo Text") ;; Textstyle for copied text
(cond
( (not (tblsearch "style" sty))
(princ (strcat "\nText Style \"" sty "\" does not exist in this drawing."))
)
( (setq sel (ssget '((0 . "TEXT"))))
(setq tab (LM:sortentstable (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))))
(repeat (setq idx (sslength sel))
(setq idx (1- idx)
src (vlax-ename->vla-object (ssname sel idx))
obj (vla-copy src)
)
(vla-put-textstring obj (strcat "%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid src) ">%).TextString>%"))
(vla-put-stylename obj sty)
(vlax-invoke tab 'movebelow (list obj) src)
)
)
)
(princ)
)
;; Catch Apply - Lee Mac
;; Applies a function to a list of parameters and catches any exceptions.
(defun LM:catchapply ( fnc prm / rtn )
(if (not (vl-catch-all-error-p (setq rtn (vl-catch-all-apply fnc prm))))
rtn
)
)
;; Sortents Table - Lee Mac
;; Retrieves the Sortents Table object.
;; obj - [vla] Block Container Object
(defun LM:sortentstable ( obj / dic )
(cond
( (LM:catchapply 'vla-item (list (setq dic (vla-getextensiondictionary obj)) "acad_sortents")))
( (LM:catchapply 'vla-addobject (list dic "acad_sortents" "AcDbSortentsTable")))
)
)
;; ObjectID - Lee Mac
;; Returns a string containing the ObjectID of a supplied VLA-Object
;; Compatible with 32-bit & 64-bit systems
(defun LM:objectid ( obj )
(eval
(list 'defun 'LM:objectid '( obj )
(if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring)
(list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false)
'(itoa (vla-get-objectid obj))
)
)
)
(LM:objectid obj)
)
;; Active Document - Lee Mac
;; Returns the VLA Active Document Object
(defun LM:acdoc nil
(eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))
(LM:acdoc)
)
(vl-load-com) (princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:HALOTEXT()
(command "._style" "HALO TEXT" "fkg.shx" "0.3" "1.0" "0" "no" "no" )
(command "-layer" "make" "TBWHITE" "color" "Truecolor" "255,255,255" "" "")
(command "-layer" "make" "TBBLACK" "color" "Truecolor" "0,0,0" "" "")
(command "._Text" "_S" "HALO TEXT" "17.125,5.375" 0.1875 "HALO TEXT")
(command "_change" "last" "" "properties" "lw" "1.4" "")
(command "lwdisplay" "on")
(c:HALO)
;;Stuck here... I Have to type in previous lol...
(command "_change" "last" "" "properties" "layer" "TBWHITE" "")
(command "_change" "last" "" "properties" "lw" "bylayer" "")
(command "._draworder" "_l" "" "_b")
(command "_zoom" "Extents")
(setq st (ssget "_X" '((0 . "TEXT,MTEXT") (7 . "HALO TEXT"))))
(command ".-group" "create" "HALO" "" "previous" "")
(princ))
(C:HALOTEXT)