获取 AutoCAD 在其中查找外部参照文件的目录。 支持的平台:仅窗口 签名工 务 局: RetVal = object.GetProjectFilePath(ProjectName)
返回值(RetVal)类型:字符串 AutoCAD 在其中查找外部参照文件的目录。 言论没有额外的评论。 例子工 务 局: 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.")
)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-24 17:52
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.