AutoCAD が外部参照ファイルを検索するフォルダを取得します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = object.GetProjectFilePath(ProjectName)
タイプ: PreferencesFiles
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: 文字列
プロジェクトの名前。この名前は、システム変数 PROJECTNAME でもコントロールできます。
タイプ: 文字列
AutoCAD が外部参照ファイルを検索するフォルダ。
追加の注意はありません。
VBA:
Sub Example_GetProjectFilePath()
' This example finds the current project file information.
Dim preferences As AcadPreferences
Set preferences = ThisDrawing.Application.preferences
' Get the current project file information
Dim currProjPath As String
Dim currProjName As Variant
currProjName = ThisDrawing.GetVariable("PROJECTNAME")
If currProjName <> "" Then
currProjPath = preferences.Files.GetProjectFilePath(currProjName)
End If
If currProjPath = "" Then
MsgBox "There is no current project file or path. ", , "GetProjectFilePath Example"
Else
MsgBox "The current project file path is: " & currProjPath, , "GetProjectFilePath Example"
End If
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_GetProjectFilePath()
;; This example finds the current project file information.
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
;; Get the current project file information
(setq currProjName (vlax-variant-value (vla-GetVariable doc "PROJECTNAME")))
(if (/= currProjName "")
(progn
(setq currProjPath (vla-GetProjectFilePath (vla-get-Files preferences) currProjName))
(alert (strcat "The current project file path is: " currProjPath))
)
(alert "There is no current project file or path.")
)
)