;;グループ名のリスト
(defun y_list_group (/ GR LST)
(vlax-for GR
(vla-get-groups (vla-get-activedocument (vlax-get-acad-object)))
(setq LST (cons (vla-get-name GR) LST))
)
(mapcar 'strcase (reverse LST))
)
;;グループを消す
(defun c:group_dell(
/
GROBJ
)
(setq GROBJ (vla-get-groups (vla-get-activedocument (vlax-get-acad-object))))
(foreach n (y_list_group)
(vlax-invoke-method (vla-item GROBJ n) 'Delete)
)
(princ)
)
This entry was posted on 木曜日, 3月 23rd, 2006, 6:57 PM and is filed under LISP.
You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
#1 by liki - 3月 24th, 2006 at 19:49
(foreach)と同様(vlax-for)の引数も関数ローカルのようです。
(defun y_list_group (/ LST)
…
)
(setq GR “TEST”)
(vlax-for GR …)
(princ GR)
>TEST
#2 by ゆり - 3月 28th, 2006 at 12:38
あまり気にしたことなかった(笑)