I don't know how else to title this thread. I have this one routine that will continue text below it. It works fine for all justification except Middle Left, and Top Left. For some reason it acts as if it is only left justified, and sets the text alignment point (vlax term) to '(0.0.0 0.0). I have no idea why, and am asking if anyone can enlighten me. I will put a work around for now, but wish it to work the way it did before 2006.
Thanks in advance.
(defun c:XX (/ Ent Obj ActDoc Clay StyList TxtSty TxtHt TxtRot StyObj DftHt TxtAli InsPt TxtAli TxtAliStr
clay ocmd)
; Continue notes at the same rotation, height and layer.
; Sub's 'tmw:nentsel
(if (setq Ent (tmw:nentsel "TEXT,ATTRIB" "\n Select text object: "))
(progn
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vla-StartUndoMark ActDoc)
(setq clay (getvar "clayer"))
(setq ocmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "_.ucs" "_w")
(setq StyList (vla-get-TextStyles ActDoc))
(setq Obj (MakeX Ent))
(setvar "clayer" (vla-get-Layer Obj))
(setq TxtSty (vla-get-StyleName Obj))
(setq TxtHt (vla-get-Height Obj))
(setq TxtRot (RTD (vla-get-Rotation Obj)))
(vlax-for item StyList
(if (= (vla-get-Name item) TxtSty)
(progn
(setq StyObj item)
(setq DftHt (vla-get-Height item))
(vla-put-Height item 0.0)
)
)
)
(setq TxtAli (vla-get-Alignment Obj))
(if (= TxtAli 0)
(setq InsPt (vlax-get Obj 'InsertionPoint))
(setq InsPt (vlax-get Obj 'TextAlignmentPoint))
)
(cond
((= TxtAli 1)
(setq TxtAliStr "Center")
)
((= TxtAli 2)
(setq TxtAliStr "Right")
)
((= TxtAli 4)
(setq TxtAliStr "Middle")
)
((= TxtAli 6)
(setq TxtAliStr "TL")
)
((= TxtAli 7)
(setq TxtAliStr "TC")
)
((= TxtAli 8)
(setq TxtAliStr "TR")
)
((= TxtAli 9)
(setq TxtAliStr "ML")
)
((= TxtAli 10)
(setq TxtAliStr "MC")
)
((= TxtAli 11)
(setq TxtAliStr "MR")
)
((= TxtAli 12)
(setq TxtAliStr "BL")
)
((= TxtAli 13)
(setq TxtAliStr "BC")
)
((= TxtAli 14)
(setq TxtAliStr "BR")
)
)
(if (= TxtAli 0)
(command "_.text" "_s" TxtSty InsPt TxtHt TxtRot " ")
(command "_.text" "_s" TxtSty "_j" TxtAliStr InsPt TxtHt TxtRot " ")
)
(command "_.dtext" "")
(vla-put-Height StyObj DftHt)
(setvar "clayer" clay)
(command "_.ucs" "_p")
(setvar "cmdecho" ocmd)
(vla-EndUndoMark ActDoc)
)
)
(princ)
)
;----------------------------------------------------------------
(defun tmw:nentsel (EntType Message / Ent)
(setvar "errno" 0)
(while (and (not Ent) (/= (getvar "errno") 52))
(setq Ent (nentsel Message))
(if
(and
Ent
(wcmatch (cdr (assoc 0 (entget (car Ent)))) (strcase EntType))
)
(car Ent)
(setq Ent nil)
)
)
)