TextureMapPath Example

Using Programming Languages other than VBA

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