Vla-delete
- 構文
- (vla-delete vla-object)
- 機能
- 指定されたオブジェクトを削除する。
- 引数
-
- vla-object … VLAオブジェクト
- 戻り値
- nil
- サンプル
(defun c:my-wblock (/ a_msp a_blks blknam fname a_blk a_sss a_ss i) (vl-load-com) (setq *ActDoc* (vla-get-ActiveDocument (vlax-get-Acad-Object))) (setq a_msp (vla-get-modelspace *ActDoc*) a_blks (vla-get-blocks *ActDoc*) blknam (getstring t "ブロック名を入力 : ") fname (getstring t "ブロックファイル名を入力 : ") a_blk (vla-item a_blks blknam) a_sss (vla-get-SelectionSets *ActDoc*) a_ss (vla-add a_sss "myset") i 0 ) (setq sa (vlax-make-safearray vlax-vbobject (cons 0 (- (vla-get-count a_blk) 1)) ) ) (vlax-for itm a_blk (vlax-safearray-put-element sa i itm) (setq i (1+ i)) ) (setq obj_arr (vla-copyobjects *ActDoc* sa a_msp)) (vla-additems a_ss obj_arr) (vla-Wblock *ActDoc* fname a_ss) (vla-delete a_ss) (foreach itm (vlax-safearray->list (vlax-variant-value obj_arr)) (vla-delete itm) ) (princ) )
関連事項