指定 AutoCAD 在其中搜索渲染纹理映射的目录。 支持的平台:仅窗口 属性值只读:不 类型:字符串 用于呈现纹理映射的目录的位置。 言论可以使用分号 (;) 输入多个路径到路径。 例子工 务 局: Sub Example_TextureMapPath()
' This example returns the current setting of
' TextureMapPath. It then changes the value, and finally
' it resets the value back to the original setting.
Dim preferences As AcadPreferences
Dim currTextureMapPath As String
Dim newTextureMapPath As String
Set preferences = ThisDrawing.Application.Preferences
' Retrieve the current TextureMapPath value
currTextureMapPath = preferences.Files.TextureMapPath
MsgBox "The current value for TextureMapPath is " & currTextureMapPath, vbInformation, "TextureMapPath Example"
' Change the value for TextureMapPath
newTextureMapPath = "TestTextureMapPath"
preferences.Files.TextureMapPath = newTextureMapPath
MsgBox "The new value for TextureMapPath is " & newTextureMapPath, vbInformation, "TextureMapPath Example"
' Reset TextureMapPath to its original value
preferences.Files.TextureMapPath = currTextureMapPath
MsgBox "The TextureMapPath value is reset to " & currTextureMapPath, vbInformation, "TextureMapPath Example"
End Sub
Visual LISP: (vl-load-com)
(defun c:Example_TextureMapPath()
;; This example returns the current setting of
;; TextureMapPath. It then changes the value, and finally
;; it resets the value back to the original setting.
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
;; Retrieve the current TextureMapPath value
(setq currTextureMapPath (vla-get-TextureMapPath (vla-get-Files preferences)))
(alert (strcat "The current value for TextureMapPath is " currTextureMapPath))
;; Change the value for TextureMapPath
(setq newTextureMapPath "TestTextureMapPath")
(vla-put-TextureMapPath (vla-get-Files preferences) newTextureMapPath)
(alert (strcat "The new value for TextureMapPath is " newTextureMapPath))
;; Reset TextureMapPath to its original value
(vla-put-TextureMapPath (vla-get-Files preferences) currTextureMapPath)
(alert (strcat "The TextureMapPath value is reset to " currTextureMapPath))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 05:58
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.