(defun c:aa (/ e)
(setq e (entnext (tblobjname "BLOCK" (cdr (assoc 2 (entget (car (entsel "\n블럭을 선택하세요!! :"))))))))
(while
(not (eq (cdr (assoc 2 (entget e))) "SEQEND"))
(if (eq (cdr (assoc 0 (entget e))) "TEXT")
(vla-put-Alignment (vlax-ename->vla-object e) acAlignmentMiddle)
)
(setq e (entnext e))
)
(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acAllViewports);The syntax does not return after the end regen while statement.
)
(setq e (entnext e))
(defun c:aa (/ e)
(setq e (tblobjname "BLOCK" (cdr (assoc 2 (entget (car (entsel "\n블럭을 선택하세요!! :")))))))
(while (and (setq e (entnext e)) (not (eq (cdr (assoc 2 (entget e))) "SEQEND")))
(if (eq (cdr (assoc 0 (entget e))) "TEXT")
(vla-put-Alignment (vlax-ename->vla-object e) acAlignmentMiddle)
)
)
(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acAllViewports)
)
Lisp still rookies....^^
FWIW -
Given that you're converting each entity in your selection set to a Vla-Object, consider iterating the ActiveSelectionSet Collection of the ActiveDocument Object using vlax-for.
(defun c:aa ()
(ssget)
(vlax-for o (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))
(if (eq (vla-get-objectname o) "AcDbText")
(vla-put-Alignment (vlax-ename->vla-object o) acAlignmentMiddle)
)
)
)
Actually in your case a selection set won't cut it. You're editing the objects inside a block so simply iterate through the block's collection using vlax-for:Code - Auto/Visual Lisp: [Select]BTW, what editor do you use for your source-code. If I copy-paste your code into VLIDE that UniCode block-name becomes a string of question marks.
(vlax-for obj blk
Edit: sorry ... that's the message for entsel :-[ ... stupid of me.