Vla-put-path
- 構文
- (vla-put-path vla-object path)
- 機能
- ブロック、ドキュメント、アプリケーション、または外部参照のパスを指定する。
- 引数
-
- vla-object … VLAオブジェクト(Application、Block、Document、ExternalReference、PointCloud、PointCloudEx)
- path … パスの文字列
- 戻り値
- nil
- MEMO:
- サンプル
(vl-load-com)
(defun c:path_exaple ( / new nme old pth )
; 検索したパスを指定したパスに更新するサンプル
(if (and
(/= "" (setq old (getstring t "\n検索するパス: ")))
(/= "" (setq new (getstring t "\n変更するパス: ")))
)
(vlax-for
blk
(vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(if (and
(= :vlax-true (vla-get-isxref blk))
(vl-string-search old (vl-filename-base (setq pth (vla-get-path blk))))
)
(progn
(setq nme (vl-string-subst new old (vl-filename-base pth)))
(vla-put-path blk (strcat (vl-filename-directory pth) "\\" nme ".dwg"))
(vla-put-name blk nme)
(vla-reload blk)
)))
)
(princ)
)
関連事項