Vla-get-autosavepath
- 構文
- (vla-get-autosavepath vla-object)
- 機能
- AutoSaveInterval プロパティを使用して自動保存を有効にしたときに作成されるファイルのパスを取得する。
- 引数
-
- vla-object … PreferencesFilesのVLAオブジェクト
- 戻り値
- 自動保存ファイルのドライブとパス。
- MEMO: このプロパティの値は、システム変数 SAVEFILEPATHに格納される。
- サンプル
(vl-load-com)
(defun c:Example_AutoSavePath()
;; 自動保存ファイルのパスを取得・変更するサンプル
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
;; 現在の AutoSavePath
(setq currAutoSavePath (vla-get-AutoSavePath (vla-get-Files preferences)))
(if (= currAutoSavePath "")
(alert "AutoSavePath is not currently set.")
(alert "現在の自動保存パスは " currAutoSavePath)
)
;; 変更
(setq newAutoSavePath "C:\\MyCAD\\")
(vla-put-AutoSavePath (vla-get-Files preferences) newAutoSavePath)
(alert (strcat "新しい自動保存パスは " newAutoSavePath))
;; 戻す
(vla-put-AutoSavePath (vla-get-Files preferences) currAutoSavePath)
(if (= currAutoSavePath "")
(alert "自動保存パスをNullにリセット")
(alert (strcat "自動保存パスを元に戻す " currAutoSavePath))
)
)
関連事項